Yeah it's basically the same thing, but for diffuse light & using a tex1D // fResult is a saturated dot(N, L); // Don't forget half lambert, if needed! saturate(NDotL * 0.5 + 0.5); if ( bDoLightingWarp ){ fResult = 2.0f * tex1D( lightWarpSampler, fResult );} *edit* a buddy if mine has a cool implementation of this, has a…
Oh, another thing if you're doing it half-lambert, it needs to be squared. here's how the code should be all-togetherfloat3 DiffuseTerm( float3 worldNormal, float3 lightDir){ float fResult; float NDotL = dot( worldNormal, lightDir ); // Unsaturated dot (-1 to 1 range) if ( bHalfLambert ) { fResult = saturate(NDotL * 0.5 +…