[Patch] Sun 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] Sun Shading

Postby Ian » Thu Jul 27, 2017 3:35 pm

HarryTuttle wrote:I've read also that when you have uniform scaling in the matrix you don't need to derive (expensively) the normal matrix (or use the built-in gl_NormalMatrix), i.e. the transpose of the inverse of the model-view matrix. But you can just get the first 3 columns (3x3 mat) and directly multiplicate with the normal vector. That's why Ocean Hunters has dimmed objects.


Just tried ocean hunter with that .. and it looks correct! Yes I know you can just use the top 3x3 of the model matrix. I assumed the result of the glNormalMatrix would only be different with a non uniform scaling? I figured that was the whole point of it. Still slightly puzzled why this fixed it because I assume the scaling would be uniform??

Either way :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Thu Jul 27, 2017 3:45 pm

The problem is that sometimes the scaling is not uniform, could that mean Real3D intelligently switches between modelViewMatrix and normalMatrix :shock: ? Still testing...

Also:
Lost World has uniform scaling, but with the modelViewMatrix you'll have over brightened t-rex's foot in the attract mode (45x scale values), maybe step 1.0 and 1.5 have different "transformMatrix * normal" logic... who knows? :)
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Thu Jul 27, 2017 3:50 pm

Can you take a screenshot of the crazy foot?
Lost world has a bunch of weird normals in some of the models, always worth checking that
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Thu Jul 27, 2017 3:54 pm

Ian wrote:Just tried ocean hunter with that .. and it looks correct!


Speaking of which: if you look carefully at the various gameplay videos on Youtube, at the start of the first level, during the intro, the shading literally flickers, switching from dim to bright shade (as is currently rendered in Supermodel). What causes that? Cannot be a glitch on a particular hardware, since It's present in at least three different user's videos.

Is it some sort of rounding error, some value that (again) triggers a different shading model?
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Thu Jul 27, 2017 3:56 pm

No clue!
Maybe bugs, who knows
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Thu Jul 27, 2017 4:00 pm

Ian wrote:Can you take a screenshot of the crazy foot?
Lost world has a bunch of weird normals in some of the models, always worth checking that


That's it:
lostw01.png
lostw01.png (189.32 KiB) Viewed 6957 times

SWTrilogy also has some over-bright problem like that, but many times can be neutralized with the division by the node-level modelScale value.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Thu Jul 27, 2017 4:08 pm

This is what my current experimental build looks like
Image

Instead of normalize the result, just divide by the model matrix scale.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Thu Jul 27, 2017 4:18 pm

Ian wrote:Instead of normalize the result, just divide by the model matrix scale.


yes, but that will break again Ocean Hunter, it's like always reverting the matrix xyz scaling factor to 1.0 (circa)
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: [Patch] Sun Shading

Postby Ian » Thu Jul 27, 2017 4:53 pm

Ocean hunter seems to look okay
However ..

I notice on the real hardware the lighting flashes on/off?? is this what you are talking about?

Image

Most strange. It doesn't fade out, 1 min it's there, then it suddenly disappears.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: [Patch] Sun Shading

Postby HarryTuttle » Thu Jul 27, 2017 5:04 pm

Ian wrote:I notice on the real hardware the lighting flashes on/off?? is this what you are talking about?


Yes, exactly that... I'm clueless :(
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron