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"

Post Process Material: Occlusion Detection

Hi everybody,

i have written an easy pp material to get occluded pixel and put them in a mask.

But somehow it is wrong or i do not get it.

Thats the logic:

alt text

Thats the result (Objects are rendered in custom depth):

alt text

What i expected, is that there should only be white where the soldier is occluded from the box.

Can anyone give me the right kick. I do not get it :D

Thanks in advance

raidfire.net

Product Version: UE 4.13
Tags:
occ_graph.jpg (54.4 kB)
occ_render.jpg (15.1 kB)
more ▼

asked Oct 22 '16 at 12:26 PM in Rendering

avatar image

Raidfire.Net
677 62 54 118

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

1 answer: sort voted first

Unfortunately, custom depth is a single pass. It stores depth for all enabled meshes. The only way is to set custom depth enable for one mesh, and not set it for another, then proceed to a depth tests.

http://www.tomlooman.com/the-many-uses-of-custom-depth-in-unreal-4/

For many objects may be used a custom stencil buffer, but as custom depth it only stores one pass (all of the meshes on single image with different colors, i.e. no overlapping).

http://www.tomlooman.com/multi-color-outline-post-process-in-unreal-engine-4/

In Your example You just subtracting A from A, which leads to 0 (black).

more ▼

answered Oct 22 '16 at 01:33 PM

avatar image

S-ed
1.4k 27 24 48

avatar image Raidfire.Net Oct 22 '16 at 04:14 PM

Hi thanks for the fast reply. Not usual at weekend :D

It seems that the marketplace outline assets works with multiple occlusion detection. Is there a solution for this? Stencil is not what i need. I need a sort of mask to catch all occluded pixels from objects with custom depth enabled.

Best would be within the pp material. There is another solution, but for this i have to put a routine in every material that are used for custom depth objects.

Thanks in advance

avatar image S-ed Oct 22 '16 at 04:22 PM

They are not (I haven't tested them all, but sure for 99%). I guess all of them are based on this:

http://www.tomlooman.com/ue4-outline-post-process/

and as You could see occluded objects only have one channel (yellow does not overlap red one):

Outline

avatar image Raidfire.Net Oct 22 '16 at 06:11 PM

I have played around a little bit and now i have what i wanted :D

Maybe we talked past each other.

This is the result that i wanted. Now i can query the stencils to get different looks

alt text

avatar image S-ed Oct 22 '16 at 06:55 PM

Oh, I thought You need more advanced version of this, like two masked objects to intersect. Sorry. Glad You've figured it out.

(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