working on Vertex Shader VS fixed pipeline thesis

Started by
13 comments, last by khaleelali 18 years, 3 months ago
Quote:Original post by darookie
Quote:Original post by khaleelali
Also regarding the lights, any comments on that ?

OpenGL (and Direct3D as well) provide a fixed number of lights that are supported by the hardware (using the FF pipeline). Usually this number is limited to something like 8 or so. Now imagine having a set of particles that illuminate the scene - say a swarm of fireflies or a number of candles in a room.
While the number of lights in a shader (per pass) is only limited by its max instruction count, the FF pipeline limit is fix.
Yet another good reason for shaders is faking global illumination. While the FF only supports the "ambient light" hack, shaders provide you with the flexibility of choosing from a number of different more sophisticated hacks.


Sweet i will definately look into that. that's what i needed to get started with some ideas. thank you
Advertisement
Quote:Original post by darookie
Quote:Original post by khaleelali
Also regarding the lights, any comments on that ?

OpenGL (and Direct3D as well) provide a fixed number of lights that are supported by the hardware (using the FF pipeline). Usually this number is limited to something like 8 or so. Now imagine having a set of particles that illuminate the scene - say a swarm of fireflies or a number of candles in a room.
While the number of lights in a shader (per pass) is only limited by its max instruction count, the FF pipeline limit is fix.
Yet another good reason for shaders is faking global illumination. While the FF only supports the "ambient light" hack, shaders provide you with the flexibility of choosing from a number of different more sophisticated hacks.


So how would I update my particle system so that each particle is a point source of light? Can I use cg for that? I only have a GeForce4 card... But how would I do this?
Quote:Original post by sjf
Quote:Original post by darookie
Quote:Original post by khaleelali
Also regarding the lights, any comments on that ?

OpenGL (and Direct3D as well) provide a fixed number of lights that are supported by the hardware (using the FF pipeline). Usually this number is limited to something like 8 or so. Now imagine having a set of particles that illuminate the scene - say a swarm of fireflies or a number of candles in a room.
While the number of lights in a shader (per pass) is only limited by its max instruction count, the FF pipeline limit is fix.
Yet another good reason for shaders is faking global illumination. While the FF only supports the "ambient light" hack, shaders provide you with the flexibility of choosing from a number of different more sophisticated hacks.


So how would I update my particle system so that each particle is a point source of light? Can I use cg for that? I only have a GeForce4 card... But how would I do this?



I have a GForce420 Go on my laptop and it doesn't support shaders. Nvidia's driver for gf4 doesn't support opengl 2.0, i tried running it get an error saying driver doesn't support it.
I could be wrong. you could go to www.nvidia.com and look up your card specs. If your card doesn't support shaders then you are limited to 8 lights in openGL since there is no light8 available.(you will get a compile time error)
As far as i know the way you would handle more than 8 lights in OpenGL is that you would write everything for lights in your shader code. OpenGL shading language is a book that tells you the code for it and i am using that. I have seen examples from that book all over the net. it is also called the orange book
GF4 only supports vertex shaders in GLSL. For Fragment Shader support in GLSL, atleast a GF FX is required.
first,
thanks for all the replies.
So far i have found that with shaders i can show that
1. per pixel lighting is simpler, even though opengl fixed pipeline does allow us to do it, it's a hassle(the code i have seen so far are really really complicated compared to the shader version)
2. blurring is simpler to do in shader(almost same reason as 1).
3. I am not restricted to 8 lights(need to multi pass to enable more lights in fixed pipeline).

i am still looking for something with textures. Was thinking maybe i do something with multitexture etc. any ideas?

if you have any other ideas please let me know i would appreciate it.
Thank you

This topic is closed to new replies.

Advertisement