-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
435 additions
and
8,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
image: | ||
- Visual Studio 2017 | ||
- Visual Studio 2019 Preview | ||
- Visual Studio 2019 | ||
|
||
platform: | ||
- x64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Revision history for CG_Labs | ||
|
||
|
||
v2019.1 YYYY-MM-DD | ||
================== | ||
|
||
* Add a “CHANGES.rst” file that will list the different modifications done, | ||
from now on. | ||
* Ensure Log is destroyed before its clients (GitLab #45) | ||
* Unify the TRS interfaces between the node and the TRSTransform classes, by | ||
using and exposing a TRSTransform instance inside the node class (GitLab #46) | ||
* Select polygon mode from GUI, and simplify it (GitLab #47) | ||
* Toggle visualisation of light cones in wireframe mode from the GUI | ||
* Switch between shaders from GUI (GitLab #48) | ||
* Edit node::render() to take parent transform | ||
* Rename `WindowManager::CreateWindow()` to | ||
`WindowManager::CreateGLFWWindow()`, to avoid conflict with Windows API | ||
macro. | ||
* Replace lodepng with stb, to also support JPEG file loading (GitLab #41) | ||
* Add shader for celestial rings and load it in lab1 (GitLab #51) | ||
* AppVeyor: switch from VS 2019 Preview to VS 2019 | ||
* README: Add tinyfiledialogs to dependencies | ||
* (HEAD -> 2019_updates) README: Sort the list of dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set (stb_SOURCE_DIR ${FETCHCONTENT_BASE_DIR}/stb-source) | ||
|
||
if (NOT EXISTS ${stb_SOURCE_DIR}) | ||
message (STATUS "Cloning stb…") | ||
execute_process ( | ||
COMMAND ${GIT_EXECUTABLE} clone --depth=1 | ||
https://github.com/nothings/stb | ||
${stb_SOURCE_DIR} | ||
OUTPUT_QUIET | ||
ERROR_VARIABLE stderr | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies | ||
) | ||
if (result) | ||
message (FATAL_ERROR "Failed to clone stb: ${result}\n" | ||
"Error output: ${stderr}") | ||
endif () | ||
endif () | ||
|
||
add_library( stb::stb INTERFACE IMPORTED) | ||
set_target_properties(stb::stb PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${stb_SOURCE_DIR}" | ||
INTERFACE_SOURCES "${CMAKE_SOURCE_DIR}/src/core/stb_impl.c" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 410 | ||
|
||
uniform sampler2D diffuse_texture; | ||
uniform sampler2D opacity_texture; | ||
uniform int has_diffuse_texture; | ||
uniform int has_opacity_texture; | ||
|
||
in VS_OUT { | ||
vec2 texcoord; | ||
} fs_in; | ||
|
||
out vec4 frag_color; | ||
|
||
void main() | ||
{ | ||
float alpha = 1.0f; | ||
if (has_opacity_texture != 0) { | ||
alpha = texture(opacity_texture, | ||
vec2(1.0f - fs_in.texcoord.x, fs_in.texcoord.y)).r; | ||
if (alpha == 0.0f) | ||
discard; | ||
} | ||
|
||
if (has_diffuse_texture != 0) | ||
frag_color = texture(diffuse_texture, fs_in.texcoord); | ||
else | ||
frag_color = vec4(1.0); | ||
|
||
frag_color *= alpha; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 410 | ||
|
||
layout (location = 0) in vec3 vertex; | ||
layout (location = 2) in vec3 texcoord; | ||
|
||
uniform mat4 vertex_model_to_world; | ||
uniform mat4 vertex_world_to_clip; | ||
|
||
out VS_OUT { | ||
vec2 texcoord; | ||
} vs_out; | ||
|
||
|
||
void main() | ||
{ | ||
vs_out.texcoord = vec2(texcoord.x, texcoord.y); | ||
|
||
gl_Position = vertex_world_to_clip * vertex_model_to_world * vec4(vertex, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.