Normal mismatch

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!

Normal mismatch

Postby Ian » Mon Aug 28, 2017 9:09 am

This one was pointed out by Yoyo

Image ... sp=sharing

You can see the error in the rainbow arrow or whatever you call it. The issue is, the material double sided, and part of the front is being culled out, so you are only seeing the unlit back side. Every poly has the same face normal.

But I found debugging that the calculated polygon normal is completely different to the actual face normal, which makes no sense. It's not inverted as you might expect, it's actually completely different. I haven't gone through every poly individually but my best guess is this is why the culling is fubar here.


Wonder if switching culling to the shaders would fix this. A bit annoying though, as you can't discard vertices in the vertex shader (obviously), so it would have to be done in the fragment shader which is a bit wasteful but perhaps the only way of doing it.
Posts: 1520
Joined: Tue Feb 23, 2016 9:23 am

Re: Normal mismatch

Postby Bart » Mon Aug 28, 2017 10:35 am

Geometry shaders aren't available until OpenGL 3.x right?
User avatar
Site Admin
Posts: 2188
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Normal mismatch

Postby Ian » Mon Aug 28, 2017 1:27 pm

They aren't available, but not sure they would really help anyway as even a pass through geometry shader will significantly hurt fps. Or so I have read anyway, never actually used geometry shaders.

But should be fine doing it in pixel shaders
Posts: 1520
Joined: Tue Feb 23, 2016 9:23 am

Re: Normal mismatch

Postby Ian » Tue Aug 29, 2017 3:24 pm

Well it seems I half solved this problem, apparently it still shows up ?

model3 hardware video showing rainbow effect

YoYo09 wrote:Ian tested the R644.
However, Depending on the difference in position on the replay camera angle you still see the same problem (just like this screenshot).


Unlike the previous one, the rainbow effect is normal in the middle, or appears dark without symptoms.

I am centering on the right side of 1p and putting a goal, and it is confirmed a lot when replay.

I think it seems to be related to the problem that the shadow does not appear normally.

r644 test save (Please delete the file name number 2 and use it.) ... sp=sharing

Rainbow effect on goal replay always
During goal replay move joystick up-left and hold start.

Not 100% sure if the original h/w is like this, or it's a bug on our end.
Posts: 1520
Joined: Tue Feb 23, 2016 9:23 am

Return to The Dark Room

Who is online

Users browsing this forum: Google [Bot] and 3 guests