mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:29:55 +00:00
dd5901d351
Multiview shaders. Refactor Frustum management Rewrite shared shadow map cull mask should respect stereo Stereo savegame screencap LocalMap refactoring use the vertex buffer hint instead of the display list patch to enable/disable display lists Character preview fixes
27 lines
910 B
GLSL
27 lines
910 B
GLSL
#version @GLSLVersion
|
|
|
|
varying vec2 diffuseMapUV;
|
|
|
|
varying float alphaPassthrough;
|
|
|
|
uniform int colorMode;
|
|
uniform bool useDiffuseMapForShadowAlpha = true;
|
|
uniform bool alphaTestShadows = true;
|
|
|
|
void main(void)
|
|
{
|
|
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
|
|
|
vec4 viewPos = (gl_ModelViewMatrix * gl_Vertex);
|
|
gl_ClipVertex = viewPos;
|
|
|
|
if (useDiffuseMapForShadowAlpha)
|
|
diffuseMapUV = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
|
|
else
|
|
diffuseMapUV = vec2(0.0); // Avoid undefined behaviour if running on hardware predating the concept of dynamically uniform expressions
|
|
if (colorMode == 2)
|
|
alphaPassthrough = gl_Color.a;
|
|
else
|
|
// This is uniform, so if it's too low, we might be able to put the position/clip vertex outside the view frustum and skip the fragment shader and rasteriser
|
|
alphaPassthrough = gl_FrontMaterial.diffuse.a;
|
|
}
|