mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
Merge branch 'master' of https://github.com/JoeyDeVries/LearnOpenGL
This commit is contained in:
@@ -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} $<TARGET_FILE_DIR:${NAME}>)
|
||||
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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user