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"

StaticMesh visible only through material.

Hello all, I want to have my static mesh show only through a material. I got the idea that I will need to use depth buffer / custom stencil, and I feel that it should be straightforward ... but I can't find any good resources.

In my mind it should go like : I make a mask in screen space from the plane, I use the mask to show/hide the static mesh. I don't even know where to start in UE4 to implement that effect.

Those anyone has any ideas ?!

alt text

Product Version: UE 4.19
Tags:
screenshot-460.png (61.5 kB)
more ▼

asked Nov 04 '18 at 09:01 AM in Rendering

avatar image

Theblacktiger
103 8 12 14

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

2 answers: sort voted first
  1. Assign an DepthStencil ID to the Plane Mesh via it´s properties.

  2. Then, Create a new material for the "A"and set it to Translucent.

  3. Then you connect the following to your materials Opacity Output:

  4. Choose the Stencil Value of your plane as the Value for the "Bit" input.

  5. Place the plane and the A next to each other and assign the material to the A. It will now be invisible unless the plane is behind it.

stencilmask.png (66.7 kB)
more ▼

answered Nov 04 '18 at 11:52 AM

avatar image

J-man1992
125 5 12 16

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

Works well indeed. However, the material loose the shading and look flat.

Thanks you anyway, was a clear answer.

more ▼

answered Nov 04 '18 at 02:08 PM

avatar image

Theblacktiger
103 8 12 14

(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