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"

Is it possible to set visibility of a single instance of an instanced static mesh component?

So I currently have an angled "top down" game where occasionally, I might have an object or two in between the camera and the player. Seeing as how this might be problematic sometimes, I did something similar to this to set individual components visibility when they block the view. However, for performance reasons, I'm using "instanced static meshes" and when a single component's visibility is set, all instanced mesh's visibilty are also set.

Is there a way to set the visibility of a single instance of an instanced static mesh component?

Product Version: UE 4.9
Tags:
more ▼

asked Jan 22 '16 at 01:59 AM in Using UE4

avatar image

thecomediclife
21 4 8 12

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

3 answers: sort voted first

This is an old one, but just set the scale of that instance to zero. easiest way to make it not render without needing to change materials and what not.

more ▼

answered Mar 17 '16 at 07:07 PM

avatar image

TheSpaceMan
21 1 2 5

avatar image loh0123 Jul 28 '17 at 09:48 AM

nice ideal

avatar image Nightmask3 Sep 26 '17 at 12:40 AM

this is a really neat idea and something I'm going to use, thanks!

avatar image Dashlight 3D Aug 21 '18 at 09:36 PM

Very good tip, thanks a million man, you saved me a lot of code!

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

Instanced Static Meshes are basically one single big mesh so unfortunately no. What I personally did was create a material that turns transparent (Masked material + DitherTemporalAA) when it "intersects" the camera vector.

more ▼

answered Jan 22 '16 at 02:13 AM

avatar image

DamirH
589 22 22 41

avatar image thecomediclife Jan 22 '16 at 02:15 AM

Could you elaborate a little for me? Would it then be possible to set the material of a single instance in an instanced mesh? I've considered this idea, but I couldn't figure it out.

avatar image DamirH Jan 22 '16 at 02:20 AM

The material is one and the same, but since it takes the camera position and direction to create a "cylinder" mask, only the instances actually close to the camera would be affected. Thing is though it's done PER-PIXEL, not PER-INSTANCE. Ends up looking good enough though.

avatar image thecomediclife Jan 22 '16 at 02:22 AM

That sounds amazing. I've never heard of such a thing. Do you have any link where I can read up on how to do this myself or watch a tutorial on how to do this? I'd google it myself, but I'm not sure what to even search for, considering I've never heard of this before.

avatar image DamirH Jan 22 '16 at 02:41 AM

Unfortunately it's all home-made and not public. :( But it's really not difficult to do. Look up some math on point-to-line distance, where your point is your Absolute World Location and the line is the camera vector. If the distance is below a certain threshold, you set opacity mask accordingly.

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

Not sure if this is still an issue. But this is now possible. Take a look at my blueprint below to check it out. You can also set a different mesh all together in a place in the mesh. I set LoctionX to 0 to start with and PannelSize I have set at 245 but that can be configured to match a mesh of your choosing.

alt text alt text alt text alt text

part1.png (185.6 kB)
part2.png (122.9 kB)
part3.png (74.1 kB)
viewport.png (241.7 kB)
more ▼

answered Mar 11 '16 at 02:22 AM

avatar image

jman2015
24 8 14 13

avatar image Zirrad Apr 27 '16 at 08:17 PM

That's what I tried, but unfortunately it's not working how I hoped it would work.

As you have it set up, you've created multiple "instancedStaticMeshComponents" each with only one attached instance. (and there's a limit of the # of instances you can have, something like 10 - check the output log)

As far as I understand, every instance shares the properties of the render component. So you need one instanced component for each group of similar looking meshes.

The transform seems to work on each instance, so perhaps the "scale to 0" approach might work to make one instance invisible

(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