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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Sphere Mask on each instance of an Instanced Static Mesh

I'm trying to build instanced static mesh billboards for my project, but am having trouble getting the lighting and opacity masking correct. The billboards should just represent spheres, so I wanted to apply a sphere mask to each instance, but when I use the mask, it seems like only one is showing up in the game (as opposed to one per instance). The closest post I found that relates to my issue is this one: https://answers.unrealengine.com/questions/484539/foliage-instance-position-in-material-editor.html.

But I don't quite understand how to implement the response.

To get the billboard effect, I just reused example 2.20 in the Math Hall (https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/MathHall/index.html) and replaced the "Actor Position" node with "Object Pivot Point". Here's the material blueprint I have so far:


How can I modify this further to apply a sphere mask to each of my instanced meshes? Any help is appreciated!

Product Version: UE 4.16
more ▼

asked Jun 12 '17 at 06:49 PM in Rendering

avatar image

1 3 4

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

1 answer: sort voted first

Instance position in worldspace is retrievable like this: alt text I believe that you can also use vertex interpolator node as 4.16 for a more tidy look, but I haven't tested it.

more ▼

answered Jun 12 '17 at 07:50 PM

avatar image

7.8k 130 31 292

avatar image KeijiBranshi Jun 12 '17 at 09:46 PM

Thanks! I tried to implement what's in the picture you provided and I managed to get the sphere mask to appear, however it only shows up at the origin (where my instanced mesh actor is located). Is there a way to get the sphere mask to apply to every instance of that mesh?

Here's my current material setup: sphere_billboard.png

avatar image KeijiBranshi Jun 12 '17 at 10:53 PM

Wait..realized what I did wrong. Changed my TexCoord[2] and TexCoord[3] to TextCoord[0] and TexCoord[1] (to match the customized UVs). As you can tell, I don't quite know how custom UVs work -_-. Thanks so much for your help!

My next issue is that the sphere mask is centered at the bottom center of the billboard. I would like to either place it at the billboard's center, or shift the billboard down by half its height. Does anyone know how I can do that?

avatar image Deathrey Jun 13 '17 at 03:54 PM

Does anyone know how I can do that?

Required offset from the pivot should go into the (0,0,0), that you are transforming from local to world.

avatar image KeijiBranshi Jun 13 '17 at 06:51 PM

Thanks! I tried shifting it along the z-axis by the half-width of the billboard. Now the full sphere shows up, but only if I'm looking at it straight on (from the same height). If I change the angle from above/below that I view the billboard, the sphere shrinks. I think this is because the billboard is still pivoting around its bottom center, while the sphere mask just floats (0,0,half-width) above the pivot point in world space. Here are some images to better explain what I'm getting:

alt text alt text alt text

Do you know how I could fix this? I think I either need to have the sphere mask follow the center of the billboard, or change the pivot point of the billboard.

And again, thanks so much for your help!

(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