Jump to content

Allow shaders to embed texture parameter names


JedTheKrampus
 Share

Recommended Posts

When you want to add a texture parameter to a shader, there's no way to tell in the material editor which texture goes to which shader parameter without reading the code. The material editor should look at the shader code and look for comments on the same line that the sampler2D is declared. It could then take the name in that comment and put it in the material editor.

 

Pretty simple feature, right? If you want to make it so that people didn't name a sampler2D in the material editor unintentionally, you could make it so that it requires syntax like:

 

uniform sampler2D texture5; // @name Specular Power

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...