Jump to content
  • Advertisement
Sign in to follow this  
Peetry

GLSL help

This topic is 2993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey peeps, can someone please tell me how i can access the 'world'/'model' matrix in a GLSL vertex shader? Are they the same thing? Sorry I'm new to this cheers

Share this post


Link to post
Share on other sites
Advertisement
In OpenGL 'World' is the same as 'View', so when accessing in GLSL for ex., gl_ModelViewProjectionMatrix, you could treat it as gl_ModelWorldProjectionMatrix =]

But you can't access Model or View seperatly inside GLSL... So there's only built-in variables like:
gl_ModelViewProjectionMatrix,
gl_ModelViewMatrix,
gl_ProjectionMatrix

But no - gl_ModelMatrix or gl_ViewMatrix

P.S and no - world (or view) and model isn't the same thing.

Share this post


Link to post
Share on other sites
As much as I don't want to become one of the depreciation harpies, you probably should not use the gl_whateverMatrix if you can avoid it. The proper way is to upload your own matrices via uniform.

I think there are a lot of common graphical effects that you need separate model, view, and projection matricies for, so it is best to learn the right way to do it if you can.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!