[Patch] Specular Highlight

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] Specular Highlight

Postby Jiterdomer » Thu Mar 23, 2017 7:35 am

Way to go Wizard Harry! This is now getting closer to the arcade counterparts!
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

Re: [Patch] Specular Highlight

Postby Ian » Thu Mar 23, 2017 9:17 am

Bart wrote:This is incredible work! The 3D engine is now very close to being perfect :) This weekend I need to sit down and hammer out the changes I've been working on. Might need to rewrite the ROM loading system one more time, too. I think we'll be able to decommission the legacy engine pretty soon -- can't see much of a reason for it to hang around, although I might let it stick around for just one more release as a fallback.


Please don't remove it .. it's useful for debug and some rare cases like ocean hunter where mine apparently blows up >_<
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Thu Mar 23, 2017 2:49 pm

One last thing about vertex vs fragment light calcs. This is a comparison between original hardware (left), Supermodel's light in fragment (center) and finally Supermodel's light in vertex (right).

In particular it's the angle of incidence that has to be done per fragment. Normalized vertex and sun normals can be passed via varying variables.

ECA (note the diffuse light distribution over the balloons, especially the yellow one):
eca2.jpeg
eca2.jpeg (245.04 KiB) Viewed 3653 times
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Thu Mar 23, 2017 3:05 pm

You tried just normalising the normals for the per vertex lighting?
Puzzled why the poly on the bottom left of the yellow balloon looks off
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Thu Mar 23, 2017 3:22 pm

Ian wrote:You tried just normalising the normals for the per vertex lighting?

Yes, then I've done the dot product per fragment.

Ian wrote:Puzzled why the poly on the bottom left of the yellow balloon looks off

That's another thing I think you could be better able to solve: I noticed that quad polys have sometime the wrong inner edge orientation, so the shading has an odd distribution, dunno if it could be solved by using quad primitives in OpenGL.

Anyway, just for testing, I've flipped in my build every the counter-clock drawn quads. This has "fixed" some shading in Harley and Dirt Devils, i.e. to visually match Model 3, but broke other games.

However even with that, there's some difference you can still notice at very near distance. I'll post a better screenshot to explain what I mean, incidentally that was the starting point for my specular highlight simulation.

UPDATE:
That's it, Model 3 (left), Supermodel "good" shading (center), Supermodel "bad" shading (right)
h1.jpeg
h1.jpeg (252.45 KiB) Viewed 3634 times


Note there's also some texturing difference, in that case on the suspension, but a better example is in Scud, which I'll post soon.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Thu Mar 23, 2017 4:16 pm

That's another thing I think you could be better able to solve: I noticed that quad polys have sometime the wrong inner edge orientation, so the shading has an odd distribution, dunno if it could be solved by using quad primitives in OpenGL.


OpenGL really just tessellates quads into triangles. So not sure it would make much difference. The shading differences are certainly interesting though.

Also the balloon in the above pic is quite interesting. On the original h/w you can't see through the balloons.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Thu Mar 23, 2017 4:23 pm

Ian wrote:OpenGL really just tessellates quads into triangles. So not sure it would make much difference.

I forgot to say also triangle strip, instead of drawing every quad as two triangle we could just specify the fourth vertex. Btw I don't know if even in that case they'll be tesselated again into triangles.

Ian wrote:The shading differences are certainly interesting though.
Also the balloon in the above pic is quite interesting. On the original h/w you can't see through the balloons.

That's because of compression artifacts that don't let you see the asphalt behind. In a bunch of frames before that, when the balloon passes in front of the ambulance, you can actually see through.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Thu Mar 23, 2017 4:29 pm

Makes sense :)
I'm gonna have a quick go and see if i can get the real3d mipmaps working. Maybe we could be lazy and just use them directly and clamp at 6 possible levels ..
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Thu Mar 23, 2017 4:45 pm

Ian wrote:Maybe we could be lazy and just use them directly and clamp at 6 possible levels ..

I think that would reproduce exactly what Model 3 does :)

Btw, here's another example of texture "distortion".

Scud Race
Model 3 (left), Supermodel "good" shading (center), Supermodel "bad" shading (right)
sr2.jpeg
sr2.jpeg (247.14 KiB) Viewed 3615 times
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Thu Mar 23, 2017 4:59 pm

yeah that's strange.. but the texturing on the model3 is not great. You can see all kinds of artifacts
Ian
 
Posts: 2044
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 1 guest

cron