OpenGL T&L

Started by
16 comments, last by QWERTY 21 years, 5 months ago
Hi everyone, I am wondering how are T&L done in OpenGL rendering pipeline especially on gfx cards with GPU. In DirectX you can choose between software T&L (done by CPU) and hardware T&L (entirely done by GPU). Now I would like to know how it is done in OGL. Probably it is driver dependant but maybe it''s not so obvious. The only way how to utilize the advantage of HW T&L in OGL is to write your own vertex program or am I totaly wrong and there''s another way? I am working on advanced 3D engine and want the ability to choose between SW and HW T&L but I am not sure about standard OGL rendering pipeline and how it is implemented.
Advertisement
T&N is used seamlessly if is detected, no extra work is required Otherwise the work is done on the CPU by the drivers
Are you sure? Does it mean that on Geforce there are all transformations and lighting calculations always done by hardware? Maybe you should test it first. On my system it seems like there is a difference between standard OGL T&L pipeline and my own written as vertex program. Maybe it is driver dependent though.
quote:
Does it mean that on Geforce there are all transformations and lighting calculations always done by hardware?

Yes. As long as you stay in the limits of the hardware (eg. not enable more lights than the HW can handle).

quote:
On my system it seems like there is a difference between standard OGL T&L pipeline and my own written as vertex program

I guess you haven''t reprogrammed the whole fixed function pipeline, because that would be quite a big vertex program (there is an nvidia paper showing a full fixed function equivalent VP, it''s pretty huge). Shorter VP will of course lead to better performance, but at the cost of less functionality.
Of course a minimal vertex program will be faster - it''s more simple since you''re bypassing a lot of the OpenGL calculation.

T&L is automatically done in hardware for OpenGL. The only things to watch out for are redundant copies of data for Vertex Arrays (try using various extensions like fence, var, compiled vertex arrays) and not using vertex arrays at all (like using glVertex3f...ick).

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
T&L is used automatically when transforming vertices. Matrix * Matrix multiplication is done on the CPU, only Vector * Matrix muls are done via T&L using the standard pipeline.

------------
- outRider -
Ok, thank you guys for your replys. From what you have written I understand that all T&L in OGL is done by GPU if possible and it is still better to reprogram a standard pipeline by your own vertex program due to faster code unless you really need all the functionality of a standard pipeline. Probably I should test this teory first under specific conditions and see which variant is better for me. Thanks again.


[edited by - QWERTY on November 7, 2002 3:40:30 PM]
Keep in mind that by writing your own vertex program, you''ll limit yourself to new generation 3D hardware, and your program won''t work on older hardware anymore (eg. GeForce2 or less).
Aren''t vertex shaders emulated on the CPU for Geforce 1/2 cards? True it defeats the whole point, but it''d still be runnable, unlike if you start crowbaring in pixel shaders...
Yep, they''ll run, but as you said, it kind of defeats the whole point (as it will be much slower than the fixed function pipeline)

This topic is closed to new replies.

Advertisement