-
Advanced Member
Frequent Contributor
lighting...
I'm trying to put together a Vertex and fragment shader that just do what the 1.5 pipeline does.
I can't seem to get the same performance out of my vertex shader when computing lighting as OpenGL (I'm using a straight copy out of the orange book for my lighting calculations).
I'm on a 5950.
has anyone implemented lighting (with multiple lights) and gotten basically the same performance as OpenGL fixed?
any ideas how to optimize and what built in uniform varibles I should make use of?
-
Junior Member
Regular Contributor
Re: lighting...
I don't really have a solution to your problem. All I can say is despite all my efforts, terrible performances on me 5900 when I use a fragment shader or a fragment program, even if it's a simple one.
The Radeon is much better for the shaders. I can't wait to see how the GeForce 6800 will be.
-
Junior Member
Regular Contributor
Re: lighting...
You won't for now get the same performance as the FFP. And besides this, most modern cards nonetheless don't have a FFP anymore but emulate it via shaders.
But you need to remember that all glslang-implementations out there are still in beta-stage, and in that stage it's bug-finding before speed-optimization. I for myself have made a simple bump-mapping scenario where I do the bump via an ARB-shader and a glslang-shader, and the ARB-shader (although doing nothing more or less) is faster by a good amount. But as the glslang-implementations mature, the speed will get faster and hopefully get as fast as ARB-shaders (at least on current hw. My 9700 is significant slower on glslang than on a similar ARB-shader).
-
Advanced Member
Frequent Contributor
Re: lighting...
vince, I've had the chance to run my shader on an NV40 and I can tell you that it ran just about in real time. the NV40 is some serious $hit!
-
Junior Member
Regular Contributor
Re: lighting...
Aeluned, you lucky bastard! I wanna try one of those cards too. Do you know when they are supposed to release them?
-
Advanced Member
Frequent Contributor
Re: lighting...
I can only speculate...and don't quote me on this, but I think they may become widely available sometime in July.
-
Advanced Member
Frequent Contributor
Re: lighting...
What's the point in using a shader if you want it to do exactly the same thing as the fixed-function pipeline?
-- Tom
-
Advanced Member
Frequent Contributor
Re: lighting...
I think the GeForceFX has some fixed function vertex processing hardware in addition to the vertex shaders. The reason is (I'm guessing) to get good performance in professional CAD like apps which often are very geometry limited.
Besides, even if there wasn't any fixed function vertex processing hardware, if you're using fixed function the drivers can used special hand tuned assembly shaders done specially for each hardware model for optimal performance. I doubt nvidias shadre compiler beats nvidias driver engineers.
-
Advanced Member
Frequent Contributor
Re: lighting...
Tom -
unless I'm missing something, If I write a vertex shader and I want lighting I'm going to have to implement it. I'm not trying to recreate the whole FFP, but I do need to recreate that part of it.
-
Advanced Member
Frequent Contributor
Re: lighting...
Okay, but that's different from what you originally said
As harsman already stated, the fixed-function stuff may run on dedicated hardware, whereas your shader has to go through the more general programmable pipeline. It seems perfectly reasonable to me that the added flexibility costs you some performance.
Just how big is the performance gap you're trying to close?
-- Tom
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules