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 effects for "X-Ray" vision

Hello, I am trying to achieve an "X-Ray" vision effect very similar to that of Hunt: Showdown's, as it is in this video:

https://www.youtube.com/watch?v=J_DI25-hkiE

Shortly, what I want is a darkening of the whole screen by a controllable amount and a visible post-process effect generated around objects with a certain tag (such a player pawns). How would you achieve this?

Product Version: UE 4.20
Tags:
more ▼

asked Apr 30 '19 at 01:27 PM in Using UE4

avatar image

Heiko_Schmitz
11 1 1 3

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

1 answer: sort voted first

Hi Heiko,

first open project settings and under Rendering: Change the Custom Depth Stencil Pass like so (in the picture)

p2

secondly create a post process material like so:

p1

and so (avoid flickering):

alt text

Alternatively you can switch off temporal aa or aa in common to avoid flickering.

After that create a common level with light, place in a cube and change the cube's settings like so:

alt text

In the Details Panel you can activate the Custom Depth Render Pass and you can use a Stencil Value. The Stencil Value works like a tag.

Cheers

stencil1.png (49.6 kB)
stencil0.png (222.5 kB)
stencil01.png (5.6 kB)
stencil2.png (441.4 kB)
more ▼

answered May 02 '19 at 08:47 AM

avatar image

Raidfire.Net
677 62 54 118

avatar image Heiko_Schmitz May 05 '19 at 07:29 AM

Thanks, it works! However, I have no clue why it works. What exactly have you done in the material?

avatar image J-man1992 May 06 '19 at 04:39 PM

You should take a look at basic PP Mats, it´s quite simple. As a quickstart help: "SceneTexture PostProcess input 0" is just the Image before your PP Mat. The If statement switches between an Orange Color and the unaltered Scene image based on the Stencil ID at the current pixel compated to the Stencil ID you use to mask out your object.

The Mat says: If the Stencil ID at that pixel is the expected ID -> Pixel is Orange. Else -> Pixel is darker version of regular Pixel

avatar image Heiko_Schmitz May 06 '19 at 07:38 PM

Nice, this is very helpful!

avatar image Raidfire.Net May 06 '19 at 04:15 PM

Hi Heiko,

it would take long to explain everything in detail. You have to swallow the pill and learn post process materials.

Here is the doc to start with: https://docs.unrealengine.com/en-US/Engine/Rendering/PostProcessEffects/PostProcessMaterials

The only thing i can do is giving you the best tip for post process materials:

Everything that is developed within the post process material will be done per pixel and usually 60 times per second (60fps). Understanding that and you already have walked the half way.

avatar image Heiko_Schmitz May 06 '19 at 07:39 PM

That's fair, I will have a look at it, thanks.

(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