Ajoute la possibilité de rendre une shadow map pour les objets de la scène. Supprime la dépendance de la texture du depth shader et ajoute une option pour caster les ombres sur les RenderComponents. Modifie la taille de la fenêtre dans l'imgui.ini
42 lines
984 B
GLSL
42 lines
984 B
GLSL
/////////////
|
|
// GLOBALS //
|
|
/////////////
|
|
cbuffer MatrixBuffer
|
|
{
|
|
matrix worldMatrix;
|
|
matrix viewMatrix;
|
|
matrix projectionMatrix;
|
|
};
|
|
|
|
//////////////
|
|
// TYPEDEFS //
|
|
//////////////
|
|
struct VertexInputType
|
|
{
|
|
float4 position : POSITION;
|
|
};
|
|
|
|
struct PixelInputType
|
|
{
|
|
float4 position : SV_POSITION;
|
|
};
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// Vertex Shader
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
PixelInputType DepthVertexShader(VertexInputType input)
|
|
{
|
|
PixelInputType output;
|
|
|
|
|
|
// Change the position vector to be 4 units for proper matrix calculations.
|
|
input.position.w = 1.0f;
|
|
|
|
// Calculate the position of the vertex against the world, view, and projection matrices.
|
|
output.position = mul(input.position, worldMatrix);
|
|
output.position = mul(output.position, viewMatrix);
|
|
output.position = mul(output.position, projectionMatrix);
|
|
|
|
return output;
|
|
} |