diff options
-rw-r--r-- | .DS_Store | bin | 10244 -> 10244 bytes | |||
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | resources/images/back.jpg | bin | 0 -> 740068 bytes | |||
-rw-r--r-- | resources/images/bottom.jpg | bin | 0 -> 280589 bytes | |||
-rw-r--r-- | resources/images/front.jpg | bin | 0 -> 473329 bytes | |||
-rw-r--r-- | resources/images/left.jpg | bin | 0 -> 601885 bytes | |||
-rw-r--r-- | resources/images/nx.png | bin | 0 -> 393798 bytes | |||
-rw-r--r-- | resources/images/ny.png | bin | 0 -> 434286 bytes | |||
-rw-r--r-- | resources/images/nz.png | bin | 0 -> 357235 bytes | |||
-rw-r--r-- | resources/images/px.png | bin | 0 -> 377671 bytes | |||
-rw-r--r-- | resources/images/py.png | bin | 0 -> 272005 bytes | |||
-rw-r--r-- | resources/images/pz.png | bin | 0 -> 377237 bytes | |||
-rw-r--r-- | resources/images/right.jpg | bin | 0 -> 538038 bytes | |||
-rw-r--r-- | resources/images/skyboxes/the_sky_is_on_fire_2k.hdr | bin | 0 -> 5996454 bytes | |||
-rw-r--r-- | resources/images/skyboxes/the_sky_is_on_fire_2k.png | bin | 0 -> 6744548 bytes | |||
-rw-r--r-- | resources/images/top.jpg | bin | 0 -> 346139 bytes | |||
-rwxr-xr-x | resources/shaders/shader.frag | 9 | ||||
-rwxr-xr-x | resources/shaders/shader.vert | 4 | ||||
-rw-r--r-- | src/graphics/shape.cpp | 12 | ||||
-rw-r--r-- | src/skybox.h | 12 |
20 files changed, 26 insertions, 18 deletions
Binary files differ diff --git a/CMakeLists.txt b/CMakeLists.txt index e2083ed..ad833bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,6 +132,13 @@ qt6_add_resources(${PROJECT_NAME} "Resources" resources/images/particle.png + resources/images/nx.png + resources/images/ny.png + resources/images/nz.png + resources/images/px.png + resources/images/py.png + resources/images/pz.png + resources/shaders/caustics.vert resources/shaders/caustics.frag diff --git a/resources/images/back.jpg b/resources/images/back.jpg Binary files differnew file mode 100644 index 0000000..470a679 --- /dev/null +++ b/resources/images/back.jpg diff --git a/resources/images/bottom.jpg b/resources/images/bottom.jpg Binary files differnew file mode 100644 index 0000000..893f394 --- /dev/null +++ b/resources/images/bottom.jpg diff --git a/resources/images/front.jpg b/resources/images/front.jpg Binary files differnew file mode 100644 index 0000000..4e17b77 --- /dev/null +++ b/resources/images/front.jpg diff --git a/resources/images/left.jpg b/resources/images/left.jpg Binary files differnew file mode 100644 index 0000000..5750b91 --- /dev/null +++ b/resources/images/left.jpg diff --git a/resources/images/nx.png b/resources/images/nx.png Binary files differnew file mode 100644 index 0000000..d95f151 --- /dev/null +++ b/resources/images/nx.png diff --git a/resources/images/ny.png b/resources/images/ny.png Binary files differnew file mode 100644 index 0000000..631caa9 --- /dev/null +++ b/resources/images/ny.png diff --git a/resources/images/nz.png b/resources/images/nz.png Binary files differnew file mode 100644 index 0000000..458d7b5 --- /dev/null +++ b/resources/images/nz.png diff --git a/resources/images/px.png b/resources/images/px.png Binary files differnew file mode 100644 index 0000000..7c5dc87 --- /dev/null +++ b/resources/images/px.png diff --git a/resources/images/py.png b/resources/images/py.png Binary files differnew file mode 100644 index 0000000..745687f --- /dev/null +++ b/resources/images/py.png diff --git a/resources/images/pz.png b/resources/images/pz.png Binary files differnew file mode 100644 index 0000000..2a36023 --- /dev/null +++ b/resources/images/pz.png diff --git a/resources/images/right.jpg b/resources/images/right.jpg Binary files differnew file mode 100644 index 0000000..8963037 --- /dev/null +++ b/resources/images/right.jpg diff --git a/resources/images/skyboxes/the_sky_is_on_fire_2k.hdr b/resources/images/skyboxes/the_sky_is_on_fire_2k.hdr Binary files differnew file mode 100644 index 0000000..e669310 --- /dev/null +++ b/resources/images/skyboxes/the_sky_is_on_fire_2k.hdr diff --git a/resources/images/skyboxes/the_sky_is_on_fire_2k.png b/resources/images/skyboxes/the_sky_is_on_fire_2k.png Binary files differnew file mode 100644 index 0000000..5ec3faf --- /dev/null +++ b/resources/images/skyboxes/the_sky_is_on_fire_2k.png diff --git a/resources/images/top.jpg b/resources/images/top.jpg Binary files differnew file mode 100644 index 0000000..4db3c2a --- /dev/null +++ b/resources/images/top.jpg diff --git a/resources/shaders/shader.frag b/resources/shaders/shader.frag index 7fc82ed..ef4e9c7 100755 --- a/resources/shaders/shader.frag +++ b/resources/shaders/shader.frag @@ -44,8 +44,9 @@ float rand(vec4 n) { } vec2 uvFromWorldPoint(vec3 point) { - float u = (point.x - widthBounds[0] * 50) / (widthBounds[1] * 50 - widthBounds[0] * 50); - float v = (point.z - lengthBounds[0] * 50) / (lengthBounds[1] * 50 - lengthBounds[0] * 50); + float scale = 5.f; + float u = (point.x - widthBounds[0] * scale) / (widthBounds[1] * scale - widthBounds[0] * scale); + float v = (point.z - lengthBounds[0] * scale) / (lengthBounds[1] * scale - lengthBounds[0] * scale); return vec2(u, v); } @@ -70,9 +71,9 @@ void main() { vec2 refrUV = uvFromWorldPoint(refrPos); vec2 reflUV = uvFromWorldPoint(reflPos); -// float waterMurkiness = 0.002f; // TODO: Make uniform + float waterMurkiness = 0.003f; // TODO: Make uniform // float waterMurkiness = 0.0005f; // TODO: Make uniform - float waterMurkiness = 0.0005f; // TODO: Make uniform +// float waterMurkiness = 0.000f; // TODO: Make uniform vec3 waterVolumeColor = vec3(red * 0.1f, green * 0.2f, blue * 0.2f); float murkDiffuse = 0.3f; float murkAmbient = 0.8f; diff --git a/resources/shaders/shader.vert b/resources/shaders/shader.vert index 3cd5c17..0994b90 100755 --- a/resources/shaders/shader.vert +++ b/resources/shaders/shader.vert @@ -4,8 +4,8 @@ layout(location = 0) in vec3 position; // Position of the vertex layout(location = 1) in vec3 normal; // Normal of the vertex layout(location = 2) in vec3 texCoords; // Normal of the vertex -uniform float depth = -3000.f; -uniform float skyHeight = 500.f; +uniform float depth = -500.f; +uniform float skyHeight = 100.f; uniform mat4 proj; uniform mat4 view; uniform mat4 model; diff --git a/src/graphics/shape.cpp b/src/graphics/shape.cpp index 7073a7f..e5849fb 100644 --- a/src/graphics/shape.cpp +++ b/src/graphics/shape.cpp @@ -161,12 +161,12 @@ void Shape::draw(Shader *shader, GLenum mode) // Not that one texture is overwriting the other, because if we just load sky it doesn't work // Draws whatever is bound to texture0 no matter what. // Drawing the ground texture. -/* // When ground is being rendered dynamically, don't use static ground image. - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_ground_texture); -// glBindTexture(GL_TEXTURE_2D, 0); - shader->setUniform("groundSampler", 0); - glUniform1i(glGetUniformLocation(shader->id(), "groundSampler"), 0);*/ + // When ground is being rendered dynamically, don't use static ground image. +// glActiveTexture(GL_TEXTURE0); +// glBindTexture(GL_TEXTURE_2D, m_ground_texture); +//// glBindTexture(GL_TEXTURE_2D, 0); +// shader->setUniform("groundSampler", 0); +// glUniform1i(glGetUniformLocation(shader->id(), "groundSampler"), 0); // https://stackoverflow.com/questions/67277087/opengl-glsl-multiple-texture-binding-not-working diff --git a/src/skybox.h b/src/skybox.h index d9995ba..abe78c9 100644 --- a/src/skybox.h +++ b/src/skybox.h @@ -202,12 +202,12 @@ public: - {":resources/images/cupertin-lake_rt.png", - ":resources/images/cupertin-lake_lf.png", - ":resources/images/cupertin-lake_up.png", - ":resources/images/cupertin-lake_dn.png", - ":resources/images/cupertin-lake_bk.png", - ":resources/images/cupertin-lake_ft.png", + {":resources/images/px.png", + ":resources/images/nx.png", + ":resources/images/py.png", + ":resources/images/ny.png", + ":resources/images/pz.png", + ":resources/images/nz.png", }; float ROTATE_SPEED = .01f; // 1 degree per sec |