mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 08:15:35 +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
31 lines
785 B
GLSL
31 lines
785 B
GLSL
#version @GLSLVersion
|
|
|
|
#if @useGPUShader4
|
|
#extension GL_EXT_gpu_shader4: require
|
|
#endif
|
|
|
|
uniform sampler2D diffuseMap;
|
|
varying vec2 diffuseMapUV;
|
|
|
|
varying float alphaPassthrough;
|
|
|
|
uniform bool useDiffuseMapForShadowAlpha;
|
|
uniform bool alphaTestShadows;
|
|
|
|
#include "alpha.glsl"
|
|
|
|
void main()
|
|
{
|
|
gl_FragData[0].rgb = vec3(1.0);
|
|
if (useDiffuseMapForShadowAlpha)
|
|
gl_FragData[0].a = texture2D(diffuseMap, diffuseMapUV).a * alphaPassthrough;
|
|
else
|
|
gl_FragData[0].a = alphaPassthrough;
|
|
|
|
alphaTest();
|
|
|
|
// Prevent translucent things casting shadow (including the player using an invisibility effect).
|
|
// This replaces alpha blending, which obviously doesn't work with depth buffers
|
|
if (alphaTestShadows && gl_FragData[0].a <= 0.5)
|
|
discard;
|
|
}
|