Skip to content

Commit

Permalink
#5893: Comparing to the TDM engine, the skybox appears to be rotated …
Browse files Browse the repository at this point in the history
…- compensate that in the shader
  • Loading branch information
codereader committed Feb 20, 2022
1 parent d3c1f1d commit 27c5d59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions install/gl/cubemap_vp.glsl
Expand Up @@ -7,10 +7,13 @@ varying vec3 var_cubeMapTexCoord;

void main()
{
var_cubeMapTexCoord = gl_Vertex.xyz - u_view_origin;
vec3 texcoord = gl_Vertex.xyz - u_view_origin;

// Rotate the skybox 90 degrees about the z axis to match what the TDM engine is displaying
var_cubeMapTexCoord = vec3(-texcoord.y, texcoord.x, texcoord.z);

// transform vertex position into homogenous clip-space
gl_Position = ftransform();
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

// Pass through vertex colour
gl_FrontColor = gl_Color;
Expand Down

0 comments on commit 27c5d59

Please sign in to comment.