diff options
| author | vimene <vincent.menegaux@gmail.com> | 2025-12-31 18:34:54 +0100 |
|---|---|---|
| committer | vimene <vincent.menegaux@gmail.com> | 2025-12-31 18:34:54 +0100 |
| commit | f9c6bd77af826423fba4aeec86b227ccd7102b4e (patch) | |
| tree | ea54539034d4494df761d8fea3901acbf5803588 /src/shaders/shader.slang | |
| parent | 8ab4780f134c33a9e11ac0fe0bd866e17d3ee650 (diff) | |
| download | engine-vulkan.tar.gz | |
added back the software renderervulkan
Diffstat (limited to 'src/shaders/shader.slang')
| -rw-r--r-- | src/shaders/shader.slang | 7 |
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.); } |
