Temp
This commit is contained in:
2
project/resources/ShadingDemo.mtl
Normal file
2
project/resources/ShadingDemo.mtl
Normal file
@@ -0,0 +1,2 @@
|
||||
# Blender 4.3.2 MTL File: 'None'
|
||||
# www.blender.org
|
||||
4158
project/resources/ShadingDemo.obj
Normal file
4158
project/resources/ShadingDemo.obj
Normal file
File diff suppressed because it is too large
Load Diff
40
project/resources/shadowEffect.fx
Normal file
40
project/resources/shadowEffect.fx
Normal file
@@ -0,0 +1,40 @@
|
||||
float4x4 gLightWorldViewProj : WorldViewProjection;
|
||||
|
||||
float4x4 gWorldViewProj: WorldViewProjection; //For compatibility sake
|
||||
|
||||
Texture2D gShadowMap : register(t0); // Shadow map texture
|
||||
SamplerState gShadowMapSampler : register(s0); // Shadow map sampler
|
||||
|
||||
struct VS_Input
|
||||
{
|
||||
float3 Position : POSITION;
|
||||
};
|
||||
|
||||
struct VS_Output
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
};
|
||||
|
||||
VS_Output VS_Shadow(VS_Input input)
|
||||
{
|
||||
VS_Output output;
|
||||
// Transform vertex position to light's clip space
|
||||
output.Position = mul(float4(input.Position, 1.0f), gLightWorldViewProj);
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 PS_Shadow(VS_Output input) : SV_TARGET
|
||||
{
|
||||
// Output depth information (Z/W in clip space)
|
||||
return float4(input.Position.z / input.Position.w, 0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
// Technique for rendering shadow map
|
||||
technique11 DefaultTechnique
|
||||
{
|
||||
pass P0
|
||||
{
|
||||
SetVertexShader(CompileShader(vs_5_0, VS_Shadow()));
|
||||
SetPixelShader(CompileShader(ps_5_0, PS_Shadow()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user