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 » Fri Apr 07, 2017 2:42 pm

What compile errors do you get
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby HarryTuttle » Fri Apr 07, 2017 3:08 pm

Ian wrote:What compile errors do you get


Well, this is weird: I *used* to issue "-DSUPERMODEL_DEBUGGER" aside "-DDEBUG" compile option, until a version which I don't remember, otherwise it failed, that's why I've done the same until now to compile it (but Supermodel crashed as said before).

Now, just to try, I compiled with only "-DDEBUG" and worked! :D

Dunno what changed... anyway all seems to work well.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad rendering bug

Postby HarryTuttle » Fri Apr 07, 2017 3:16 pm

I think that the version that still needed "-DSUPERMODEL_DEBUGGER" with "-DDEBUG" was r576. After that the compiler threw this error:
Code: Select all
Compiling Src/OSD/SDL/Main.cpp...
Src/OSD/SDL/Main.cpp: In function 'void TestPolygonHeaderBits(IEmulator*)':
Src/OSD/SDL/Main.cpp:468:24: error: variable 'std::ofstream fs' has initializer but incomplete type
   std::ofstream fs(file);

But as of version r585 is fixed.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad rendering bug

Postby Ian » Fri Apr 07, 2017 3:22 pm

Yeah that was just a missing include, I had the same error in visual studio.
I did some debugging of this issue today. The hardware must be doing some calculation per poly to work out which way to split it. Since the independent quads, is no shared verts have this same issue. That rules out problems related to the order we are processing them.

Wonder if it uses the texture coordinates to work out which way to split
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby Bart » Fri Apr 07, 2017 3:56 pm

Glad it's working. For the record, I now know why it crashes. It's not the static_cast<> that's the problem. It's that the debugger is not aware of IEmulator and assumes it has a CModel3 object. It crashes when it tries to get the pointer to the DSB board, a function that CModel3GraphicsState doesn't even have. The explicit static_cast<>, by the way, is because gcc will complain that the ternary operator (?:) is being invoked with two different types (the derived classes). This graphcis state thing is really just a hacky dev thing so I'm okay with it being semi-broken.

Phew! The world makes sense again!
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Quad rendering bug

Postby HarryTuttle » Fri Apr 07, 2017 4:03 pm

Bart wrote:Phew! The world makes sense again!


Not too fast :P I started a new topic here: http://www.supermodel3.com/Forum/viewtopic.php?f=2&t=1369
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad rendering bug

Postby Ian » Sat Apr 08, 2017 12:05 pm

been thinking about this problem a bit ..
This is essentially the problem with quads

Image

The bottom one is generated by a geometry shader. Some code for that here -> http://www.informit.com/articles/articl ... 3&seqNum=2

I was wondering if we could do something very similar by splitting a quad into 4 triangles. We would need to calculate a new centre point, but that is pretty easy thankfully, just an average of the 4 points. We would also need to average the normals

Image
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby HarryTuttle » Sat Apr 08, 2017 12:28 pm

That's why, I think, in one of the posted Harley images, the one with the red car very near the camera, the highlight on the side window appears to have a circular shape, instead of the square-shaped version of Supermodel.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad rendering bug

Postby Ian » Sat Apr 08, 2017 12:33 pm

I'll have a look :)
Edit
Can you take a screenshot of what you mean ? :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad rendering bug

Postby HarryTuttle » Sat Apr 08, 2017 12:59 pm

left: Model 3, right: Supermodel
hl_02.jpeg
hl_02.jpeg (226.11 KiB) Viewed 7418 times


Edit:
the Supermodel's one has the "good" quad split
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