Quad rendering bug

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: Quad rendering bug

Postby Ian » Sun Apr 09, 2017 3:27 pm

Ian
 
Posts: 1120
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby Bart » Mon Apr 10, 2017 12:01 pm

Ah very interesting! I suppose the Model 3's rasterizer was able to make these corrections automatically when splitting up quads. I guess we'll have to use the full texture coordinate space to fix the issue then?

But what about non-planar quads? Were they textured as if they were a planar quad?
User avatar
Bart
Site Admin
 
Posts: 1995
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Quad rendering bug

Postby HarryTuttle » Mon Apr 10, 2017 12:08 pm

I'd like to think that the same principle can be also extended to normals. That will change the way the polygons are shaded in fixed shading, sun shading, and specular shading.
User avatar
HarryTuttle
 
Posts: 481
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad rendering bug

Postby Ian » Mon Apr 10, 2017 12:17 pm

Looking at some of the screenshots harry provided I'd say it's quite possible the model3 is directly drawing quads, and not splitting them up as triangles. Emulating this on modern hardware is pretty damn difficult. Even if we can correct the texture coordinates doing per vertex lighting the same way as the hardware is close to impossible :/

Luckily most of the quads draw fine, even the non planar ones.
Ian
 
Posts: 1120
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby Bart » Mon Apr 10, 2017 12:22 pm

Ian wrote:Looking at some of the screenshots harry provided I'd say it's quite possible the model3 is directly drawing quads, and not splitting them up as triangles. Emulating this on modern hardware is pretty damn difficult. Even if we can correct the texture coordinates doing per vertex lighting the same way as the hardware is close to impossible :/

Luckily most of the quads draw fine, even the non planar ones.



It may be an issue that just has to be documented with some examples and explanations of what is observed/what has been tried so that it can be revisited in the future. I'm a big fan of large technical descriptions in at the top of files (as you can see in Render2D.cpp and Legacy3D.cpp ;)) even though they sometimes run the risk of becoming stale and confusing.
User avatar
Bart
Site Admin
 
Posts: 1995
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Quad rendering bug

Postby Jiterdomer » Tue Apr 11, 2017 8:19 pm

Does this also apply to Dural's model? I will make a save state for you guys to see it because Dural had such metallic polygons like any other cars in Scud Race.
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 471
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, CA

Re: Quad rendering bug

Postby Ian » Wed Apr 19, 2017 7:47 am

Found this quite interesting ..

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

That's pretty much exactly some of the bugs we are seeing.
Ian
 
Posts: 1120
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby Bart » Thu Apr 20, 2017 7:34 am

That's an interesting illustration of the problem!
User avatar
Bart
Site Admin
 
Posts: 1995
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Quad rendering bug

Postby Ian » Thu Apr 20, 2017 12:58 pm

I think the only solution to this problem is Harry's suggestion of using geometry shaders. Unfortunately that means we'll have to convert the project to opengl 3+. Might make sense to do this at some later date.
Ian
 
Posts: 1120
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby Ian » Thu Sep 07, 2017 1:50 pm

Well .....
I had a brief touch upon this problem before trying out some nvidia code to render quads. But there were 2 problems,
1) the code was crazy complicated handling all kinds of bow tie and other mad polygons
2) it totally blew apart if i duplicated the last vertex making a triangle, which would mean triangles would need a totally separate render path which would seriously suck

Anyway I tried again with the example code in the super bible

This is what a regular triangle looks like with regular interpolation
Image
Pretty bog standard

Anyway this is a triangle rendered with quadratic interpolation with the last vertex being simply repeated
Image
Really quite different. I think i actually prefer the look of the quad version.

This is a quad rendered with regular interpolation (what we are currently doing)
Image

And the same but with quadratic interpolation (what readl3d) is doing
Image

Pretty exciting. I think we can really add these to the shaders with minimal pain really. The code is simple. My best guess based upon non experimentation is, that real3d basically only rendering quads. And that triangles probably shared the same render path. It wouldn't make sense to add a totally separate render path for triangles with their own interpolation code. Most games seem to predominately use quads.
Ian
 
Posts: 1120
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