What is faster? (pixel shader vs fixed-pipeline)

Started by
4 comments, last by RPTD 18 years, 9 months ago
i want to implement shadow volumes for my engine and for this (going for the moment straight after the gamasutra tutorial) i implemented an ambient pass followed by a render pass for each light (where i only render elements hit by the light). now my question goes towards the ambient pass at the beginning. for consistency i create there a vertex and pixel program that does nothing but OutColor = InColor * Texture(InTexPos);. now would it be faster if for this ambient pass i disable the vertex and pixel programs and just do a fixed pipeline rendering of the same? personally i would guess it is faster but is it also worth it?

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

Advertisement
On the R300 and beyond and the GF6 and beyond there is no fixed function pipeline in hardware any more, so really it doesnt matter, the driver just builds a shader behind the scenes to do the work.
So, as speed wise they are going to be the same I'd stick with a unified approch to things, it will make it easier if in the future you want to change stuff about.
I don't think you would notice a particular difference. It's not likely that this is your bottleneck in any case, so you shouldn't be worried.

Edit: _the_phantom_ beat me to it [smile]...
good to hear... then i can simply load my programs without worrying.

one question though. i can not read back data from memory in my pixel program right? for example i can not somehow create a 'larger' buffer (nor just RGBA i mean) so i can save for example the lighting data i calculated to avoid over-brighting (like if i point my strong flashlight at a already heavily lit surface) on a moderate hardware like a ATI Radeon 9700 (or 9600)?

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

fragment shader output always goes to a colour buffer, however the format of that colour buffer is a little flexible, you probably could do something by rendering to a texture to get back at the infomation later.
Quote:Original post by _the_phantom_
fragment shader output always goes to a colour buffer, however the format of that colour buffer is a little flexible, you probably could do something by rendering to a texture to get back at the infomation later.

does that mean what i could als read the values from the buffer i want to write to? or would this mean i need to create an render target of the same size, render there and then use it as a texture? would be rather slow as somehow render-to-texture i could not get to work so far (i need the copy-to-texture method to do this atm).

Life's like a Hydra... cut off one problem just to have two more popping out.
Leader and Coder: Project Epsylon | Drag[en]gine Game Engine

This topic is closed to new replies.

Advertisement