Specular

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!

Specular

Postby Ian » Fri Oct 28, 2016 3:15 am

One of the big missing features graphically are the specular highlights. Currently code for specular exists in the new engine, but it's disabled because they look quite wrong (compared to the real hardware).

If people could post below specular in games they like, and what it looks like on the real hardware we might be able to figure out what it's doing.
This is lemans24. You can see the specular highlights are almost flipped of what they should be on the real hardware

real hw
Image

supermodel currently
Image

Please post images below for comparison
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Specular

Postby Bart » Fri Oct 28, 2016 7:35 am

Abelardo sent me a number of video captures some years ago. Would you like me to upload these for you?
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Specular

Postby Ian » Fri Oct 28, 2016 8:04 am

Sure
Just need some good examples where specular is clearly visible
I have a feeling the hardware isn't doing real specular at all and is fudging it. I did some debugging regarding the light angle, and in other games like virtua fighter the lighting is identical to the original hardware.

I have a feeling the hardware might be just flipping the x of the normal, or the x component of the light vector and not using the view angle at all. A little bit like diffuse lighting, but with a flipped vector
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Specular

Postby LsrgcBath » Fri Oct 28, 2016 10:27 am

It´s hard to find good sources on YT, so, I dont know if this comparative shots made to compare the microtextures coud help, the bad is the different colour scheme :/

Image
Image
Image

I will try to find more footage and post here

It will be awesome the specular working, imo, it´s the cherry on the cake

Edit.

Abe´s made an side by side Model 3 vs Supermodel 4 yrs ago...

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

Another video that maybe could help...

https://www.youtube.com/watch?v=QDHlMY223jQ
User avatar
LsrgcBath
 
Posts: 130
Joined: Sat Jan 21, 2012 2:43 pm
Location: Brazil - Sao Paulo

Re: Specular

Postby Ian » Fri Oct 28, 2016 11:01 am

The side by side video of scud is pretty good
I can see some differences in specular already
Will try and post some screenshots from that video later

Image

Next thing to do will be to draw the light vector as a vector inside super model to better help debug the issue
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Specular

Postby Ian » Sat Oct 29, 2016 10:38 am

Well I drew the light vector as a line.

Image

Hardware version again

Image

I would definitely say the hw is faking specular somehow
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Specular

Postby Ian » Sat Oct 29, 2016 10:47 am

Flipped x light vector

Image

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

Re: Specular

Postby LsrgcBath » Sat Oct 29, 2016 7:54 pm

Very nice!!

The direction of the light source seems correct to me, but what about the brightness?

In the real Model 3 the highlights looks a bit more bright, perhaps this could be adjusted changing something or it´s a automatic feature set from the API?

BTW... look in the Abe´s side by side video, on the beginner day track, the parts with water (Roof top, trough the windows on the building before the dolphin tunnel and on the roof inside the tunnel, also in the pond close to the boats floating) in the real Model 3 looks more bright too, perhaps these parts get the specular or it´s something else?

Image
User avatar
LsrgcBath
 
Posts: 130
Joined: Sat Jan 21, 2012 2:43 pm
Location: Brazil - Sao Paulo

Re: Specular

Postby Bart » Sun Oct 30, 2016 10:20 pm

Some of the brightness stuff has to do with color modulation. There is a lot that we clearly don't understand about that. I think we more or less know the math but not when to apply the different possible shading modes.

Ian: It's late here, I'll try to upload the videos Monday evening my time.

Re: the lighting vector being swapped for specular, that's a pretty odd thing to do given that they had a workable approximation for specular lighting in Model 2. Is there any possibility that the light vector is wrong altogether and that we are also getting diffuse light wrong? This seems unlikely to me because it would be noticeable but it's worth a sanity check. I think Sega Rally 2's Desert stage in championship mode is a good test case because there are banners lining the road at the starting line that would look wrong if the diffuse light vector's X component were flipped.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Specular

Postby Ian » Mon Oct 31, 2016 2:02 am

Some of the brightness stuff has to do with color modulation. There is a lot that we clearly don't understand about that. I think we more or less know the math but not when to apply the different possible shading modes.


All the bits that are too dark in scud have lighting disabled, and also fixed shading enabled.

I debugged the light vector in other games, and it looks perfect. I also explored the possibility that the light vector could be multiplied by the the viewport position .. but it seems not to be the case.

Specular in the model2 was probably cheaper because they only had flat shading. To do proper specular you need to get a length vector for each vertex which involves a square root. Maybe the hardware simply couldn't do this? Specular isn't written about in the dev stuff, maybe it was simply an after thought.

If you look at these vidoes
https://www.youtube.com/watch?v=0Pu6fYjHgYw#t=10s
https://www.youtube.com/watch?v=P2IxutO ... 303s#t=25s

The specular highlights seem to not be effected by the camera angle
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Next

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron