x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Feature Request] Instance Index for Instanced Static Mesh in the Material Editor

Hey,

I would like to have access for the instance index for instanced static meshes in the material editor.

I think it would provide more information about the instanced static mesh data, also you can generate a random number in a shader from this information. So you don't actually need the RandomNumber in the instaced static mesh.

My current problem with the Per instance random is that it generates a new random number everytime i remove or add a new instance.

Also an Instance World Location node would be also helpful.

Product Version: UE 4.13
Tags:
more ▼

asked Oct 05 '16 at 11:52 AM in Everything Else

avatar image

Azarus
1.9k 60 50 189

avatar image Azarus Dec 05 '16 at 04:57 PM

Hello hello Epic :C

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I don't recall running into need of having instance ID in material, but yeah generally I would prefer having something else instead of per-instance fade amount, so upvoted and signed :)

As for instance position, last time I checked, there was InstanceLocalToWorld transform matrix for instanced meshes. If I remember correctly, Object Position node OR (0,0,0) chained to TransformPosition LocaTtoWorld node should give you per-instance world position, if they are used in vertex frequency shader. You could try passing it via custom UV.

more ▼

answered Oct 05 '16 at 05:14 PM

avatar image

Deathrey
7.8k 130 30 292

avatar image Azarus Oct 26 '16 at 02:51 PM

For audio visualization purposes it's good to have the instance index, so you can feed the frequency data into a material collection and play with the mesh scale from the shader. So it gives you a great performance boost. Also if you really need a random number you can really do it in a shader. The other problem with the per instance random is that it regenerates a completely new one for each instance when an instance is removed. So it's not really useless for instanced static meshes where you need to remove some bubbles

avatar image Azarus Dec 16 '16 at 02:57 AM

Also please since your answer is actually not answering the issue you shouldn't set it as an answer to the question :P

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question