diff --git a/Debug/grk-cw9.exe b/Debug/grk-cw9.exe index 78c361b..d6bd17f 100644 Binary files a/Debug/grk-cw9.exe and b/Debug/grk-cw9.exe differ diff --git a/Debug/grk-cw9.pdb b/Debug/grk-cw9.pdb index de8664c..3ca5772 100644 Binary files a/Debug/grk-cw9.pdb and b/Debug/grk-cw9.pdb differ diff --git a/cw 9/Debug/main.obj b/cw 9/Debug/main.obj index a664ad9..597d77c 100644 Binary files a/cw 9/Debug/main.obj and b/cw 9/Debug/main.obj differ diff --git a/cw 9/shaders/shader_bubble.frag b/cw 9/shaders/shader_bubble.frag index f6baafb..e20b1bc 100644 --- a/cw 9/shaders/shader_bubble.frag +++ b/cw 9/shaders/shader_bubble.frag @@ -2,7 +2,7 @@ uniform vec3 iResolution; //uniform vec3 cameraPos; //uniform vec3 cameraDir; -//uniform mat3 camMat; +uniform mat3 camMat; uniform sampler2D iChannel1; uniform samplerCube iChannel0; uniform float time; @@ -88,7 +88,7 @@ float sdf( vec3 p ) { vec3 n = vec3(sin(time * 0.5), sin(time * 0.3), cos(time * 0.2)); vec3 q = 0.1 * (noise3(p + n) - 0.5); - return length(q + p) - 0.5; + return length(q + p) - 3.5; } vec3 fresnel( vec3 rd, vec3 norm, vec3 n2 ) { @@ -252,7 +252,7 @@ void main() for (int samp = 0; samp < AA_SAMPLES; samp++) { vec2 dxy = dh * vec2(cos(float(samp) * rads), sin(float(samp) * rads)); - vec3 rd = normalize(vec3(p.xy + dxy, 1.5)); // 1.5 is the lens length + vec3 rd = normalize(camMat * vec3(p.xy + dxy, 1.5)); // 1.5 is the lens length vec3 pos = bubblePosition.xyz; bool hit = false; for (int j = 0; j < ITERATIONS; j++) { diff --git a/cw 9/src/ex_9_1.hpp b/cw 9/src/ex_9_1.hpp index 0e76f50..dd1c531 100644 --- a/cw 9/src/ex_9_1.hpp +++ b/cw 9/src/ex_9_1.hpp @@ -244,7 +244,7 @@ void drawBubble(glm::mat4 transformSphere) { glUniform1f(glGetUniformLocation(programBubble, "time"), time); //glUniform3f(glGetUniformLocation(programBubble, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z); //glUniform3f(glGetUniformLocation(programBubble, "cameraDir"), cameraDir.x, cameraDir.y, cameraDir.z); - //glUniformMatrix3fv(glGetUniformLocation(programBubble, "camMat"), 1, GL_FALSE, (float*)&glm::mat3(bubbleSkyboxViewMatrix/)); + glUniformMatrix3fv(glGetUniformLocation(programBubble, "camMat"), 1, GL_FALSE, (float*)&glm::mat3(bubbleSkyboxViewMatrix)); Core::SetActiveTexture(bubbleTexture0, "iChannel0", programBubble, 1); glBindTexture(GL_TEXTURE_CUBE_MAP, bubbleTexture0); @@ -363,11 +363,11 @@ void renderScene(GLFWwindow* window) drawObjectPBR(models::deskContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f); drawObjectPBR(models::doorContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); drawObjectPBR(models::drawerContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f); - //drawObjectPBR(models::marbleBustContext, glm::mat4(), glm::vec3(1.f, 1.f, 1.f), 0.5f, 1.0f); + drawObjectPBR(models::marbleBustContext, glm::mat4(), glm::vec3(1.f, 1.f, 1.f), 0.5f, 1.0f); drawObjectPBR(models::materaceContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f); drawObjectPBR(models::pencilsContext, glm::mat4(), glm::vec3(0.10039f, 0.018356f, 0.001935f), 0.1f, 0.0f); drawObjectPBR(models::planeContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); - //drawObjectPBR(models::roomContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f); + drawObjectPBR(models::roomContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f); drawObjectPBR(models::windowContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f))); diff --git a/cw 9/textures/bubbleSkybox/back.jpg b/cw 9/textures/bubbleSkybox/back.jpg index 6e02c24..260d08e 100644 Binary files a/cw 9/textures/bubbleSkybox/back.jpg and b/cw 9/textures/bubbleSkybox/back.jpg differ diff --git a/cw 9/textures/bubbleSkybox/bottom.jpg b/cw 9/textures/bubbleSkybox/bottom.jpg index 56c60c2..4a0ad43 100644 Binary files a/cw 9/textures/bubbleSkybox/bottom.jpg and b/cw 9/textures/bubbleSkybox/bottom.jpg differ diff --git a/cw 9/textures/bubbleSkybox/front.jpg b/cw 9/textures/bubbleSkybox/front.jpg index 610b3cb..4de401d 100644 Binary files a/cw 9/textures/bubbleSkybox/front.jpg and b/cw 9/textures/bubbleSkybox/front.jpg differ diff --git a/cw 9/textures/bubbleSkybox/left.jpg b/cw 9/textures/bubbleSkybox/left.jpg index a080614..8cc72ac 100644 Binary files a/cw 9/textures/bubbleSkybox/left.jpg and b/cw 9/textures/bubbleSkybox/left.jpg differ diff --git a/cw 9/textures/bubbleSkybox/right.jpg b/cw 9/textures/bubbleSkybox/right.jpg index 5995c0b..8246fc0 100644 Binary files a/cw 9/textures/bubbleSkybox/right.jpg and b/cw 9/textures/bubbleSkybox/right.jpg differ diff --git a/cw 9/textures/bubbleSkybox/top.jpg b/cw 9/textures/bubbleSkybox/top.jpg index 51c8a81..4fc846e 100644 Binary files a/cw 9/textures/bubbleSkybox/top.jpg and b/cw 9/textures/bubbleSkybox/top.jpg differ