Jump to content

Custom Shader - Access properties of mesh it's been applied too?


Xeonzinc
 Share

Recommended Posts

Hi,

 

I'm having a lot of fun working with the shaders, the tutorials around here are great! I'm stuck what I'm hoping is a simple problem

 

• I have a X number of meshes (all the same), but each also contains a variable (say an integer from 1-100)

• Currently i can create X versions of the material (passing the variable in the material constructor) - which then displays the texture differently on each object

 

 

• I'm trying to create a single material which can take a property of the mesh it's applied to (and therefore only ever need to create one version of the material instead of X)

 

I imagine this must be possible as the shader is already getting the position etc... of the mesh it is applied to, I just want to access another single variable, but have no idea how!

 

Thanks,

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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...