[Bug 41827] Wrong specular rendering with some applications

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Nov 26 10:36:00 CST 2016


https://bugs.winehq.org/show_bug.cgi?id=41827

--- Comment #1 from Axel D <davyaxel at free.fr> ---
A bit more information found with the test app:

. localviewer does make a difference when specular is not saturated. However
when specular is saturated, the zone of the sphere lit should be exactly the
same than the zone lit when diffuse is saturated. On wine it is a different
zone.

The behaviour is the same for POINT and DIRECTIONNAL (didn't tested SPOT)

Here is the wine related wine code:
shader_addline(buffer, "diffuse += clamp(dot(dir, normal), 0.0, 1.0)"
                        " * ffp_light[%u].diffuse.xyz;\n", i);
                /* TODO: In the non-local viewer case the halfvector is
constant
                 * and could be precomputed and stored in a uniform. */
                if (settings->localviewer)
                    shader_addline(buffer, "t = dot(normal, normalize(dir -
normalize(ec_pos.xyz)));\n");
                else
                    shader_addline(buffer, "t = dot(normal, normalize(dir +
vec3(0.0, 0.0, -1.0)));\n");
                shader_addline(buffer, "if (t > 0.0) specular += pow(t,
ffp_material.shininess)"
                        " * ffp_light[%u].specular;\n", i);

. The fact that when specular is not saturated, wine has the correct behaviour
seems to show that the formulat for t is ok.
. The fact that when saturated it should be same than diffuse saturated shows
that the test "if (t > 0.0)" should be replaced by "if (dot(dir, normal) >
0.0)"

Then I guess pow(t, ffp_material.shininess) should be replaced by pow(abs(t),
ffp_material.shininess), but that is just a guess.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list