[Patch] 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!

Re: [Patch] Fixed Shading

Postby HarryTuttle » Fri Mar 17, 2017 5:19 am

Ian, since those comparisons are a bit time consuming to prepare, if you need specific cases let me know.
User avatar
HarryTuttle
 
Posts: 520
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Fixed Shading

Postby Ian » Fri Mar 17, 2017 5:27 am

Well ..
any that look obviously broken (with the current code) compared to the real h/w would be really useful
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Fixed Shading

Postby Bart » Fri Mar 17, 2017 7:35 am

How about Scud Race -- in particular, the bridge and castle walls, the airport terminal, and the waterfalls on the medium stage? These have bedeviled us for some time.
User avatar
Bart
Site Admin
 
Posts: 2038
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: [Patch] Fixed Shading

Postby HarryTuttle » Fri Mar 17, 2017 7:51 am

Bart wrote:How about Scud Race -- in particular, the bridge and castle walls, the airport terminal, and the waterfalls on the medium stage?

Ok, They're coming. I'll update this post.

Update #1: Scud Race - Waterfalls (Left: Abe's video, Middle: Supermodel post-fx, Right: Supermodel with marked fixed-shaded polys)
sr1.jpeg
Blue = self-illuminated fixed shaded polys
sr1.jpeg (253.07 KiB) Viewed 730 times


Update #2: Scud Race - Terminal
sr2.jpeg
Blue = self-illuminated fixed shaded polys
sr2.jpeg (245.36 KiB) Viewed 726 times


Update #3: Scud Race - Bridge & Castle
sr3.jpeg
Blue = self-illuminated fixed shaded polys
Red = illuminated fixed shaded polys
sr3.jpeg (241.34 KiB) Viewed 716 times
Last edited by HarryTuttle on Fri Mar 17, 2017 10:01 am, edited 3 times in total.
User avatar
HarryTuttle
 
Posts: 520
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Fixed Shading

Postby Ian » Fri Mar 17, 2017 8:51 am

looks basically the same?
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Fixed Shading

Postby HarryTuttle » Fri Mar 17, 2017 9:20 am

I've to confirm. However here's your formula for self-illuminated fixed-shaded polys and, following, mine:
Code: Select all
shade = (((ix + 128) & 0xFF) / 255.f) + 1.f


Code: Select all
// For step 1.5 games
shade = 1.f + (float)((UINT8)(ix & 0xFF)) / 128.f;
User avatar
HarryTuttle
 
Posts: 520
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Fixed Shading

Postby Ian » Fri Mar 17, 2017 9:28 am

the +1 means it 100% brightness. Anything further than that further increases brightness, so you won't really get any dark areas

This is the part I wasn't sure was shaded correctly (thought mine was too bright), or rather not enough contrast

Image
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Fixed Shading

Postby HarryTuttle » Fri Mar 17, 2017 9:54 am

Ian, I just updated my previous post with that image of the bridge.

Ian wrote:the +1 means it 100% brightness. Anything further than that further increases brightness

I think It's perfectly "legal" for Real3D to multiply poly RGB values by (1.0 + Shading), since the final texel.rgb will be:
Code: Select all
final.rgb = texel.rgb * poly.rgb;

In case of scud's sky texture, it will bring an over-brightened sky, that's - I think - the intended behavior as you can see from the videos.
Last edited by HarryTuttle on Fri Mar 17, 2017 10:03 am, edited 2 times in total.
User avatar
HarryTuttle
 
Posts: 520
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Fixed Shading

Postby HarryTuttle » Fri Mar 17, 2017 9:58 am

Ian wrote:This is the part I wasn't sure was shaded correctly (thought mine was too bright), or rather not enough contrast

Judging from the formulae, we'll obtain, in that specific case, the same value.

Update: I've to correct my last sentence, we'll obtain different results, your shading value will be higher and yes, your poly will be brighter.
User avatar
HarryTuttle
 
Posts: 520
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Fixed Shading

Postby Ian » Fri Mar 17, 2017 1:51 pm

So what do you think the correct formula is?
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 2 guests