Flat 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!

Re: Flat shading

Postby Bart » Tue May 03, 2016 2:27 pm

I need to see if Abelardo has a video of it. I think it's probably fine the way it looks in your engine, with lighting disabled and fixed intensity used, but the question is what bit/bits select this mode (fixed shading and no lighting). Can't think of a great strategy to figure this out other than to create a truth table for a huge number of objects in different games, assuming I can correctly guess what the correct lighting for each should be.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Flat shading

Postby Ian » Tue May 03, 2016 2:59 pm

Heres the vid

https://www.youtube.com/watch?v=qrJkQ9e9uwQ

I wonder if the difference is simply gamma correction. I know the h/w supports it.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Flat shading

Postby Bart » Tue May 03, 2016 3:56 pm

Maybe. I thought gamma correction applied to the full frame, though? It looks to me like the scene is just fixed shaded.Seems to me like an option to continue multiplying the fixed intensities by ambient light would be useful. You get the benefits of fixed shading but can still dial up the illumination easily for things like explosions.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Flat shading

Postby nuexzz.. » Tue May 03, 2016 4:11 pm

here changing a value of one to two (1-bit), you can see how it changes the lighting of sailing and boat.
value is a memory game or emulator? :?


Image
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: Flat shading

Postby Bart » Tue May 03, 2016 4:16 pm

I'm not sure what you're changing but you have to be careful not to assume that our renderers are reacting correctly. The question is how should the various bits in the polygon header be interpreted and what should our renderer draw in each case?
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Flat shading

Postby nuexzz.. » Tue May 03, 2016 4:57 pm

Surely so I found some piece of debug of you well That this does is highlight the parts Where lights and no where.
the castle is dark
Image

so that changes of 255-0
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: Flat shading

Postby Bart » Tue May 03, 2016 5:15 pm

Can you rephrase that?
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Flat shading

Postby Bart » Wed May 04, 2016 8:32 am

Bad news: looks like Stefano was right. The debug menu seems to be dead code. I found a number of functions that lead to it but every single one of them is referenced only via a pointer in that table. I suspect they are just the inner functions of the debug menu itself. I'll dig deeper on Friday but I think the code was simply removed in the production version. You can imagine an #ifdef statement surrounding the block that checks for the magic code would have this effect. The reason their linker didn't remove the code is probably because of the pointers in the function table.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Flat shading

Postby Ian » Wed May 04, 2016 3:17 pm

Harley has a bunch of random dark spots ..

Image

Let's draw the normals as colours and see what's going on

Image

Hmm only the windows have normals in the middle. What does the arcade look like??

Image

Okay it has shading across the whole building. Must be flat shading !

Using Bart's bit analysis tool with the legacy renderer. Half the buildings are missing faces :(

Image

But it's enough to see this bit might be 1 = smooth shading 0 = flat shading

Let's try it

Image

Seems fixed! Hopefully this will work for other games too :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Flat shading

Postby Jiterdomer » Wed May 04, 2016 3:38 pm

Will they fix the MGM Lion in LA Machineguns and the Beverly Hills grass in Harley?
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 627
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, California

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron