scud fixed shading

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

scud fixed shading

Postby Ian » Mon Nov 07, 2016 10:57 am

One for bart :)
People have probably noticed the shading in parts of the game are 'broken' or not as bright as the original.
Well as far as I can tell these are all related to our incomplete understanding of how fixed shading works.

In scud all the parts that are too dark are marked as fixed shading, with lighting disabled

Image

If you see the comparison to the original you can see the side of the building is really light (as if lit by specular) ie something like 120% brightness. The same with the water and the sky.

Image

I think in this mode perhaps the fixed shading vertex intensities are actually an offset value added to the colour register. Not sure how else it could work.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: scud fixed shading

Postby LsrgcBath » Mon Nov 07, 2016 4:41 pm

While a Wild Bart´s dont appears in the topic, I remember him talking about this in the wip thread...

https://www.supermodel3.com/Forum/viewt ... &start=300
User avatar
LsrgcBath
 
Posts: 130
Joined: Sat Jan 21, 2012 2:43 pm
Location: Brazil - Sao Paulo

Re: scud fixed shading

Postby Bart » Tue Nov 08, 2016 8:47 am

An offset to the polygon color, regardless of whether it was defined as RGB or came from a palette?

That's an interesting idea. I wonder if it carries over to LA Machineguns and other problematic games? The logic in my renderer right now is total spaghetti and makes very little sense. It's also possible the logic changed between Step 1.x and 2.x but I would operate under the assumption that it did not.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: scud fixed shading

Postby Ian » Tue Nov 08, 2016 9:07 am

LA Machine guns looks .. quite correct (mostly) from my point of view. But all the parts of the levels are marked with fixed shading + lighting
scud seems to be opposite, and all those parts look really broken.

My guess was since the value is signed, the 'offset' value could add or subtract the brightness. I just need some time to try it and see what happens.

In the SDK the fixed shading values are clamped so as to not allow negative numbers. So this clearly differs from what we have seen in practice. This is the code

Code: Select all
void __thiscall PRO_Vertex::SetFixedShadingIntensity(PRO_Vertex *this, float a2)
{
  if ( a2 >= 0.0 && a2 <= 1.0 )
  {
    *((_DWORD *)this + 6) = *((_DWORD *)this + 6) & 0xFFFFFF00 | (unsigned __int8)(signed __int64)(a2 * 127.0);
    *((_DWORD *)this + 6) |= 0x4000000u;
  }
}
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: scud fixed shading

Postby Ian » Thu Nov 10, 2016 4:49 pm

Well,
adding the offset value works perfectly for scud. Basically all the shading problems are gone
But the logic doesn't quite work for lamachine guns
Lamachine guns really doesn't use fixed shading when the lighting is disabled
Just need to figure out the correct states
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: scud fixed shading

Postby LsrgcBath » Thu Nov 10, 2016 6:44 pm

Ian wrote:Well,
adding the offset value works perfectly for scud. Basically all the shading problems are gone
But the logic doesn't quite work for lamachine guns
Lamachine guns really doesn't use fixed shading when the lighting is disabled
Just need to figure out the correct states


Can you post a screenie for us showing the results, pleaaaaaaase? :D

I can´t wait to play scud with specular and the fixed shading.
User avatar
LsrgcBath
 
Posts: 130
Joined: Sat Jan 21, 2012 2:43 pm
Location: Brazil - Sao Paulo

Re: scud fixed shading

Postby Ian » Fri Nov 11, 2016 3:40 am

Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: scud fixed shading

Postby sonic32 » Fri Nov 11, 2016 5:36 am

Great, looks beautiful and real arcade.Palms, windows, sea, ship ..Ian gives us real hope that this long-term problem
solve.
Scud Race is my "top 1" game and look forward to playing with shading and solid.
Ian- great job-congratulations, this must be difficult to solve puzzle...

Vdaka..Ian
User avatar
sonic32
 
Posts: 169
Joined: Tue Dec 20, 2011 11:43 am
Location: Slovakia

Re: scud fixed shading

Postby Ian » Fri Nov 11, 2016 10:52 am

Try it out if you can compile it >_<
And yeah I wasted a lot of time fixing this. Not 100% sure it's correct, as its hard to tell correct brightness levels when all that's available is recordings off CRT screens ..
but I think it's right
I'm sure Bart will know :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: scud fixed shading

Postby sonic32 » Sat Nov 12, 2016 4:18 am

I just got Newbies downloads of SVN 496 (Emuline) and Ian can prove it, removed the long-term puzzle - poor lighting in Scud Race, :shock:
The game now looks gorgeous, Sea, illuminated tunnels at the airport .....,100% arcade...
The game is colorful and varied, wonderful, I look forward to playing.
Ian solved this of so many riddles in the supermodel, which I have not hope....

Thanks Ian, Bart :)
User avatar
sonic32
 
Posts: 169
Joined: Tue Dec 20, 2011 11:43 am
Location: Slovakia


Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron