Jump to content
  • Advertisement
Sign in to follow this  

Directx10 shader pools example question

This topic is 3410 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

I am trying to implement shader pools into my project and I am following the example that comes with the DX10 SDK. My question has to do with the shared buffers - here is the example given in the SDK. shared cbuffer cbShared { float3 g_LightDir; // Light's direction in world space float4 g_LightDiffuse; // Light's diffuse color float4x4 g_mViewProj; // View * Projection matrix float g_TexMove; // random variable that offsets the V texcoord }; Now lets say I am sharing this buffer between 3 shaders and lets say that the third shader does not use the g_LightDir and the g_LightDiffuse variables. Could this cause any problems? Or is it ok to share variables that will not be used in all shaders? EDIT: Also do you have to bind shared variables to each effect each time a new one is activated? Or is there a way to globally bind them just a single time? Thanks in advance [Edited by - FoxMulder900 on January 21, 2009 3:09:16 PM]

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!