1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/files/materials/terrain.shader
2012-07-13 06:16:55 +02:00

58 lines
973 B
Plaintext

#include "core.h"
#define FOG @shPropertyBool(fog)
#define MRT @shGlobalSettingBool(mrt_output)
@shAllocatePassthrough(1, depth)
#ifdef SH_VERTEX_SHADER
SH_BEGIN_PROGRAM
shUniform(float4x4, worldMatrix) @shAutoConstant(worldMatrix, world_matrix)
shUniform(float4x4, viewProjMatrix) @shAutoConstant(viewProjMatrix, viewproj_matrix)
shInput(float2, uv0)
@shPassthroughVertexOutputs
SH_START_PROGRAM
{
float4 worldPos = shMatrixMult(worldMatrix, shInputPosition);
shOutputPosition = shMatrixMult(viewProjMatrix, worldPos);
@shPassthroughAssign(depth, shOutputPosition.z);
}
#else
SH_BEGIN_PROGRAM
@shPassthroughFragmentInputs
#if MRT
shDeclareMrtOutput(1)
#endif
SH_START_PROGRAM
{
float depth = @shPassthroughReceive(depth);
#if MRT
//shOutputColour(1) = float4(1,1,1,1);
#endif
}
#endif