[Patch] Spotlight and Fog

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] Spotlight and Fog (Part 1: Spotlight)

Postby Ian » Sun Apr 02, 2017 11:23 am

fixed shaded polys are not affected by spotlight at all.

I think the spot light should be enabled for everything. Spot light doesn't use normals for lighting. What do you think?
Ian
 
Posts: 1216
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Spotlight and Fog (Part 1: Spotlight)

Postby HarryTuttle » Sun Apr 02, 2017 11:34 am

I think the same. For now I didn't notice anything "off" or strange with the scene by enabling spotlight for all.

I'll think of some test case to ultimately confirm this, however.
User avatar
HarryTuttle
 
Posts: 558
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Spotlight and Fog (Part 1: Spotlight)

Postby Ian » Sun Apr 02, 2017 2:09 pm

Harry, I've pushed your code. I made a few small changes. I put the fog calculation back inside the vertex shader. This is how the original hardware would have done it. Also cuts down the size of the fragment shader a bit, but otherwise the code is nearly identical.

Tried out emergency call ambulance, looks really fantastic. Great work !

We probably should always use the spot light regardless of the lighting value. But can look at that another night.
Ian
 
Posts: 1216
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Spotlight and Fog (Part 1: Spotlight)

Postby HarryTuttle » Sun Apr 02, 2017 3:38 pm

Thanks Ian! :)

I'm planning to look into the remaining issues with spotlight, specular and fixed shading, I'd like to fix them before the next release.
User avatar
HarryTuttle
 
Posts: 558
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Spotlight and Fog

Postby HarryTuttle » Sun Oct 01, 2017 1:54 pm

Resuming the old thread. Here's the latest spotlight & fog patch for r667.

- rewrote the math in a simpler way, it should be almost arcade-perfect. Fixed Dirt Devils' expert course lighting issues during night (after 2nd lap, if I recall), fixed some issues in ECA attract mode (just before the breaking screen glass effect), and maybe other games as well;

- commented vp->spotRange[0] limits hack for Star Wars Trilogy in <New3D.cpp> as it doesn't seem to improve anything now, instead breaks LeMans 24 spotlight fading distance;
Attachments
diff.zip
(3.3 KiB) Downloaded 21 times
User avatar
HarryTuttle
 
Posts: 558
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Spotlight and Fog

Postby Ian » Tue Oct 03, 2017 3:27 pm

Hey, sorry it's taken me longer to look at this.
Shouldn't we also be patching the scroll fog class ? :)
Ian
 
Posts: 1216
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Spotlight and Fog

Postby HarryTuttle » Tue Oct 03, 2017 4:01 pm

Ian wrote:Hey, sorry it's taken me longer to look at this.

No problem :)

Ian wrote:Shouldn't we also be patching the scroll fog class ?

No, we don't need to do that. On scroll fog Spotlight is just an ellipse without start,extent and decay terms. The current official implementation seems correct.
User avatar
HarryTuttle
 
Posts: 558
Joined: Thu Mar 09, 2017 8:57 am

Previous

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest