konstantin magnus Posted May 9, 2021 Share Posted May 9, 2021 A minimalist one-parameter shader that smoothly runs from emissive (0.0), over translucent (0.75), to diffuse (1.0) and opaque (1.25) all the way to metallic (2.0). float shading = chf('shading'); vector color = chv('color'); vector pos_light = {2.6, 1.2, 0.6}; vector dir = normalize(pos_light - v@P); float lumen = max(1.0 - shading, 0.0); float angle = max(dot(dir, v@N), lumen); shading = fit(shading, 1, 2, 1, 20); float shade = pow(angle, max(shading, 1.0)); v@Cd = color * shade; shading.hipnc 1 Quote Link to comment Share on other sites More sharing options...
NoaX Posted May 10, 2021 Share Posted May 10, 2021 Very nice :)! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.