Closed dbz400 closed 11 years ago
Sora no Kiseki FC/Trails in the Sky (missing menu buttons, missing characters ingame with SW)
Thanks but HW okay , right ?
Yeah, HW is good. Characters are there and the menu button is visible.
Thanks .Will check this out
I narrow down to this code to fix it
Original : Color4 diff = (lightDiff * diffuse) * (dot \ lightScale);
Fix : Color4 diff = (lightDiff * diffuse) * (max(dot, 0.0f) \ lightScale);
I found out the cause of flashing at title screen in HW in Saint Omega as well . It caused by the u_ambient in the following statement , the same one :( , however , we cannot it remove it otherwise break other games
WRITE(p, " v_color0 = clamp(lightSum0 + u_ambient * %s + vec4(u_matemissive, 0.0), 0.0, 1.0);\n", ambient);
If it works in SW, try:
const char *ambient = (gstate.materialupdate & 1) ? (hasColor ? "a_color0" : "u_matambientalpha") : "vec4(u_matambientalpha.rgb, 1.0)";
This should replicate the (seemingly not totally correct) behavior of SW for that part.
-[Unknown]
Just tried .no luck . Interesting the title flashing exactly gone when u_ambient removed ......
Once fixed that one , only left the Dissidia Final Fantasy . I think SW and HW should be almost the same now at this stage
Hmm. So it's u_ambient? Interesting.
The SW does (boiled down):
Color4 lightSum0 = globalAmbient (u_ambient) * *ambient (%s) + materialEmissive (vec4(u_matemissive, 0.0));
foreach (light)
lightSum0 += lightAmbient (vec4(u_lightambient%i, 1.0)) * *ambient (%s) + diff (diffuse%i);
colorOut0 = lightSum0 > 1.0f ? Color4(1.0f) : lightSum0;
Or in other words:
vec4 lightSum0 = u_ambient * %s + vec4(u_matemissive, 0.0);
foreach (light)
lightSum0 += vec4(u_lightambient%i, 1.0) * %s + diffuse%i;
colorOut0 = lightSum0 > 1.0f ? vec4(1.0f) : lightSum0;
The shader uses slightly different logic:
vec4 lightSum0 = vec4(0.0);
foreach (light)
lightSum0 += vec4(u_lightambient%i + diffuse%i, 0.0);
v_color0 = clamp(lightSum0 + u_ambient * %s + vec4(u_matemissive, 0.0), 0.0, 1.0);
Which could be rewritten as (for comparison):
vec4 lightSum0 = u_ambient * %s + vec4(u_matemissive, 0.0);
foreach (light)
lightSum0 += vec4(u_lightambient%i + diffuse%i, 0.0);
v_color0 = clamp(lightSum0, 0.0, 1.0);
Without looking at it too hard right now (and without being very good at GLSL at all), there appear to be a few possible differences:
clamp()
will never produce NaN?)%s.a
which is either u_matambientalpha.a, a_color0.a, or 1.0), but HW ignores the alpha per light (just adding it once.)Edit: but note that HW is definitely more correct for some games I think?
-[Unknown]
so far i seen only Dissidia Final Fantasy renders more correct in HW than in SW mode . SW mode renders too bright , not too sure it is related to your point 2 or 3
Hard to tell. I think Blade Dancer (last I checked it) looks much better than HW than SW.
-[Unknown]
I see. let me include Blade Dancer in the list above as well .Btw, what are the difference ?
I think that alpha should not be included in the per-light stuff, and we should change the sw code accordingly (basically, use a Color3 instead of Color4 in most of the calculations).
Here's a screenshot, as you can see HW is much better:
And here's a screenshot showing what it should look like (mostly the compass): http://www.pixlbit.com/media/725/2352.jpg
-[Unknown]
humm really big difference among them .
The flashing in Saint Seiya looks a bit like a CPU bug to me tbh, it looks like the initial fade in is intended but then it doesn't quite stop. So it's possible that it's correct to take that alpha into account.
i see. then may be we can ignore it at this moment since i see the flashing only in HW but SW is prefectly fine .
One more discrepancy found ...... this one is easy to adjust :)
SW
if (dot >= 0)
{
Color4 lightSpec(gstate_c.lightColor[2][l], 0.0f);
lightSum1 += (lightSpec * *specular * (powf(dot, specCoef_)*lightScale));
}
HW
WRITE(p, " if (dot%i > 0.0)\n", i);
WRITE(p, " lightSum1 += u_lightspecular%i * %s * (pow(dot%i, u_matspecular.a) * (dot%i * lightScale%i));\n", i, specular, i, i, i);
FIX
if (dot > 0.0f)
{
Color4 lightSpec(gstate_c.lightColor[2][l], 0.0f);
lightSum1 += lightSpec * *specular * (powf(dot, specCoef_) * (dot * lightScale));
}
@hrydgard .thanks for fixing it in 8749ad0 .Just wonder do we still need (dot * lightScale) in SW just like HW one ?
I don't know which is right, I suspect SW is right there actually but not sure.
I see. let me test it out if dot removed in HW will break any games ....
@hrydgard ,if SW rendering too bright in all games , what likely issue you can think of ? i want to narrow down the scope of debug
Saint Seiya Omega flashing at title screen in HW mode fixed in commit 0982a2929 .It explained why previously remove the u_ambient get rid of the flashing .... cheers
Added one more in the list
Kidou Senshi Gundam AGE Universe Accel ( missing background in SW ) - Partially Fixed
Digimon World Re Digitize title screen looks really nice now in HW mode:+1:
FATE EXTRA HW ON
HW OFF
thanks .i think the background of HW mode is wrong and should be the one from SW . (mixed ? )
If possible , can you run it in jpcsp to see how it looks like ?
SW mode always too bright .......:(
jpcsp looks like SW
Thanks . I will take a look
@daniel229 , i own this game . do you mind giving the save that can goto this point ?
sure,load this save,then press circle, will reach that point soon.
here is the savefile. http://www.mediafire.com/?b7qdraky3da6sb4
Obscure: The aftermath
Hw on:
Hw off:
Carter07 and Daniel , do u mind testing it in git 408 or earlier version ? to see if same issue occurs . I suspect 409 may cause lighting issue in SW mode though help displaying thing in other games
Tested git 408, SW mode still too bright.HW mode even worse.
git 408 HW on
HW worse I think it is because missing dirty_ambient which has been fixed later . Looks like 409 is not likely causing the bright issue in SW hum
The issue with sw transform in obscure is old, in fact also 0.5 release has the same problem.
i see . thanks both of you .
are they look better in SW mode by fix 0eabc80c3efc7 ?
Fate Extra still the same,too bright.
i see. Looks like HW mode is much better than SW in most of the games (see the issue list above)
Obscure in sw mode is fixed in build 504. However when the character is under light he becames blonde with sw transform :)
Nice . At least it fixes the too bright issue in this game :)
@daniel229 , just wonder fate extra works better now in latest build ?
No improvement.
I see .
Ys: The Oath in Felghana: Grid of shadows and characters in HW and correct shadows and no characters in SW
Thanks for report . Will take a look .
Fairy Tail: Zeref Awakens HW on
HW off
interesting in HW mode :)
I tested Megaman X Maverick Hunter right now on Xperia Play, and there are discrepancies in HW mode like in Fairy Tail: Zeref Awakens.
The Megaman model is shifted to the right side
If you seen any games that discrepancy between HW and SW T&L , feel free to put here to see if we can fix it .
Dissidia Final Fantasy (too bright and incorrect texture in SW ) Trails in the Sky ( missing menu buttons, missing characters ingame with SW) Blade Dancer (missing background in SW) Kidou Senshi Gundam AGE Universe Accel ( missing background in SW ) Digimon World Re Digitize (incorrect background in SW ) Fate Extra (too bright in SW) Obscure : The Aftermath ( too bright in SW ) Ys: The Oath in Felghana ( missing character in SW)