Sign in to follow this  
Dhaos

Shaders & Lighting: Tri's vs Quad's

Recommended Posts

Dhaos    122
Is there any shading benefit from designing a model with quads instead of triangles? (I understand video cards only output tris) Most articles I read, involving high polygon modeling, mentioned that shaders have an easier time dealing with quads than they do with tris in calculating shading/light. Also the sub-divide algorithms seem to go BOOM when dealing with tris. Is this true for low polygon modeling as well? (I do not plan on subdividing a low poly model, I am simply curious as to the shading issues) Also are there any source-tutorials that demonstrate the basics of shader programming? I've only found one working sample of toon shading. I want to play around with a working shader/sample application to understand how they operate. The few books I have on the subject are too loftily worded and provide few working examples. A constant problem for me. (large text descriptions can lose me very quickly unless there is a multitude of examples provided) Lastly are most final models triangle strips or lists? Lists seem much easier to modify during the modeling phase (polygons can be easily separated etc without destroying the model in the process.) While fiddling around with triangle lists I found them to be *very* difficult to structure complex objects with (namely a face or hand etc.) Pardon my asking so many questions during the last few days, it's just the responses here are more...down to earth than what I've found elsewhere. It gets tiring spending hours trying to understand something because it is worded too loftily in a book or article and the author can't be questioned to clarify details.

Share this post


Link to post
Share on other sites
jpetrie    13162
Quote:

Is there any shading benefit from designing a model with quads instead of triangles? (I understand video cards only output tris)

Most articles I read, involving high polygon modeling, mentioned that shaders have an easier time dealing with quads than they do with tris in calculating shading/light. Also the sub-divide algorithms seem to go BOOM when dealing with tris. Is this true for low polygon modeling as well? (I do not plan on subdividing a low poly model, I am simply curious as to the shading issues)

There is no real benefit if you're going to be ultimately rendering with a real-time graphics API like D3D or GL. They only grok triangles. In fact, you can end up with uglier results using quads, because somebody at somepoint will need to convert them to triangles. Sometimes automated processes for this produce ugly results (quads can be nonplanar) so it's better to have control over this -- e.g., do it in the modelling tool somehow.

Whatever you were reading regarding shaders and quads probably had to do with a specific shader, or with the shaders used for something other than real-time rendering as you find in games. They also, to the extent they grok geometry, work with triangles. Or lines or points, but that's another issue.

Quote:

Also are there any source-tutorials that demonstrate the basics of shader programming? I've only found one working sample of toon shading. I want to play around with a working shader/sample application to understand how they operate. The few books I have on the subject are too loftily worded and provide few working examples. A constant problem for me. (large text descriptions can lose me very quickly unless there is a multitude of examples provided)

Google for 'shader tutorials' or 'shader examples' and your API of choice. There are tons of references online, although be aware that many of them are poor.

Quote:

Lastly are most final models triangle strips or lists? Lists seem much easier to modify during the modeling phase (polygons can be easily separated etc without destroying the model in the process.) While fiddling around with triangle lists I found them to be *very* difficult to structure complex objects with (namely a face or hand etc.)

Either. Strips are not as useful as they once were for optimization purposes, though. As far as difficulty in modelling, you may be trying to operate at too low a level.

Share this post


Link to post
Share on other sites
JimmyDeemo    156
Quote:
Original post by Dhaos
The few books I have on the subject are too loftily worded and provide few working examples.


Have you tried Introduction to 3D Game Programming with DirectX 9.0c : A Shader Approach (god i wish it was a shorter title) by Frank Luna. You can probably skip the intro parts and move on to the first shader section. It starts off with a very basic shader that just renders geometry and goes on from there. Might be useful if you want to start at the beginning, however it will explain the concepts as it goes along so might not be what your looking for in terms of wordiness.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this