1 / 6

Local bounce in surface shader - ILM

Local bounce in surface shader - ILM. Technique for faking self re-emission of light on a surface Automatic: No additional lights No pre-pass needed Respect shadows and occlusions. Local bounce in surface shader - ILM. Psample = position of the bounce

demi
Download Presentation

Local bounce in surface shader - ILM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Local bounce in surface shader - ILM • Technique for faking self re-emission of light on a surface • Automatic: • No additional lights • No pre-pass needed • Respect shadows and occlusions

  2. Local bounce in surface shader - ILM • Psample = position of the bounce pointOnSurface -p -u $uPos -v $vPos $surfaceName • Nsample = normal at Psample pointOnSurface -n -u $uPos -v $vPos $surfaceName • Csample = average color around Psample

  3. Local bounce in surface shader - ILM • Kbounce = intensity of effect • Fbounce = falloff of effect

  4. Local bounce in surface shader - ILM • Do an illuminance loop on Psample • Apply resulting color as a Lambertian diffuse term with a smoothstep distance attenuation • Add value to global diffuse term at P: CKD

  5. Local bounce in surface shader - ILM if (Kbounce > 0.0) { Psample = transform (“world”, “current”, Psample); Nsample = ntransform (“world”, “current”, Nsample); vector Lsample = Psample - P; /* fake light direction */ float distsample = length(Lsample); color CKDsample = 0; if (distsample < Fbounce) {

  6. Local bounce in surface shader - ILM illuminance(Psample, Nsample, PI/2) { CKDsample += Cl * Nsample.normalize(L); } CKDsample *= Kd * Csample; /* resulting bounce */ if (distsample != 0.0) Lsample /= distsample; float NdotLsample = N.Lsample; if (NdotLsample > 0.0) { CKD += Kbounce * CKDsample * NdotLsample * (1.0 - smoothstep(0.0, Fbounce, distsample)); } }

More Related