Forumchem - Forum with AI(ALICE BOT & HAL9000) and TTS

More dificult for us, more easy for you
It is currently Thu Apr 25, 2024 11:13 am

All times are UTC





Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 
Author Message
 Post subject: opengl frequently swapping between two shaders - stack overf
PostPosted: Sun Nov 10, 2013 6:22 am 
Offline
User avatar

Joined: Fri Apr 03, 2009 1:31 am
Posts: 1357
opengl frequently swapping between two shaders - stack overflow

I have a situation where I have two particular shaders:



The first shader casts shadows from all objects in a scene and renders to a single fullscreen 8 bit shadow texture. The glsl code is very concise.



The second shader performs deferred lighting calculations onto the g-buffer and renders to a single full screen 32bit texture buffer. It uses several full screen textures (32bit position, 16bit normal, 32bit disseminate, 8bit specular, 8bit shadow). The glsl code is also quite verbose.



As you can see, for each light, these two shaders must execute subsequently. A then B, A then B, A then B. This results in a lot of swapping.



Ive read that shader swapping has some high relative overhead, but im unfamiliar with how a GPU would bargain with swapping between only two shaders.



Will the two shader programs be cached effectively enough that this shouldnt be a problem?



Should I mix the two shaders and direct the output using glDrawBuffers()? If I mix them, the 5 textures that are loaded from the previous g-buffer illumination stage would be left stale for the next shadow casting stage, would this cause any performance overhead?










Source



Top
 Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


 
Search for:
 
Jump to:  

cron
Click me:
Powered by phpBB © 2000, 2002, 2005, 2007, 2008, 2009 phpBB Group
Chronicles phpBB3 theme by Jakob Persson. Stone textures by Patty Herford.
With special thanks to RuneVillage

This site have 4 type of tecnology in order to convert text to speech. By default you use the vozme tecnology. In order to know the other you need to sign for.


- Privacy Policy -