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"

Extract Shadows and use as Mask

Hey so i'm trying to figure out how i can extract the shaded part of a object and use it as a mask to lerp between two textures. So when it's in darkness it uses one texture and when it's in light it uses another texture.

Anyone have any idea how i could do this? Thanks.

Product Version: UE 4.14
Tags:
more ▼

asked Jan 29 '17 at 03:15 PM in Rendering

avatar image

RossenX
63 9 12 16

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

2 answers: sort voted first

Shortly speaking, you can't do that. There is no shadow information at stage where your material is being processed.

A typical workaround is to render a depth capture into a render target from your light's perspective, and use it in object's material to determine if this part is shadowed or not, though this is a bit more advanced.

more ▼

answered Jan 29 '17 at 09:05 PM

avatar image

Deathrey
7.9k 130 31 295

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

Hm, not sure if this would solve your problem but you might be able to use the "PrecomputedAOMask" node in the material editor. This would allow you to mask out your shaded areas with other textures using the scene's AO. But this would require lightmaps and would not work on anything movable.

To use this, you first need to enable "Use Ambient Occlusion" and " Generate Ambient Occlusion Material Mask" in the World settings before adding the node to your material.

more ▼

answered Mar 17 '17 at 01:40 PM

avatar image

Uddebo
1

avatar image RossenX Mar 22 '17 at 05:42 AM

Hm interesting. Thanks for letting me know this is a step in the right direction! :o

(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