Hi folks!
Today i’m figure out how to add the affect of the NormalMap to CookTorrance lightning tech.
my tech DiffCookTorrance.xml based on Diff.xml
<technique vs="LitSolidCookTorrance" ps="LitSolidCookTorrance" psdefines="DIFFMAP NORMALMAP COOKTORRANCE">
<pass name="base" />
<pass name="litbase" psdefines="AMBIENT" />
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="prepass" psdefines="PREPASS" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
</technique>
CT without normalmap I guess works fine,
[pastebin]DtpbyyXB[/pastebin]
But then i’m add normalmap most of the models are have strange behavior.
vec3 l = normalize ( cLightPosPS.xyz - vWorldPos.xyz);
vec3 n = normal;
float NoL = dot(n, l);
finalColor = (max(0.0, NoL) * ((diffCt.xyz + specCt.xyz))); - very bright in some angles view and color affecting on camera position
finalColor = (max(0.0, NoL) * ( diff * (diffCt.xyz + specCt.xyz))); - very dark in most angles view and color mostly constants and not affecting on scene lights
I’m don’t understand how to doing right affecting the normal mapping with CT tech.
Any ideas how to marge CT with normal mapping ?