good enough
@ -2,7 +2,7 @@
|
|||||||
uniform vec3 iResolution;
|
uniform vec3 iResolution;
|
||||||
//uniform vec3 cameraPos;
|
//uniform vec3 cameraPos;
|
||||||
//uniform vec3 cameraDir;
|
//uniform vec3 cameraDir;
|
||||||
//uniform mat3 camMat;
|
uniform mat3 camMat;
|
||||||
uniform sampler2D iChannel1;
|
uniform sampler2D iChannel1;
|
||||||
uniform samplerCube iChannel0;
|
uniform samplerCube iChannel0;
|
||||||
uniform float time;
|
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 n = vec3(sin(time * 0.5), sin(time * 0.3), cos(time * 0.2));
|
||||||
vec3 q = 0.1 * (noise3(p + n) - 0.5);
|
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 ) {
|
vec3 fresnel( vec3 rd, vec3 norm, vec3 n2 ) {
|
||||||
@ -252,7 +252,7 @@ void main()
|
|||||||
|
|
||||||
for (int samp = 0; samp < AA_SAMPLES; samp++) {
|
for (int samp = 0; samp < AA_SAMPLES; samp++) {
|
||||||
vec2 dxy = dh * vec2(cos(float(samp) * rads), sin(float(samp) * rads));
|
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;
|
vec3 pos = bubblePosition.xyz;
|
||||||
bool hit = false;
|
bool hit = false;
|
||||||
for (int j = 0; j < ITERATIONS; j++) {
|
for (int j = 0; j < ITERATIONS; j++) {
|
||||||
|
@ -244,7 +244,7 @@ void drawBubble(glm::mat4 transformSphere) {
|
|||||||
glUniform1f(glGetUniformLocation(programBubble, "time"), time);
|
glUniform1f(glGetUniformLocation(programBubble, "time"), time);
|
||||||
//glUniform3f(glGetUniformLocation(programBubble, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
|
//glUniform3f(glGetUniformLocation(programBubble, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
|
||||||
//glUniform3f(glGetUniformLocation(programBubble, "cameraDir"), cameraDir.x, cameraDir.y, cameraDir.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);
|
Core::SetActiveTexture(bubbleTexture0, "iChannel0", programBubble, 1);
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, bubbleTexture0);
|
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::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::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::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::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::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::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);
|
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)));
|
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f)));
|
||||||
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 140 KiB |