Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome. Not for end-user support.
I know roughly what the issue is. The lasers have lighting applied, and the backfaces apply negative lighting. Basically the lighting is not clamped so goes negative. Other parts of the game rely on this behavior, just it looks wrong here.
The lighting clamp comes from jtag, so maybe our jtag needs some work at some point in the future.
Are you saying that the JTAG clamp isn't being set? We no longer have any patches applied to Daytona 2. It's possible our JTAG implementation is not seeing the write because of how we implement it as a giant unified register instead of properly daisy chaining the ASICs.
I am not sure, I haven't dug that deep into it
just mostly noting the bug is here so we can look at it in the future
But yeah I suspect maybe jtag isn't working quite right
It's not a JTAG issue as the game never performs JTAG writes during a race. More likely there must be some exception to sun clamping being disabled... the lasers are translucent so maybe sun clamping still occurs for translucent polygons?
in the quad and triangle fragment shaders makes the lasers look like they should, but I'm not yet sure that it wouldn't make something else in this game (or perhaps in L.A. Machineguns) look wrong.
It could well be as something as simple as that. Other possibility is some kind of bit in the polygon header but I think that is less likely since we never found any sun clamping bits before.
Maybe the translator map. I think it's just daytona that uses it, but I'm pretty sure it's just related to texturing.
If I remember correctly the 2 daytona versions use a different light clamp model. Power edition is unclamped. I'm pretty sure I did a binary diff between the wheel models on the cars between the 2 versions and found they were identical. That's when we started looking at jtag to find where it could be set.
But it's quite likely Matthew's suggestion is right. Worth just trying to see if it breaks anything:)
I wonder if it's worth whipping up some sort of regression test script that loads a bunch of states and snapshots the frame buffer. Not sure how to do a reliable quantitative comparison between the two that isn't overly sensitive to small differences (including differences between GPUs). I think the game industry does this and there must be some papers on the subject.
If it is just transparency that uses the clamped model it would just be polygon transparency. Poly transparency has 1 extra bit so instead of 0-31 (5 bits) it uses 6 bits where the top bit is basically an enable bit. The range in this case is just 0-32.
I think there is a good chance these might use the clamped model. Failing that always worth checking the viewport data to see if there are any difference between the viewport with the lasers and that of the cars which we know use an unclamped model.