View Full Version : Shader loading with multiple viewports
08-05-2010, 07:38 AM
We are reloading shader programs for each viewport have on our application bui is it really necessary?
Can shader programs be shared by all viewports of the same application?
08-05-2010, 09:09 AM
What API are you using? I believe it's possible, but you might need to do a couple things to make sure they are all sharing the same context. I believe JOGL and Qt, for example, have controls for this, but GLUT does not.
08-05-2010, 01:14 PM
Ah, therefore generally you need to load the same shader program 4 times if you have 4 opengl viewports...
I thought I was doing something wrong.
08-05-2010, 01:56 PM
wglShareContext and such should avoid reloading separately for each window.
08-05-2010, 05:25 PM
No, not generally. I'm saying that sharing that across windows requires some additional setup outside of OpenGL, which is different for each windowing library you're using. It's usually not hard. It's just specific to the windowing library. GLUT is one that doesn't support sharing, as far as I know.
08-06-2010, 01:33 AM
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.