Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

GLSL Shared View Matrix

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1 TRONJon   Members   

236
Like
0Likes
Like

Posted 15 April 2014 - 06:07 AM

I'm upgrading all of my OpenGL code to support the newer specifications, as a result I don't want to use the standard matrices in my GLSL code, such as gl_ModelViewMatrix or gl_ModelViewProjectionMatrix.. I wish to use my own matrices, except the problem I see is I'm using many shaders in my engine. It would be counter productive to upload a seperate set of uniform view matrices to every shader therefore I would need to have shared matrices.

 

I know about Uniform Buffer Objects and Uniform Blocks... but have not use them yet, are these the only way of sharing data between different shaders? I'm just looking for someone with experience to shed some light on the subject.

 

Many thanks, Jon.



#2 RobTheBloke   Members   

2552
Like
2Likes
Like

Posted 15 April 2014 - 06:44 AM

Uniform blocks are pretty much the best bet. 



#3 mhagain   Members   

13162
Like
2Likes
Like

Posted 15 April 2014 - 06:56 AM

Unfortunately you can't do this with GLSL and standalone uniforms.  Like RobTheBloke said, use a uniform block: you'll probably find that you've got a bunch of other data that never changes or changes relatively infrequently (once per frame) which it also makes sense to put in there (maybe lightstyle values, view vectors for billboarding, etc).


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 TRONJon   Members   

236
Like
0Likes
Like

Posted 15 April 2014 - 04:23 PM

Fantastic, thanks guys! :)



#5 Irlan Robson   Members   

4056
Like
0Likes
Like

Posted 23 April 2014 - 06:52 AM

UBO.

http://www.opengl.org/wiki/Main_Page






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.