Jump to content

userData Uniforms


Flexman
 Share

Recommended Posts

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

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

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?

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

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.

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...