14.12.2012 Views

Direct3D HLSL Programming using RenderMonkey IDE

Direct3D HLSL Programming using RenderMonkey IDE

Direct3D HLSL Programming using RenderMonkey IDE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Diffuse Illumination For<br />

Translucency<br />

float3 scatteredIllumination = saturate(dot(-vNormal, Light)) *<br />

fTranslucency * translucencyCoeff;<br />

float3 diffuseContribution = saturate(dot(vNormal,Light)) +<br />

ambient;<br />

baseColor *= scatteredIllumination + diffuseContribution;<br />

Combine diffuse and scattered light with base texture<br />

Light scattered on the butterfly wings is<br />

Compute computed diffusely based reflected on the negative light <strong>using</strong> normal<br />

the (for bump-mapped scattering off normal the surface), and ambient light vector<br />

and translucency contribution coefficient and value for<br />

the given pixel. ) =<br />

*( +<br />

Game Developer Conference, San Jose, CA, March 7 th 2003

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!