[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 LsrgcBath » Fri Mar 24, 2017 7:14 pm

Image
Image

Image

I'm hoping to see this working in the right way for a loooong time, imo, the specular aways seemed to me that little detail that gives the charm in the model 3 games, since the first time I saw Scud Race in an arcade, I liked to see the effect interacting with the car windows and bodywork, and when I play in the emulator, although I understand that in general, almost everything is very similar to the real hardware, I always get that feeling that something is missing and that because of the lack of the specular.

This month has been very good, this week Sega finally released the X360 Daytona USA backwards compatibility on Xbox One and now we have all this recent progress due to Harry's contributions, all that has only added to us who have loved everything that Sega made at his best in arcades.

Harry ... I suppose you inadvertently gave us a sneak peek of what you were doing in specular in the topic about fixed shading ...

Image


viewtopic.php?f=7&t=1344&start=10

:lol:

Anyway, my congratulations for the great work, what you guys are doing is very valuable for us and for the purspose of preservation, I think Model 3 deserves all this care.
User avatar
LsrgcBath
 
Posts: 130
Joined: Sat Jan 21, 2012 2:43 pm
Location: Brazil - Sao Paulo

Re: [Patch] Specular Highlight

Postby HarryTuttle » Sat Mar 25, 2017 3:48 am

Thanks LsrgcBath :)

LsrgcBath wrote:Harry ... I suppose you inadvertently gave us a sneak peek of what you were doing in specular in the topic about fixed shading ...

Well, yes, in fact I've all the mods already applied in my build, however I had to separate them and clean 'em up before posting, 'cause my files are also *full* of ugly debug code that's just unpresentable and would have created major headache should I have submitted in a single time.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Sat Mar 25, 2017 5:09 am

getting specular working is next on the todo list :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Sat Mar 25, 2017 5:56 am

Ian wrote:getting specular working is next on the todo list :)


Ian, while I'm almost sure about specular on opaque polys, I'm currently reworking the effect on transparent ones because I noticed some inconsistency in Harley and maybe some other corner case.

Just to inform you in case you want to merge it.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Sat Mar 25, 2017 6:32 am

check your email :)
I figured we could make some test cases, by drawing the normal vectors, then drawing the actual light vector from the poly surface
we should be able to figure out the correct formula that way
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Sat Mar 25, 2017 8:15 am

I'm back. I've just sent you the binary.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Sat Mar 25, 2017 8:55 am

thanks :)
Will check it out later tonight
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby Ian » Sun Mar 26, 2017 2:37 pm

Hey Harry,
I gave your code a spin with the specular code. It looks really amazing for scud, pretty close to the h/w I think. But if you try lemans24, at the car selection there is almost no specular applied at all. And the cars are mostly lit by specular in this scene.

Specular is a really hard problem, and without knowing the exact formula they used it's really hard to reverse engineer something based off of videos. It's why I've been reluctant to add it, or even try and add it.

We could add it anyway though. Some specular is more correct at least than none ..
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Specular Highlight

Postby HarryTuttle » Tue Mar 28, 2017 3:48 am

Ian, I've compared also with some step 2.x games like srally2 and daytona2, the latter with the videos from Abe. And they look to also match the arcade version. I could post some screenshots later (I'm currently very busy at work, that's why I almost didn't come here in the last 2 days...).

In lemans24, there's the famous sunlight position problem that, if I recall, you found to be caused by an alternate rom version of the game. But the problem is surely present in some scenes of LA Machineguns, again compared to some recent videos I found on youtube.

In lemans24, during the game, the specular seems correct, especially during night, although the sun direction is different. Just try to put the following line in <New3D.cpp>, "RenderViewport" function:
Code: Select all
vp->lightingParams[0] *= -1.0f;

after this code:
Code: Select all
vp->lightingParams[0] = *(float *)&vpnode[0x05];                        // sun X
vp->lightingParams[1] = *(float *)&vpnode[0x06];                        // sun Y
vp->lightingParams[2] = *(float *)&vpnode[0x04];                        // sun Z

Then we can compare to some footage seen around. I might re-check again later today.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Specular Highlight

Postby Ian » Tue Mar 28, 2017 4:57 am

Yeah annoyingly there are 2 versions of lemans 24 about. I only noticed differences in the selection screen with the cars with regards to the light angle.
The maths for the sun position is correct, but a bit of a kludge because the real3d uses a different coordinate system.

I spent a bit of time looking at arcade footage to see specular. I am 100% sure what the real3d is doing is not real specular, and that we are roughly along the right lines with the formula.

I do wonder though if it would be worth trying the model 2 specular formula, since I never actually tried it.
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