1
0
Fork 0
fgdata/Shaders/HDR/skydome.vert

19 lines
452 B
GLSL
Raw Normal View History

2021-04-10 09:14:16 +00:00
#version 330 core
layout(location = 0) in vec4 pos;
out vec3 rayDirVertex;
uniform mat4 osg_ModelViewMatrix;
uniform mat4 osg_ModelViewProjectionMatrix;
uniform mat4 osg_ViewMatrix;
void main()
{
gl_Position = osg_ModelViewProjectionMatrix * pos;
vec4 rayDirView = normalize(osg_ModelViewMatrix * pos);
rayDirView.w = 0.0;
rayDirVertex = vec4(inverse(osg_ViewMatrix) * rayDirView).xyz;
rayDirVertex = normalize(rayDirVertex);
}