aboutsummaryrefslogtreecommitdiff
path: root/src/shaders/shader.slang
diff options
context:
space:
mode:
authorvimene <vincent.menegaux@gmail.com>2025-12-31 18:34:54 +0100
committervimene <vincent.menegaux@gmail.com>2025-12-31 18:34:54 +0100
commitf9c6bd77af826423fba4aeec86b227ccd7102b4e (patch)
treeea54539034d4494df761d8fea3901acbf5803588 /src/shaders/shader.slang
parent8ab4780f134c33a9e11ac0fe0bd866e17d3ee650 (diff)
downloadengine-f9c6bd77af826423fba4aeec86b227ccd7102b4e.tar.gz
added back the software renderervulkan
Diffstat (limited to 'src/shaders/shader.slang')
-rw-r--r--src/shaders/shader.slang7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shaders/shader.slang b/src/shaders/shader.slang
index 5598e1e..e92f5aa 100644
--- a/src/shaders/shader.slang
+++ b/src/shaders/shader.slang
@@ -20,8 +20,9 @@ struct VertexOutput {
[shader("vertex")]
VertexOutput vert_main(VertexInput vi) {
VertexOutput vo;
- vo.pos = mul(ubo.proj, mul(ubo.view, mul(ubo.model, float4(vi.pos, 1.))));
- vo.world_loc = vi.pos;
+ float4 world_loc = mul(ubo.model, float4(vi.pos, 1.));
+ vo.pos = mul(ubo.proj, mul(ubo.view, world_loc));
+ vo.world_loc = world_loc.xyz;
vo.normal = vi.normal;
return vo;
}
@@ -39,7 +40,7 @@ float4 frag_main(VertexOutput vo) : SV_Target {
else attenuation = (attenuation - .7) / .1;
float light = -dot(vo.normal, u) / u_len_sq;
if (light < 0.) light = 0.;
- float final_light = .05 + light * attenuation * .8 * .95;
+ float final_light = .003 + light * attenuation * .8 * .997;
if (final_light > 1.) final_light = 1.;
return float4(final_light, final_light, final_light, 1.);
}