Quad Rendering Code

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 Code

Postby HarryTuttle » Thu Oct 19, 2017 6:28 am

Ian wrote:But not quite sure what to do with the code. I'm not even sure Harry can run it on his pc.. and that's not good at all, since he has been such a major contributor to the project. I think the best idea might be to simply have 2 sets of shaders that can be switched between versions. The shader inputs are identical. That might be one way of doing it.


I think switching rendering path is a good temporary solution, however I remember some time ago I downloaded a demo for a quad poly emulation and ran it without problems. I don't have at hand the original web page address so I don't know if it was using geometry shader and what not.

Anyway I think it might be worth a try. At least being able to directly test it with an OGL 3.3 class gpu I can try to do something with it.

Btw, great job Ian! :) It seems that Supermodel is pioneering a lot of methods/solutions that not even the official port devs did!
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad Rendering Code

Postby Ian » Thu Oct 19, 2017 7:48 am

Harry see if you can get the noperspective keyword to work on your hardware. You should get what is essentially affine texture mapping
Should be simple enough to just download some hello triangle opengl demo that uses textures and insert that keyword into a shader ..
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad Rendering Code

Postby HarryTuttle » Thu Oct 19, 2017 9:32 am

Luckily no need to run a demo, It's already working in Supermodel. This is the checkerboard floor in LeMans 24 attract intro:
lm24_01.jpeg
lm24_01.jpeg (183.86 KiB) Viewed 7454 times
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad Rendering Code

Postby Ian » Thu Oct 19, 2017 10:14 am

Yeah that looks like noperspective
The playstation look :p

In my current geometry shaders I can't seem to mix the output types. If I assign one as flat or just smooth I get a compile error in the shader.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad Rendering Code

Postby Ian » Sat Oct 21, 2017 10:16 am

This is what it looks like the 5000 series AMD card

Image

Look at the road lol
Image

It's still performing 1/z interpolation even with the noperspective keyword. Don't know how to fix it. The hardware obviously does support it .. since its doing it in your example. But how to make this work with a geometry shader, I don't know.

This is what i'm feeding to the fragment shader
Code: Select all
//interpolated inputs from geometry shader
in GS_OUT
{
   noperspective vec2 v[4];
   noperspective float area[4];
   noperspective float oneOverW[4];

   //our regulat attributes
   //flat float   fogFactor[4];
   //flat vec3   viewVertex[4];
   noperspective vec3   viewNormal[4];      // per vertex normal vector
   noperspective vec2   texCoord[4];
   noperspective vec4   color[4];
   //flat float   fixedShade[4];
} fs_in;


This works on my nvidia card perfectly. I found on my nvidia card, using a geometry shader I can't mix the output types at all otherwise I get some strange shader compilation error, so everything has the same noperspective keyword.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Quad Rendering Code

Postby HarryTuttle » Sat Oct 21, 2017 12:39 pm

Ian, don't know if it's off-topic, but what about this and this?
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: Quad Rendering Code

Postby Ian » Sat Oct 21, 2017 5:03 pm

That's a pretty interesting demo, not seen it before. That guy IQ is scary talented :)
But not really sure it helps us that much. We still have to pass data from vertex -> geometry -> fragment shader
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Previous

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest