From 922e127d0e1ecfee1ae2d8723bee65ef3399b5ed Mon Sep 17 00:00:00 2001 From: dotlive Date: Thu, 19 Oct 2017 07:28:10 +0800 Subject: [PATCH 1/2] fix macOS load shader failed. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26c2da9..4f7d07d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ set(CHAPTERS 7.in_practice ) -set(1.getting_started +set(1.getting_started 1.1.hello_window 1.2.hello_window_clear 2.1.hello_triangle @@ -191,7 +191,7 @@ foreach(CHAPTER ${CHAPTERS}) set_target_properties(${NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin/${CHAPTER}") endif(WIN32) # copy shader files to build directory - file(GLOB SHADERS + file(GLOB SHADERS "src/${CHAPTER}/${DEMO}/*.vs" # "src/${CHAPTER}/${DEMO}/*.frag" "src/${CHAPTER}/${DEMO}/*.fs" @@ -202,7 +202,7 @@ foreach(CHAPTER ${CHAPTERS}) # configure_file(${SHADER} "test") add_custom_command(TARGET ${NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SHADER} $) elseif(UNIX) - file(COPY ${SHADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/${CHAPTER}) + file(COPY ${SHADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/${CHAPTER}/${CMAKE_BUILD_TYPE}) endif(WIN32) endforeach(SHADER) From 8fef6cdd3ed58cf99049378200851fe85174f9c4 Mon Sep 17 00:00:00 2001 From: dotlive Date: Thu, 19 Oct 2017 07:30:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=20shader=20file=E2=80=99s=20variable=20?= =?UTF-8?q?name=20dismatched=20with=20source=20file=E2=80=99s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../6.3.coordinate_systems.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/1.getting_started/6.3.coordinate_systems_multiple/6.3.coordinate_systems.fs b/src/1.getting_started/6.3.coordinate_systems_multiple/6.3.coordinate_systems.fs index be379bd..91b9fe8 100644 --- a/src/1.getting_started/6.3.coordinate_systems_multiple/6.3.coordinate_systems.fs +++ b/src/1.getting_started/6.3.coordinate_systems_multiple/6.3.coordinate_systems.fs @@ -3,10 +3,10 @@ out vec4 FragColor; in vec2 TexCoord; -uniform sampler2D ourTexture1; -uniform sampler2D ourTexture2; +uniform sampler2D texture1; +uniform sampler2D texture2; void main() { - FragColor = mix(texture(ourTexture1, TexCoord), texture(ourTexture2, TexCoord), 0.2); + FragColor = mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.2); } \ No newline at end of file