mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-12-06 06:46:35 +01:00
Compare commits
2 Commits
3a885ee250
...
df949a5afc
| Author | SHA1 | Date | |
|---|---|---|---|
| df949a5afc | |||
| 9b173c64a6 |
2
.github/workflows/cmake.yml
vendored
2
.github/workflows/cmake.yml
vendored
@@ -14,7 +14,7 @@ env:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
timeout-minutes: 10
|
||||
timeout-minutes: 15
|
||||
|
||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
|
||||
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
|
||||
FIND_PATH(SDL2_INCLUDE_DIR_TEMP SDL.h
|
||||
HINTS
|
||||
$ENV{SDL2}
|
||||
PATH_SUFFIXES include/SDL2 include SDL2
|
||||
@@ -153,7 +153,7 @@ ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
IF(NOT "${SDL2_INCLUDE_DIR_TEMP}" MATCHES ".framework")
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||
# seem to provide SDL2main for compatibility even though they don't
|
||||
@@ -189,7 +189,7 @@ IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
/opt
|
||||
)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
ENDIF(NOT "${SDL2_INCLUDE_DIR_TEMP}" MATCHES ".framework")
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
|
||||
# SDL2 may require threads on your system.
|
||||
@@ -243,23 +243,32 @@ SET(SDL2_FOUND "NO")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
############add_library(SDL UNKNOWN IMPORTED)
|
||||
#target_link_libraries(SDL INTERFACE ${SDL2_LIBRARY})
|
||||
#target_include_directories(SDL INTERFACE ${SDL2_INCLUDE_DIR})
|
||||
#set_target_properties(SDL PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${SDL2_LIBRARY}")
|
||||
|
||||
#set_target_properties(SDL PROPERTIES
|
||||
#INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}")
|
||||
|
||||
#set_target_properties(SDL PROPERTIES
|
||||
#IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
#IMPORTED_LINK_INTERFACE_LIBRARIES "${SDL2_LIBRARY}"
|
||||
#LINK_INTERFACE_LIBRARIES "${SDL2_LIBRARY}")
|
||||
|
||||
#IMPORTED_LOCATION "${SDL2_LIBRARY}")
|
||||
|
||||
set(SDL2_INCLUDE_DIR ${SDL2_INCLUDE_DIR_TEMP} CACHE STRING "Where the SDL2 Headers can be found")
|
||||
SET(SDL2_INCLUDE_DIR_TEMP "${SDL2_INCLUDE_DIR_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
SET(SDL2_FOUND "YES")
|
||||
else() # SDL2_LIBRARY_TEMP
|
||||
# try to pkg-config fallback
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PKG_C_SDL2 QUIET sdl2)
|
||||
if (PKG_C_SDL2_FOUND)
|
||||
SET(SDL2_LIBRARY_TEMP ${PKG_C_SDL2_LIBRARIES})
|
||||
SET(SDL2_INCLUDE_DIR_TEMP ${PKG_C_SDL2_INCLUDE_DIRS})
|
||||
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
set(SDL2_INCLUDE_DIR ${SDL2_INCLUDE_DIR_TEMP} CACHE STRING "Where the SDL2 Headers can be found")
|
||||
SET(SDL2_INCLUDE_DIR_TEMP "${SDL2_INCLUDE_DIR_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
#message("II set include dir to ${SDL2_INCLUDE_DIR}")
|
||||
|
||||
SET(SDL2_FOUND "YES")
|
||||
endif()
|
||||
endif()
|
||||
ENDIF(SDL2_LIBRARY_TEMP)
|
||||
|
||||
else() #emsripten
|
||||
@@ -288,4 +297,11 @@ INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||
|
||||
if (SDL2_FOUND)
|
||||
if (NOT TARGET SDL2::SDL2)
|
||||
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
||||
target_include_directories(SDL2::SDL2 INTERFACE ${SDL2_INCLUDE_DIR})
|
||||
target_link_libraries(SDL2::SDL2 INTERFACE ${SDL2_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ in vec2 _uv;
|
||||
|
||||
out vec3 _out_color;
|
||||
|
||||
// global config, keep it constant
|
||||
const float fake_halation_strenth = 1.0;
|
||||
|
||||
void main() {
|
||||
vec3 color = texture(color_tex, _uv).rgb;
|
||||
|
||||
@@ -114,7 +117,16 @@ void main() {
|
||||
//step(vec3(0.0), color)
|
||||
//);
|
||||
|
||||
const vec3 fake_halation_base = vec3(0.03, 0.01, 0.0) * vec3(fake_halation_strenth);
|
||||
const vec3 fake_halation_extraction_offset = vec3(1.0) - fake_halation_base;
|
||||
const vec3 fake_halation_bloom_fact = vec3(1.0) + fake_halation_base;
|
||||
|
||||
if (fake_halation_strenth <= 0.001) {
|
||||
_out_color = max(min(color, vec3(0.0)), color - vec3(1.0));
|
||||
} else {
|
||||
_out_color = max(min(color, vec3(0.0)), color - fake_halation_extraction_offset) * fake_halation_bloom_fact;
|
||||
//_out_color = max(min(color, vec3(0.0)), color - vec3(0.95, 0.97, 1.0)) * vec3(1.10, 1.05, 1.0);
|
||||
}
|
||||
})")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user