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"

How to discard pixel in material editor?

Can't find node for discarding pixels

Product Version: UE 4.15
Tags:
more ▼

asked May 09 '17 at 04:46 AM in Rendering

avatar image

laggyluk
111 13 18 29

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

3 answers: sort voted first

I think there in no such node.

How do you want to do that?

To remove pixels in some area just lerp them by mask of that area and multiply on 0.

To remove pixels by it's color use IF node.

more ▼

answered May 09 '17 at 05:32 AM

avatar image

redbox
4.2k 80 17 103

avatar image laggyluk May 09 '17 at 01:38 PM

Well, this command is available in GLSL and in HLSL so thought it's just named differently

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

answered May 09 '17 at 03:31 PM

avatar image

redbox
4.2k 80 17 103

avatar image laggyluk May 09 '17 at 05:23 PM

tried it, results in error

avatar image Deathrey May 09 '17 at 06:52 PM

At this time it is not possible to discard a pixel from material editor, at least not for all shading models. You would need to modify shader files for that.

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

As @deathrey suggests, there does not seem to be a way to do the direct discard you are used to from glsl/hlsl. However, you can set the material blend mode to masked. This allows you to supply an Opacity Mask. Setting this to 0 for specific pixels is essentially equivalent to a discard, only it itegrates well with the rest of the rendering pipeline, for example by throwing correct shadows (which a discard would not do in many cases).

https://docs.unrealengine.com/en-us/Resources/ContentExamples/MaterialNodes/1_8

more ▼

answered Feb 20 '19 at 07:30 PM

avatar image

TheHugeManatee
1 1 3

(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