mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
28 lines
618 B
GLSL
28 lines
618 B
GLSL
#include "core.h"
|
|
|
|
#ifdef SH_VERTEX_SHADER
|
|
|
|
SH_BEGIN_PROGRAM
|
|
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
|
|
|
|
shOutput(float, alphaFade)
|
|
|
|
SH_START_PROGRAM
|
|
{
|
|
shOutputPosition = shMatrixMult(wvp, shInputPosition);
|
|
alphaFade = shInputPosition.z < 150.0 ? 0.0 : 1.0;
|
|
}
|
|
|
|
#else
|
|
|
|
SH_BEGIN_PROGRAM
|
|
shInput(float, alphaFade)
|
|
shUniform(float4, atmosphereColour) @shSharedParameter(atmosphereColour)
|
|
|
|
SH_START_PROGRAM
|
|
{
|
|
shOutputColour(0) = atmosphereColour * float4(1,1,1,alphaFade);
|
|
}
|
|
|
|
#endif
|