diff --git a/cw 9/shaders/shader_texture.frag b/cw 9/shaders/shader_texture.frag index a91aa4c..a6a9503 100644 --- a/cw 9/shaders/shader_texture.frag +++ b/cw 9/shaders/shader_texture.frag @@ -146,7 +146,8 @@ void main() ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir); - outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1); + //outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1); + outColor = vec4(vec3(1.0) - exp(-ilumination*exposition), texture2D(colorTexture, vecTex).a); //outColor = vec4(roughness,metallic,0,1); //outColor = vec4(test); } diff --git a/cw 9/src/ex_9_1.hpp b/cw 9/src/ex_9_1.hpp index 79750fe..222027c 100644 --- a/cw 9/src/ex_9_1.hpp +++ b/cw 9/src/ex_9_1.hpp @@ -492,11 +492,11 @@ void renderScene(GLFWwindow* window) drawObjectPBRWithTexture(models::floorContext, glm::mat4(), texture::floorTexture, 0.8f, 0.0f); drawObjectPBRWithTexture(models::glassWallContext, glm::mat4(), texture::glassWallTexture, 0.8f, 0.0f); drawObjectPBRWithTexture(models::roomContext, glm::mat4(), texture::roomTexture, 0.8f, 0.0f); - drawObjectPBRWithTexture(models::fishContext, glm::mat4(), texture::fishTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::landContext, glm::mat4(), texture::landTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::sofaBaseContext, glm::mat4(), texture::sofaBaseTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::sofaContext, glm::mat4(), texture::sofaTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::roofContext, glm::mat4(), texture::roofTexture, 0.5f, 0.0f); + drawObjectPBRWithTexture(models::fishContext, glm::mat4(), texture::fishTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::fish2Context, glm::mat4(), texture::fishTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::fish3Context, glm::mat4(), texture::fishTexture, 0.5f, 0.0f); drawObjectPBRWithTexture(models::door1Context, glm::mat4(), texture::door1Texture, 0.5f, 0.0f); @@ -546,6 +546,7 @@ void init(GLFWwindow* window) programTest = shaderLoader.CreateProgram("shaders/test.vert", "shaders/test.frag"); programSun = shaderLoader.CreateProgram("shaders/shader_8_sun.vert", "shaders/shader_8_sun.frag"); + //loading models loadModelToContext("./models/sphere.obj", sphereContext); loadModelToContext("./models/spaceship.obj", shipContext); @@ -575,8 +576,11 @@ void init(GLFWwindow* window) loadModelToContext("./models/door_next_to.obj", models::door_next_toContext); loadModelToContext("./models/door_next_to_doorhandle.obj", models::door_next_to_doorhandleContext); - //loading textures + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + //textures that contain transparency should be here + glDisable(GL_BLEND); programTex = shaderLoader.CreateProgram("shaders/shader_texture.vert", "shaders/shader_texture.frag"); texture::glassWallTexture = Core::LoadTexture("textures/glass.jpg"); texture::fishTexture = Core::LoadTexture("textures/fish.png"); diff --git a/cw 9/textures/glass.png b/cw 9/textures/glass.png new file mode 100644 index 0000000..8cb2bf1 Binary files /dev/null and b/cw 9/textures/glass.png differ diff --git a/cw 9/textures/skybox/back.png b/cw 9/textures/skybox/back.png deleted file mode 100644 index e7f4978..0000000 Binary files a/cw 9/textures/skybox/back.png and /dev/null differ diff --git a/cw 9/textures/skybox/bottom.png b/cw 9/textures/skybox/bottom.png deleted file mode 100644 index 514415b..0000000 Binary files a/cw 9/textures/skybox/bottom.png and /dev/null differ diff --git a/cw 9/textures/skybox/front.png b/cw 9/textures/skybox/front.png deleted file mode 100644 index 31b4daf..0000000 Binary files a/cw 9/textures/skybox/front.png and /dev/null differ diff --git a/cw 9/textures/skybox/left.png b/cw 9/textures/skybox/left.png deleted file mode 100644 index 4f60d04..0000000 Binary files a/cw 9/textures/skybox/left.png and /dev/null differ diff --git a/cw 9/textures/skybox/right.png b/cw 9/textures/skybox/right.png deleted file mode 100644 index 7ca9cae..0000000 Binary files a/cw 9/textures/skybox/right.png and /dev/null differ diff --git a/cw 9/textures/skybox/top.png b/cw 9/textures/skybox/top.png deleted file mode 100644 index 28d5204..0000000 Binary files a/cw 9/textures/skybox/top.png and /dev/null differ