Added fog

This commit is contained in:
saschawillems 2016-06-25 20:40:22 +02:00
parent 8ff0ad57ba
commit cc5ade69f1
4 changed files with 19 additions and 1 deletions

View file

@ -26,6 +26,8 @@ layout (location = 0) out vec3 outNormal;
layout (location = 1) out vec2 outUV;
layout (location = 2) out vec3 outViewVec;
layout (location = 3) out vec3 outLightVec;
layout (location = 4) out vec3 outEyePos;
layout (location = 5) out vec3 outWorldPos;
void main()
{
@ -50,4 +52,6 @@ void main()
// Calculate vectors for lighting based on tessellated position
outViewVec = -pos.xyz;
outLightVec = normalize(ubo.lightPos.xyz + outViewVec);
outWorldPos = pos.xyz;
outEyePos = vec3(ubo.modelview * pos);
}