View previous topic :: View next topic |
Author |
Message |
Zylyx_
Joined: 05 Dec 2007 Posts: 111 Location: scotland, uk
|
Posted: Tue May 25, 2010 11:08 am Post subject: |
|
|
Cool, I'll keep that in mind. From what I know is that you cant render scene elements using the FFP and GLSL at the same time, but they have to change between them every frame. Anyways, I plan on using shaders pretty much 100% from now on. _________________ ....noodle... |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Tue May 25, 2010 8:43 pm Post subject: |
|
|
You can change shader (or disable it) as often as you can change texture (or disable it). You can draw one model using fixed-function rendering, another model using a shader, and another using a different shader in the same scene. You can even draw a model in several passes, one using fixed-function and another using a shader. This is where ftransform() comes in. You want to make sure that the shader calculates the depth value for a fragment the same way the fixed-function pipeline does. The FFP will probably be doing something slightly different than "gl_ModelViewProjectionMatrix * gl_Vertex", probably something a little optimized or whatever, and ftransform() emulates that exactly. So if you don't use ftransform() you'll end up with a model horribly "depth-fighting" itself. (You could try it to see, it's very obvious.)
Of course, nowadays a next-gen game is supposed to use shaders for everything as drivers hope to obsolete the fixed-function pipeline completely. If you are doing 100% shaders then you can use "gl_ModelViewProjectionMatrix * gl_Vertex" or whatever else (as I understand it "ftransform" will be obsoleted in the future as well in OpenGL 3/4/5/whatever). _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|