Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Emit Particles From Texture with Colour.

Discussion in 'Visual Effect Graph' started by andyox66, Apr 17, 2020.

  1. andyox66


    Aug 27, 2015
    Hi, Is there a way of emitting particles from a mesh renderer, using the the colours from that mesh's material? In the standard particle system you can emit from a mesh renderer and assign a texture that is mapped to the particles using the objects UV.

    I can emit from a skinned mesh using Keijiro's skinned mesh baker, but can't work out how to colour the particles using a texture mapped to the mesh renderer UVs?
  2. VladVNeykov


    Unity Technologies

    Sep 16, 2016
    Hi, we are working on mesh sampling and skinned mesh sampling which will allow you to do just that.

    In the meantime, you can use the point cache bake tool (Window > Visual Effects > Utilities > Point Cache Bake Tool) and make sure you enable the UVs before you bake out the file:

    Then you can use the Point Cache operator, assing the position, and assign also the UVs somewhere (I'm being lazy here and am storing them in the Color attribute).
    Then use the stored UVs with a Sample Texture2D operator to get the colors you want from the UVs on that mesh and assign them properly now to the color attribute:

    Hope this helps!

    Attached Files:

    valarus and florianhanke like this.