disillusioned by vertex shaders

Started by
12 comments, last by NineYearCycle 14 years, 1 month ago
I'm rather unhappy by this assuming I'm correct. Just by the act of using a vertex shader, I now have to do the transformations and lighting, in addition to what ever the effect is that I'm trying to do. bah. The transformations is not that big a deal but to have to also replace the current lighting with my own now.... sigh. [Edited by - howie_007 on March 5, 2010 10:14:15 AM]
Advertisement
Correct. There used to be shaders somewhere (NVidia or ATI's site) which were just the fixed function pipeline in shader form - they might be a good starting point.

On the plus side, you're not limited to 8 dynamic lights any more...
Quote:Original post by Evil Steve
On the plus side, you're not limited to 8 dynamic lights any more...
And potentially a bigger plus, you can implement per-pixel lighting fairly trivially.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by Evil Steve
On the plus side, you're not limited to 8 dynamic lights any more...

That is a plus but I didn't factor this into my engine design. This is one of those "all or nothing" decisions and now you have the added overhead of passing in the light data. uuugghh.
Quote:Original post by swiftcoder
And potentially a bigger plus, you can implement per-pixel lighting fairly trivially.

That is true but I have a feeling that would cost some serious FPS.
Quote:Original post by howie_007
Quote:Original post by Evil Steve
On the plus side, you're not limited to 8 dynamic lights any more...

That is a plus but I didn't factor this into my engine design. This is one of those "all or nothing" decisions and now you have the added overhead of passing in the light data. uuugghh.
The overhead is no more than it was with the fixed function pipeline; you just need to pass the light data in as a global.
I for one, never regret rewriting everything to use shaders and completely abandon the fixed function pipeline. :) The FFP code was unflexable and in the most part black magic, as I did't understand how some stuff worked and why. Shaders actually open you eyes and untie your hands :)
Quote:Original post by howie_007
Quote:Original post by swiftcoder
And potentially a bigger plus, you can implement per-pixel lighting fairly trivially.
That is true but I have a feeling that would cost some serious FPS.
On even moderately modern hardware, you won't notice the hit.

Simple per-pixel lighting involves one square root and two dot products in the pixel shader - certainly lower cost than any other pixel-shader effect you will be implementing.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by Evil Steve
Correct. There used to be shaders somewhere (NVidia or ATI's site) which were just the fixed function pipeline in shader form - they might be a good starting point.


It was ATI. [smile]

Quote:Original post by MJP
It was ATI. [smile]

Thanks for providing a link to that. Thanks to all helping me "get my mind right" about adopting the vertex shader for standard lighting. One other benefit I now see for this is if you do your transformations first, you don't have to translate your light position based to your model in model space. One of my big gripes with DirectX.

This topic is closed to new replies.

Advertisement