[QUOTE=Alfonse Reinheart;1251540]Ahem: “I’m fairly sure that quite a lot of GL 2.x hardware couldn’t handle a uniform array of 200 vec4s. And even if you could, your shader would probably choke attempting to do lighting over 100 lights in one pass.” Emphasis added.
The fact that you found a specific 2.1 card that this happens to work on doesn’t change what I said. Is there 2.1 hardware that can actually store 800 uniform components? Sure; Shader Model 3 requires at least 224 vec4 registers. That doesn’t change the fact that there’s plenty of non-Shader Model 3 capable hardware that still supports OpenGL 2.1. NVIDIA supports SM3 from GeForce 6xxx onward, but AMD didn’t get SM3 support until the Radeon X1xxx line.
So it’s great that it works on your card. That doesn’t mean you should assume that any OpenGL 2.1 card can handle it.
What are you rendering at 27 fps? How much overdraw does your scene get? And what makes you think that a decent deferred rendering implementation won’t perform much better?
OK, here’s my other answer.
In GL 2.1, you have 2 ways to communicate information to shaders: uniforms and textures. If you attempt to use textures, you will have to not only use a float texture, you will have to fetch from that texture twice for every light. And if you compute all of the lights in one pass, that’s 200 texture fetches.
No AMD card before the Radeon HD line (ie: OpenGL 3.x) can handle that. I know the Radeon X1xxx line claims to be able to support SM3, but they’re lying; they can’t actually handle that. They can many texture accesses, but not 200. So it doesn’t matter which performs better; you cannot assume that any OpenGL 2.1 card can handle the texture form.
Therefore, unless you want to restrict yourself to NVIDIA-only hardware (in which case, you should state that up-front), uniforms are your only option. So there is no “fastest way”. There is simply the way that works.
As for NVIDIA hardware, I would be absolutely shocked if fetching from a texture 200 times was faster than accessing an array of uniform values.[/QUOTE]
Thank you for your post. Also I would like to apologise for my behaviour, I do appreciate your time and help. I just had a horrible day and I should not have abreacted that on you. (I hope that’s correct English)
Deferred rendering looks awesome. I’m just a little afraid that I, as a beginner, am not gonna understand this proccess. Is it really hard? Do you think that with alot of research I should be able to make it?
Once again, I’m really sorry.