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"

Access Stencil Buffer on non-translucent materials

I'm working on a stencil effect where a portion of an object can be "cut out" using another object as reference. alt text

To do this I have the floor set up as a translucent material which tests the stencil value in the CustomStencil scene texture to determine it's opacity.

The stencil buffer looks like this: alt text

My current goal is to get this to work with a non-translucent material. I can't do this right now because non-translucent materials don't have access to the custom depth buffer / stencil values.

Basically what I'd like to do is render all of the "Portals" (in this case a cube) to the stencil buffer (value = 1). Then in the next pass render all of the "Blockers" (in this case the floor) the the stencil buffer (value = 2). Then render the "Blockers" in the main pass while obeying the rule value == 2. Then render the rest of the main pass.

I'm not sure where to start with this approach, any ideas?

Product Version: UE 4.10
Tags:
more ▼

asked Dec 24 '15 at 01:10 AM in Rendering

avatar image

ZakBlystone
126 3 6 12

avatar image DennG May 11 '16 at 07:25 AM

did you find a solution?

avatar image OptionalSteve Mar 07 '17 at 06:39 AM

Can you provide more detail or point me to a resource on how you accomplished the effect in your translucent material?

avatar image raisedbywoes May 09 '17 at 09:24 PM

Were you ever able to solve this? I've been able to recreate using the a translucent material but it's not desirable given the expense and limitations of that.

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

2 answers: sort voted first

It's recomme

more ▼

answered Dec 05 '17 at 09:20 PM

avatar image

Gabe_F
1

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

It's recommended you render another copy of the mesh. The other copy should have a fully opaque material, under render settings deselect render in main path and turn on render is custom render buffer. Then you can use that data for your needs either in the shader or as a postprocess.

more ▼

answered Dec 05 '17 at 09:23 PM

avatar image

Gabe_F
1

(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