* render Q3 shader based skyboxes

logic: load 6 skybox textures when shader gets used by scene, don't unload dynamically, just on 'flush'
texture browser only uses normal preview image and doesn't trigger potentially heavy box loading
also fix R_ResampleTexture for [2+x upscaling
This commit is contained in:
Garux
2022-07-18 10:05:19 +03:00
parent 22377bb255
commit d3e48d8c31
11 changed files with 219 additions and 21 deletions

View File

@@ -0,0 +1,8 @@
uniform samplerCube skybox;
void main()
{
//doing rotation/flip to fix skybox orientation
gl_FragColor = textureCube( skybox, vec3( -gl_TexCoord[0].y, gl_TexCoord[0].z, gl_TexCoord[0].x ) );
}

View File

@@ -0,0 +1,8 @@
uniform vec3 u_view_origin;
void main()
{
gl_TexCoord[0] = vec4( ( gl_Vertex.xyz - u_view_origin ), 1 );
gl_Position = ftransform();
}