You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
973 B
Plaintext
58 lines
973 B
Plaintext
13 years ago
|
#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
|