Advertisement
Guest User

Untitled

a guest
May 30th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. float4x4 xLightsWorldViewProjection;
  2.  
  3. struct SMapPixelToFrame
  4. {
  5. float4 Color : SV_TARGET;
  6. };
  7.  
  8. struct SMapVertexToPixel
  9. {
  10. float4 Position : SV_POSITION;
  11. float depth : DEPTH;
  12. };
  13.  
  14. SMapVertexToPixel ShadowMapVertexShader( float4 inPos : POSITION)
  15. {
  16. SMapVertexToPixel Output = (SMapVertexToPixel)0;
  17.  
  18. Output.Position = mul(inPos, xLightsWorldViewProjection);
  19. Output.depth = float4(Output.Position.z/Output.Position.w, 0, 0, 0);
  20. return Output;
  21. }
  22.  
  23. SMapPixelToFrame ShadowMapPixelShader(SMapVertexToPixel input)
  24. {
  25. SMapPixelToFrame Output = (SMapPixelToFrame)0;
  26.  
  27. Output.Color = input.depth;
  28.  
  29. return Output;
  30. }
  31.  
  32. technique ShadowMap
  33. {
  34. pass Pass0
  35. {
  36. VertexShader = compile vs_5_0 ShadowMapVertexShader();
  37. PixelShader = compile ps_5_0 ShadowMapPixelShader();
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement