mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-03 08:07:45 +00:00
Remove front-facing check for specular lights
This is basically a copy of the diffusefunc; it doesn't make sense for it to be implemented in both places (though I haven't confirmed that it isn't)
This commit is contained in:
parent
8a53fe4f46
commit
137b81338f
1 changed files with 5 additions and 8 deletions
|
@ -41,15 +41,12 @@ static void GenerateLightShader(ShaderCode& object, const LightingUidData& uid_d
|
||||||
break;
|
break;
|
||||||
case AttenuationFunc::Spec:
|
case AttenuationFunc::Spec:
|
||||||
object.Write(" float cosine = 0.0;\n"
|
object.Write(" float cosine = 0.0;\n"
|
||||||
" // Ensure that the object is facing the light\n"
|
" // Compute the cosine of the angle between the object normal\n"
|
||||||
" if (dot(_normal, ldir) >= 0.0) {{\n"
|
" // and the half-angle direction for the viewer\n"
|
||||||
" // Compute the cosine of the angle between the object normal\n"
|
" // (assuming the half-angle direction is a unit vector)\n"
|
||||||
" // and the half-angle direction for the viewer\n"
|
" cosine = max(0.0, dot(_normal, " LIGHT_DIR ".xyz));\n",
|
||||||
" // (assuming the half-angle direction is a unit vector)\n"
|
|
||||||
" cosine = max(0.0, dot(_normal, " LIGHT_DIR ".xyz));\n",
|
|
||||||
LIGHT_DIR_PARAMS(index));
|
LIGHT_DIR_PARAMS(index));
|
||||||
object.Write(" }}\n"
|
object.Write(" // Specular lights use the angle for the denominator as well\n"
|
||||||
" // Specular lights use the angle for the denominator as well\n"
|
|
||||||
" dist = cosine;\n"
|
" dist = cosine;\n"
|
||||||
" dist2 = dist * dist;\n");
|
" dist2 = dist * dist;\n");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue