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"

Self-Shadowing Materials

I am attempting to create a material that self shadows. It's a brick wall and it uses bump offset for parallax. The one thing it is missing it self shadowing bricks. I couldn't find any resources on it except an old UDK/UE3 tutorial which I tried: http://oliverm-h.blogspot.de/2012/09/how-to-create-self-shadowing-materials.html

When I plug it all in though I get this message: "Error [SM5] (Node LightVector) LightVector can only be used in LightFunction or DeferredDecal materials"

The self shadowing part of my material is exactly like his, but here is an image anyway: http://grab.by/zBMc

Since we can't use the light vector node like this anymore, does anyone have any idea how to achieve these same results? Any help is appreciated.

Product Version: Not Selected
Tags:
more ▼

asked Aug 20 '14 at 04:00 AM in Rendering

avatar image

joshezzell
111 17 24 30

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

1 answer: sort voted first

Hey joshezzell -

You can achieve this effect but it can be costly from a performance standpoint becuase you are having to create a dynamic material instance for the object you want to use that calls for the forward vector of a light actor. The material setup is exactly as in UDK with the exception of changing the Light Vector to a Vector Parameter which we adjust in a blueprint. In the blueprint I run a check for a specific type of light (in my case spotlight) and find the closest then get its forward vector.

Material:

Material

Blueprint:

BP

Hope this gets you started -

Eric Ketchum

self-shadow.jpg (246.6 kB)
self-shadowbp.jpg (350.8 kB)
more ▼

answered Aug 22 '14 at 06:41 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 256 733

avatar image Lovecraft_K ♦♦ STAFF Aug 22 '14 at 06:41 PM

And here is the final render:

Final

avatar image joshezzell Aug 23 '14 at 03:28 AM

I appreciate the help.

I put together the material and the blueprint, but I am not getting any results. Here is the blueprint: http://grab.by/zIBc

Blueprinting isn't my forte, so you will have to bare with me.

avatar image mindfane Aug 23 '14 at 03:56 AM

@Eric Ketchum

The method given by you, it seems to me that we should manually specify the light source as a parameter in the Material. So it takes only one light into consideration, right?

The older way (posted by OP), you get Light Vector as a pre-defined parameter into the Material and my understanding is that, that vector gives you the active light for the deferred lighting pass. So if the material is affected by 5 lights, we get contribution from all 5 lights, right? Is there a way to get this in UE4 material editor?

avatar image joshezzell Aug 23 '14 at 04:33 AM

I was thinking the same thing. Seems to me this was more simple to do in UDK.

avatar image Lovecraft_K ♦♦ STAFF Aug 25 '14 at 01:17 PM

Hey mindfane -

The lose of the ability to pull lighting information into a material is a result of switching to a much more efficient deferred rendering method. IN UDK which is forward rendered, you could pull a light calculation in because light was determined before the material was rendered. In UE4, its the opposite and light is determined and rendered after the material.

Hey joshezzell -

I will look into trying to calculate the light intensity of a light better in blueprints as what I had given you is a 0,1 solution it is applied or not applied. However, the most direct way of really controlling the shading is to add a point or spotlight into the actual blueprint and have that light get its primary direction and intensity from the surrounding light environment which I will also look into as well.

Thank You Guys -

Eric Ketchum

avatar image Chesire Dec 15 '14 at 02:54 PM

Is this method still valid in 4.6 Eric? Would you be so kind as to share that 14. example level perhaps? For peeps like me, who aren't that BP-savy, it would mean a lot! Thanks in advance for the assistance.

avatar image Lovecraft_K ♦♦ STAFF Dec 15 '14 at 03:02 PM

Hey Chesire -

That particular image you are seeing is actually from my internal test bed, a level I keep with various bugs and issues which Answerhub users have had me look into. I will see what I can do about posting something for you via the Wiki.

Thank You

Eric Ketchum

avatar image Chesire Dec 15 '14 at 06:51 PM

Thanks a bunch Eric! Awaiting with eager anticipation. Better 1 light than no light for self-shadowing :-)

avatar image Lovecraft_K ♦♦ STAFF Dec 15 '14 at 10:20 PM
avatar image Chesire Dec 16 '14 at 01:35 AM

Eric, I'm absolutely stunned by this. Thank you so much!

(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