1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/files/materials/sun.shader

40 lines
916 B
Plaintext
Raw Normal View History

2012-07-06 10:31:48 +02:00
#include "core.h"
2012-07-11 09:08:55 +02:00
#define MRT @shGlobalSettingBool(mrt_output)
2012-07-06 10:31:48 +02:00
#ifdef SH_VERTEX_SHADER
SH_BEGIN_PROGRAM
2012-07-11 09:08:55 +02:00
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
2012-07-23 02:54:50 +02:00
shVertexInput(float2, uv0)
2012-07-06 10:31:48 +02:00
shOutput(float2, UV)
SH_START_PROGRAM
{
shOutputPosition = shMatrixMult(wvp, shInputPosition);
UV = uv0;
}
#else
SH_BEGIN_PROGRAM
shSampler2D(diffuseMap)
shInput(float2, UV)
#if MRT
shDeclareMrtOutput(1)
#endif
2012-07-11 09:08:55 +02:00
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
2012-07-13 09:13:12 +02:00
//shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
2012-07-06 10:31:48 +02:00
SH_START_PROGRAM
{
2012-07-13 09:13:12 +02:00
shOutputColour(0) = float4(1,1,1,materialDiffuse.a) * shSample(diffuseMap, UV);
2012-07-06 10:31:48 +02:00
#if MRT
2012-07-11 02:31:03 +02:00
shOutputColour(1) = float4(1,1,1,1);
2012-07-06 10:31:48 +02:00
#endif
}
#endif