Skip to main content
Commonmark migration
Source Link

I am currently working on making a realistic grass shader in blender, but there's one thing I'm stuck on. I made a few different variations of textures in substance designer to make some of the grass blades look dead or discolored. I split the grass up into multiple particle effects each with a different texture, and while it looks okay, it's too inefficient for me since I already use multiple particle effects each with different object counts and size/rotation settings, so it becomes noticeable that each texture variant is applied to a different particle layer. You can see what I mean here:

[![enter image description here][1]][1]enter image description here

I have never found any resource online that can show me how assign a different texture based on particle index, so I spent some time messing around and got this as my node setup. I divided by 15000 (number of particles in my test layer) to get a value from 0-1, then rounded it to a whole number.

[![enter image description here][2]][2]enter image description here

...And to my surprise it works! But not really. You can see in my test render (I used a solid red and blue texture so I can visualize it better) that the texture variation is split down the middle of my render. I did not know this how particle index works.

[![enter image description here][3]][3]enter image description here

So basically what I'm getting at is I need to know either: how can I randomize particle index distribution, or is there a better way altogether to do this? I should also mention that in my particle settings under "Emission" I have the "Random" box ticked.

[1]: https://i.sstatic.net/zOLPa.jpg [2]: https://i.sstatic.net/WOzAG.png [3]: https://i.sstatic.net/aZ4cH.jpg

I am currently working on making a realistic grass shader in blender, but there's one thing I'm stuck on. I made a few different variations of textures in substance designer to make some of the grass blades look dead or discolored. I split the grass up into multiple particle effects each with a different texture, and while it looks okay, it's too inefficient for me since I already use multiple particle effects each with different object counts and size/rotation settings, so it becomes noticeable that each texture variant is applied to a different particle layer. You can see what I mean here:

[![enter image description here][1]][1]

I have never found any resource online that can show me how assign a different texture based on particle index, so I spent some time messing around and got this as my node setup. I divided by 15000 (number of particles in my test layer) to get a value from 0-1, then rounded it to a whole number.

[![enter image description here][2]][2]

...And to my surprise it works! But not really. You can see in my test render (I used a solid red and blue texture so I can visualize it better) that the texture variation is split down the middle of my render. I did not know this how particle index works.

[![enter image description here][3]][3]

So basically what I'm getting at is I need to know either: how can I randomize particle index distribution, or is there a better way altogether to do this? I should also mention that in my particle settings under "Emission" I have the "Random" box ticked.

[1]: https://i.sstatic.net/zOLPa.jpg [2]: https://i.sstatic.net/WOzAG.png [3]: https://i.sstatic.net/aZ4cH.jpg

I am currently working on making a realistic grass shader in blender, but there's one thing I'm stuck on. I made a few different variations of textures in substance designer to make some of the grass blades look dead or discolored. I split the grass up into multiple particle effects each with a different texture, and while it looks okay, it's too inefficient for me since I already use multiple particle effects each with different object counts and size/rotation settings, so it becomes noticeable that each texture variant is applied to a different particle layer. You can see what I mean here:

enter image description here

I have never found any resource online that can show me how assign a different texture based on particle index, so I spent some time messing around and got this as my node setup. I divided by 15000 (number of particles in my test layer) to get a value from 0-1, then rounded it to a whole number.

enter image description here

...And to my surprise it works! But not really. You can see in my test render (I used a solid red and blue texture so I can visualize it better) that the texture variation is split down the middle of my render. I did not know this how particle index works.

enter image description here

So basically what I'm getting at is I need to know either: how can I randomize particle index distribution, or is there a better way altogether to do this? I should also mention that in my particle settings under "Emission" I have the "Random" box ticked.

Bumped by Community user
Bumped by Community user
Tweeted twitter.com/StackBlender/status/1028159466053754882
Bumped by Community user
edited title
Link
Ray Mairlot
  • 29.4k
  • 12
  • 105
  • 126

How can I assign a different image texture per particle? [Solved]

edited title; edited title
Link
jkofskie
  • 195
  • 1
  • 9

How can I assign a different image texture per particle? [Solved]

added 132 characters in body; edited body
Source Link
jkofskie
  • 195
  • 1
  • 9
Loading
added 100 characters in body
Source Link
jkofskie
  • 195
  • 1
  • 9
Loading
Source Link
jkofskie
  • 195
  • 1
  • 9
Loading