Inside3D!
     

GLSL noob problem...
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> OpenGL Programming
View previous topic :: View next topic  
Author Message
Zylyx_



Joined: 05 Dec 2007
Posts: 111
Location: scotland, uk

PostPosted: Tue May 25, 2010 11:08 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Tue May 25, 2010 8:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> OpenGL Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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