diff options
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.); } |
