File: SMShadow.fx

package info (click to toggle)
libwildmagic 5.13-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 89,572 kB
  • ctags: 26,264
  • sloc: cpp: 210,924; csh: 637; sh: 95; makefile: 36
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;
}