change shaders back

This commit is contained in:
Thyme1 2022-01-23 21:38:42 +01:00
parent 0058724ddd
commit 246011dfd8
2 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@ in vec3 surfaceNormal;
in vec3 toLightVector;
in vec3 toCameraVector;
//out vec4 out_Color;
out vec4 out_Color;
uniform sampler2D modelTexture;
@ -31,6 +31,6 @@ void main(void){
vec3 finalSpecular = dampedFactor * reflectivity * vec3(1.0, 1.0, 1.0); //Tu by³a zmiana
gl_FragColor = vec4(1.0,1.0,1.0,1.0);
out_Color = vec4(diffuse,1.0) * texture(modelTexture,pass_textureCoordinates) + vec4(finalSpecular,1.0);
}

View File

@ -371,9 +371,10 @@ void renderScene()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glUseProgram(terrainProgram);
glm::mat4 terrainTransformation = glm::translate(glm::vec3(terrain.getX(), 0, terrain.getZ())) * glm::rotate(glm::radians(0.f), glm::vec3(5, 5, 5));
glm::mat4 terrainTransformation = glm::translate(glm::vec3(0, 0, 0)) * glm::rotate(glm::radians(180.f), glm::vec3(5, 5, 5));
TerrainRenderer terrainRenderer(terrainProgram, perspectiveMatrix, terrain, terrainTransformation, cameraMatrix, lightDir, 0.5f, 0.5f);
terrainRenderer.render();
glUseProgram(0);