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"

Can instanced static meshes have different texture properties ?

Hello,

Is it possible to modify the texturing of instanced static meshes per object ?

More precisely, i have tried to modify the texture tiling of differents instanced static meshes, but i end up with always the same tiling for all of them.

I can modify their geometry though (scale, location, rotation).

Is there a way to get (instanced) meshes with different texture coordinate properties, or is this an unavoidable consequence of using instanced meshes ?

Thanks

Cedric

Product Version: Not Selected
Tags:
more ▼

asked May 04 '15 at 09:14 AM in C++ Programming

avatar image

uced
850 75 89 360

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

As far as I am aware, No. However you could see about just using multiple Instanced Static Mesh components and changing the textures on them. Not as good as 1 ISM but still better than 100s of normal static meshes.

The point of an ISM is that they are all using the same rendering data to expedite the process by not needing to clear the information on the GPU between each mesh rendered. It basically say "ok, I have my mesh and texture data, and then I just need to clear my transform data as I do this 100 times."

What your asking to do would require it to recalculate the texture to be applying between rendering, which is the highest memory cost (usually).

Sorry I dont have a better answer for you, but hope you also understand ISM a little better.

more ▼

answered Nov 12 '15 at 07:52 PM

avatar image

NoahTimefireVR
535 16 11 37

avatar image uced Nov 13 '15 at 04:13 PM

I thought it was something like that but wasn't sure, thank you very much for the detailed explanations.

Cedric

avatar image muchcharles May 01 '17 at 10:19 AM

May an infinitesimal change to the object's scale and use that to select between different properties. Basically drive properties by encoding a small selector into the the scale values.

avatar image Bonepower May 31 '17 at 05:54 AM

I have a similar problem and this sounds like a perfect solution for me. However I can't get a hold of the per instance scale. There is an object scale node in the material editor but it returns the scale of the instanced mesh component not the scale of the actual instances. Do you know how I get the scale of the instances in the material editor?

avatar image GlassBeaver Jun 11 '17 at 04:00 PM

@Bonepower, call the GetInstanceTransform function on the (hierarchical) instanced static mesh component

avatar image GlassBeaver Jun 11 '17 at 04:05 PM

@muchcharles, can you explain how you'd make the material take the object's scale to alter its parameters?

avatar image muchcharles Jul 12 '17 at 04:09 AM

Hi, I ended up needing this and looked into it further.

I think scale is only easily available for instanced foliage. In the perinstancedata there is a transform matrix that you could get scale from with the custom material node and some math, but I found an easier way: modify the code so that the value of "PerInstanceRandom" can be manually set instead of generated from a random seed.

Then you can just pass your data directly in. PerInstanceRandom is one component of a halt4, so it is a half-precision float. You should be able to have around 2048 unique integers to encode things with without much work.

The initialization from a random seed is done in: FStaticMeshInstanceBuffer::Init

(edit: searching around, this guy did the same thing and posted an implementation, he also has some caveats on using the float: https://answers.unrealengine.com/questions/502169/customise-uvs-per-instance-with-instanced-static-m.html )

avatar image HelloEnjoy Oct 30 '18 at 01:07 AM

"TransformLocalVectorToWorld should return you per instance transformed position, but only if used in vertex frequency shader" https://answers.unrealengine.com/questions/469664/material-local-space-and-instanced-static-meshes.html

(comments are locked)
10|2000 characters needed characters left
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