1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-27 09:40:26 +00:00
openmw/files/shaders/nv_nolighting_fragment.glsl
madsbuvi dd5901d351 Initial commit
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
2022-04-28 21:05:34 +02:00

53 lines
1.1 KiB
GLSL

#version @GLSLVersion
#pragma import_defines(FORCE_OPAQUE)
#if @useGPUShader4
#extension GL_EXT_gpu_shader4: require
#endif
#if @diffuseMap
uniform sampler2D diffuseMap;
varying vec2 diffuseMapUV;
#endif
#if @radialFog
varying float euclideanDepth;
#else
varying float linearDepth;
#endif
uniform bool useFalloff;
varying float passFalloff;
#include "vertexcolors.glsl"
#include "alpha.glsl"
void main()
{
#if @diffuseMap
gl_FragData[0] = texture2D(diffuseMap, diffuseMapUV);
gl_FragData[0].a *= coveragePreservingAlphaScale(diffuseMap, diffuseMapUV);
#else
gl_FragData[0] = vec4(1.0);
#endif
gl_FragData[0] *= getDiffuseColor();
if (useFalloff)
gl_FragData[0].a *= passFalloff;
alphaTest();
#if @radialFog
float fogValue = clamp((euclideanDepth - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0);
#else
float fogValue = clamp((linearDepth - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0);
#endif
#if defined(FORCE_OPAQUE) && FORCE_OPAQUE
gl_FragData[0].a = 1.0;
#endif
gl_FragData[0].xyz = mix(gl_FragData[0].xyz, gl_Fog.color.xyz, fogValue);
}