Flexman Posted May 12, 2011 Share Posted May 12, 2011 Leadwerks engine has a number of built-in uniforms to pass values into shaders. I propose adding a couple of extra uniforms for developer use to pass game values into shaders more easily. Rather than having to scan *all* loaded materials to pass uniforms to them (not trivial as there isn't a publicly accessible list of loaded materials or shaders) it would be very handy to have a few UserData uniforms, much like entities have UserData keys. Only a few would be needed and can't add much more overhead than the existing Leadwerks uniforms. userDataVec4 userDataVec3 userDataVec2 userDataFloat userDataInt Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Josh Posted May 12, 2011 Share Posted May 12, 2011 You can safely pass uniforms that don't exist, so you can declare these in whatever shaders you need, and set them from your program without worry. Or are you saying you want these to be global values the user sets, that all shaders access? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Flexman Posted May 12, 2011 Author Share Posted May 12, 2011 Yes, global values so they can be accessed by all shaders like the existing ones listed on the wiki here http://www.leadwerks.com/wiki/index.php?title=Shaders That would make it easier to apply some effect to many entities that don't share the same shader, or globally change a co-ordinate system. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
VeTaL Posted May 15, 2011 Share Posted May 15, 2011 Or are you saying you want these to be global values the user sets, that all shaders access? I'm also interested in this. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
VeTaL Posted May 15, 2011 Share Posted May 15, 2011 Something like SetGlobalShaderVariableVec3("WindSpeed", Vec3(5, 0, 10)). Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Flexman Posted May 15, 2011 Author Share Posted May 15, 2011 Something like SetGlobalShaderVariableVec3("WindSpeed", Vec3(5, 0, 10)). Yes, that would be perfect. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.