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"

Get Custom Depth Between Two Intersecting Meshes (Post Processing)

Hi All,

I need to do a post processing effect in which I render an outline between objects overlapping relative to the camera view. Please see the image attached below for an example of what I mean...

I have the stroke and masking using custom depth working no problem. I assumed I would be able to use the stencil buffer to detect overlapping parts of the image, however now it appears to me that the stencil buffer is masking a single depth pass, rather than (what I assumed) a depth pass per stencil channel...
Is there really no way to achieve this?! I assumed it was going to be possible and now I've progressed quite far with the project @_@

Any thoughts, advice or leads very appreciated.

Cheers, Jimmy

alt text

Product Version: UE 4.20
Tags:
strokeexample.jpg (84.5 kB)
more ▼

asked Nov 15 '18 at 06:54 PM in Blueprint Scripting

avatar image

troydSPAMBOT3000
36 1 6 10

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

1 answer: sort voted first

Render figure into custom depth. Use separate mesh with outline material that has depth test disabled. Set opacity to 1 only if pixel depth is greater than custom depth.

more ▼

answered Nov 15 '18 at 08:58 PM

avatar image

Deathrey
7.9k 130 31 293

avatar image troydSPAMBOT3000 Nov 16 '18 at 04:20 PM

Hi Deathrey. I'm sorry but I don't fully understand, but I do think you're onto something.

separate mesh with outline material

The outline is achieved via post processing. This is ideal as I want the lines to remain same thickness no matter how close/far. Is this still compatible with your solution? perhaps something using stencils?
avatar image troydSPAMBOT3000 Nov 19 '18 at 08:58 PM

@Deathrey so I followed your advice and I think ive done it correctly? However the issue here is now the outline information is opaque. If I can somehow write to an invisible channel so that this outline mesh is then not visible in render, but used for a post process sobel operation, that would be perfect! however cant find a way to do this...

alt text

shadermadness.jpg (92.6 kB)
avatar image troydSPAMBOT3000 Nov 19 '18 at 09:02 PM

Actually, come to think about it, even with what I mentioned above this still has a problem... See the original image above how there is a third person with an entire outline? this method will result in a continous blobby outline for everything it intersects @_@

(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