1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/files/materials/atmosphere.shader

40 lines
822 B
GLSL

#include "core.h"
#define MRT @shGlobalSettingBool(mrt_output)
#ifdef SH_VERTEX_SHADER
SH_BEGIN_PROGRAM
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
shColourInput(float4)
shOutput(float4, colourPassthrough)
SH_START_PROGRAM
{
shOutputPosition = shMatrixMult(wvp, shInputPosition);
colourPassthrough = colour;
}
#else
SH_BEGIN_PROGRAM
shInput(float4, colourPassthrough)
#if MRT
shDeclareMrtOutput(1)
#endif
shUniform(float4, atmosphereColour) @shSharedParameter(atmosphereColour)
SH_START_PROGRAM
{
shOutputColour(0) = colourPassthrough * atmosphereColour;
shOutputColour(0) = float3(0,0,0,1);
#if MRT
shOutputColour(1) = float4(1,1,1,1);
#endif
}
#endif