File: SMShadow.fx

package info (click to toggle)
libwildmagic 5.17%2Bcleaned1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 90,112 kB
  • sloc: cpp: 215,940; csh: 637; sh: 91; makefile: 39
file content (25 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
void v_SMShadow
(
    in float3 modelPosition : POSITION,
    out float4 lightSpacePosition : POSITION,
    out float depth : TEXCOORD0,
    uniform float4x4 WMatrix,
    uniform float4x4 LightPVMatrix
)
{
    // Transform the position from model space to light space.
    float4 worldPosition = mul(WMatrix, float4(modelPosition, 1.0f));
    lightSpacePosition = mul(LightPVMatrix, worldPosition);

    // Output the distance from the light source to the vertex.
    depth = lightSpacePosition.z;
}

void p_SMShadow
(
    in float depth : TEXCOORD0,
    out float4 pixelColor : COLOR0
)
{
    pixelColor = depth;
}