Cel shade c'est mieux mais ALED

This commit is contained in:
2024-09-26 11:30:26 +02:00
parent 71403c614d
commit 30b41922d9
7 changed files with 51 additions and 35 deletions

View File

@@ -28,15 +28,15 @@ PixelInputType CelShadingVertexShader(VertexInputType input)
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);
float4 worldPosition = mul(input.position, worldMatrix);
output.position = mul(worldPosition, viewMatrix);
output.position = mul(output.position, projectionMatrix);
// Pass the normal to the pixel shader
output.normal = mul(input.normal, (float3x3)worldMatrix);
output.normal = mul((float3x3)worldMatrix, input.normal);
// Pass the world position to the pixel shader
output.worldPos = mul(input.position, worldMatrix).xyz;
output.worldPos = worldPosition.xyz;
// Store the texture coordinates for the pixel shader.
output.tex = input.tex;