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"

Why does my Sun still light objects at night time?

The lighting is fine in the morning

alt text

But when it turns night time, the sun is still lighting up the trees when it goes down and it looks awful.

alt text

I Tried building lighting many times and i have no idea how to fix this. i even checked if the landscape was casting shadows and it said it was casting "Static Shadows" no option for dynamic shadows though. Can someone please help me out?

Product Version: Not Selected
day time.png (381.9 kB)
night time.jpg (319.2 kB)
more ▼

asked Jun 13 '14 at 10:58 PM in Rendering

avatar image

227 48 63 80

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

2 answers: sort voted first

I've added the option to allow Landscapes to cast shadows as two-sided. This will be in the Unreal Engine 4.3 release.

Cheers Jack

more ▼

answered Jun 25 '14 at 06:50 AM

avatar image

1.3k 37 11 48

avatar image RyanB STAFF Jun 16 '14 at 06:38 PM

Is this for dynamic or static lighting?

If it is dynamic, expecting dynamic shadows to shadow the entire scene for night time is a bad idea even if you get these artifacts to go away. You will pay a huge expensive for a black result. I would suggest that you use a timeline or blueprint script to simply fade the brightness to 0 when the sun passes under the horizon.

Looks like landscapes no longer have an option to set two sided shadows. That is probably what is causing this. I will follow up with people on our end and make sure that gets bugged.

avatar image gotgrassct Jun 20 '14 at 12:25 PM

Oh shit i totally have an idea.. what if i put an object UNDER the landscape and the object will recieve the light and cast a shadow on the trees instead of casting light.

avatar image gotgrassct Jun 23 '14 at 03:53 AM

So is there any way i can fix this?

avatar image RyanB STAFF Jun 23 '14 at 06:14 PM

You could place a big "blanket" shadow caster under the whole landscape.

Where are you updating your sunlight rotation form? Anywhere that you are doing that updating you should be able to easily calculate when the sun is below the horizon by doing a dot product with (0,0,1) and the light's Xvector. I think it will return 1 when the sun is at noon and 0 right when the sun is below the horizon, and -1 when it is at midnight. Then you could easily use some math to isolate the blend to off at the right point.

avatar image gotgrassct Jun 23 '14 at 03:57 AM

How would i add a timeline to make the brightness go down to 0 when the sun goes down?

avatar image vaughnva Jun 23 '14 at 05:21 PM

Hi gotgrassct,

This tutorial on the wiki goes through using an event tick to alter lighting, but also links a timeline tutorial for simulating time of day: https://wiki.unrealengine.com/Tutorial:_Time_of_Day

avatar image gotgrassct Jun 26 '14 at 03:48 AM

THANK YOU! Now i can make my horror game. thank you so much, jack. Also, do you know when 4.3 will be released?

avatar image JackP_oldaccount Jun 26 '14 at 03:57 AM

We are branching 4.3 from Main this week, and we hope it will be released some time in mid to late July.

FYI if you're using source code, the patch is here. It should be very easy to integrate.

avatar image DanielW STAFF Jun 26 '14 at 07:14 PM

Really though you should disable the directional light if it is coming from underneath, you don't want to be paying all that dynamic shadowing cost for an invisible light.

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

Another fix is to add a hollow BSP cube and place whatever should not be lighted inside it.

more ▼

answered Nov 15 '15 at 06:36 PM

avatar image

508 33 48 85

(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