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"

Shadows disappear after building the lighting

So I'm attempting to cast dynamic shadows that look something like this: alt text I want the shadow to be generated by the cube. For some reason after I build the lighting, it looks like this: alt text The light is stationary and the shadow seems to disappear after I build the lighting. The shadow works if the light is movable but not if it's stationary. I don't really want to make my lights movable because I feel it would affect the performance. So is there a way to make shadows like the first picture without having to make my lights movable?

Product Version: UE 4.16
Tags:
before build.png (411.8 kB)
after build.png (401.3 kB)
more ▼

asked Aug 03 '17 at 06:08 AM in Rendering

avatar image

Brandon236
83 28 37 44

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

1 answer: sort voted first

Double check that your wall's geometry has lightmap UVs and enough lightmap resolution to catch that shadow.

more ▼

answered Aug 03 '17 at 07:30 AM

avatar image

bstone
119 2 13 12

avatar image Brandon236 Aug 03 '17 at 09:15 AM

The wall is just the basic cube that I put a texture onto. Apparently if you make the cube and wall moveable then the shadow appears but the draw distance is quite short. I also have another custom mesh where I'm doing something similar yet the light seems to go right through it. Even stranger is I created a new project and imported my custom mesh into it and the shadows seemed to work for stationary lighting. So how come it's not working for my other project?

avatar image bstone Aug 03 '17 at 09:29 AM

You should account for the specifics of stationary lights. They rely on the static lighting for the most part but also support casting shadows from dynamic objects. There're also preview shadows that you see before the static lighting is built (that's what you see on your first screenshot).

I'd recommend changing that light to a static light first to eliminate all the extra factors that come with stationary lights first.

Next, you have to prepare your static meshes for static lighting by adding lightmap UVs (this can be done semi-automatically when importing the mesh, just make sure to check the appropriate checkbox) and setting their lightmap sizes large enough to capture the lighting/shadow information (min 64 for your case if you're fine with a soft shadow but might have to be larger for a crisper shadow, depends on your needs and texture memory budget).

avatar image Brandon236 Aug 03 '17 at 11:39 PM

Ok so I tested it on a smaller wall and it still didn't work until I moved everything forward and then it worked. I noticed that as I moved the wall and light backwards then it looked like the shadow was being cut off as if there was another cube that was cutting off the shadow. I then put the wall back to its original position and removed all the objects from my map except for the light, wall, and cube and the shadow appeared but only on the smaller wall.

When I tried this again on the bigger wall, the shadow didn't appear so I took the smaller wall and slowly made it bigger and the bigger the wall got, the more the shadow was distorted until it disappeared completely. So it looks like the size of the wall is a factor here.

I also used static lighting and it had similar effects where the location and size of the wall matters (except it was quite pixelated). So the two main things are that there appears to be an object in my map that gets rid of the shadow but I don't know which one it is and the wall needs to be small but I want the wall to be large. So what do I do about that?

avatar image Brandon236 Aug 04 '17 at 05:41 AM

Ok so I found the object that made my shadows disappear but we still have the problem of the shadow only appearing on small walls but not big ones. How do I fix that problem?

(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