Author Topic: Sun showing thru object  (Read 1200 times)

Offline Ben3D

  • Member
  • *
  • Posts: 28
Sun showing thru object
« on: April 08, 2015, 09:21:13 PM »
Hello,
I have a render that has objects but the sun is showing thru the object when the sun should be invisible behind the object. Using version 3.2.03.0 of Terragen you can add a standard cube and lower the sun and you should get the same result:

56558-0

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2816
  • I'm the crazy one
Re: Sun showing thru object
« Reply #1 on: April 09, 2015, 03:21:56 AM »
This is caused by the atmosphere between the object and the camera, receiving light where in real life it would be in shadow. The standard way to fix this is to enable "receive shadows from surfaces" in the Quality tab of the Planet Atmosphere. If you have a scene where there are clouds in front of the object, you need to check it on the cloud layer(s) too.

This setting usually increases render times quite a bit.

If you have this problem in a scene where you really can't afford to increase render times, there is an advanced feature in the atmosphere and cloud nodes that allows you to use function nodes or shaders to mathematically define where the volumetric shadow should be, avoiding the need to enable "receive shadows from surfaces".

A third strategy you can use is a small, localised cloud layer where the object is. You can make it invisible (by turning off "enable primary"), but it will cast shadows into the atmosphere, avoiding the need to enable shadows from surface.

Matt
« Last Edit: April 09, 2015, 03:28:58 AM by Matt »
Just because milk is white doesn't mean that clouds are made of milk.

Offline Ben3D

  • Member
  • *
  • Posts: 28
Re: Sun showing thru object
« Reply #2 on: April 09, 2015, 03:35:44 AM »
I had about 6 frames that had this problem so I rerendered only the object and went into Photoshop to draw over the picture with the sun with the picture without. Since the camera moves quite fast it's not noticeable even if the redraw is not perfect.

Thanks for the information, I will keep it in case I have multiple frames that have this problem.

Offline Dune

  • Member
  • *
  • Posts: 12532
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Sun showing thru object
« Reply #3 on: April 09, 2015, 06:58:38 AM »
Quote
If you have this problem in a scene where you really can't afford to increase render times, there is an advanced feature in the atmosphere and cloud nodes that allows you to use function nodes or shaders to mathematically define where the volumetric shadow should be, avoiding the need to enable "receive shadows from surfaces".
You mean; plugging in a combination of say simple shape shader (located where object is) and distribution shader (for max height) into the shadow function of the cloud?
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2816
  • I'm the crazy one
Re: Sun showing thru object
« Reply #4 on: April 09, 2015, 08:47:50 PM »
Quote
If you have this problem in a scene where you really can't afford to increase render times, there is an advanced feature in the atmosphere and cloud nodes that allows you to use function nodes or shaders to mathematically define where the volumetric shadow should be, avoiding the need to enable "receive shadows from surfaces".
You mean; plugging in a combination of say simple shape shader (located where object is) and distribution shader (for max height) into the shadow function of the cloud?

Yes, but instead of using those shaders to say where the object is, you say where the shadow is. So you'd put the shape in between the object and camera. Your shape isn't the shape of the shadow-casting object, but the shape of the shadowed volume. This means it's very fast to calculate, and also allows you to do some things that wouldn't be possible any other way. But if you want the shadow to be automatically cast from a shape, you could just make a cloud from the shape.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Offline Dune

  • Member
  • *
  • Posts: 12532
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Sun showing thru object
« Reply #5 on: April 10, 2015, 07:00:52 AM »
Thanks Matt. I have to think this over and try it. Ah, works like a dream!
« Last Edit: April 10, 2015, 07:12:49 AM by Dune »
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline AP

  • Member
  • *
  • Posts: 2654
Re: Sun showing thru object
« Reply #6 on: September 12, 2017, 03:36:08 AM »
I have a project where the sun in just below the horizon and enabling the receive shadows from surfaces function increases render times too much for me to wait. I attached a imported height field terrain to the shadow input for the Atmosphere node, however this did not work. Am I overlooking something else?

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 11618
  • Holy snagging ducks!
Re: Sun showing thru object
« Reply #7 on: September 12, 2017, 05:13:39 AM »
What you're achieving by doing that is simply to mask the atmosphere by a Y-projected grayscale version of the heightfield, which of course is not what you want. It does not interpret it as "mask by this displacement as it appears from the camera's perspective".

What you *might* be able to do is use an image map (in through camera mode) or painted shader to mask out the area where the sun glow should not appear, and then use that as a mask. However I don't know if the shadow modulator actually affects atmospheric glow in that way. Worth a try. The other alternative is just to render that part of the terrain in a crop with Receive Shadows enabled, to save render time, then in post blend it with the main render done *without* Receive Shadows.

- Oshyan

Offline Dune

  • Member
  • *
  • Posts: 12532
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Sun showing thru object
« Reply #8 on: September 12, 2017, 07:09:45 AM »
That doesn't really work well, I'm afraid. Though it might be interesting for stuff.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline AP

  • Member
  • *
  • Posts: 2654
Re: Sun showing thru object
« Reply #9 on: September 12, 2017, 07:23:44 AM »
And I was just about test that idea. I may try the composite idea but more then likely I may just move the sun.

Offline Dune

  • Member
  • *
  • Posts: 12532
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Sun showing thru object
« Reply #10 on: September 12, 2017, 07:33:58 AM »
This might work better.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline AP

  • Member
  • *
  • Posts: 2654
Re: Sun showing thru object
« Reply #11 on: September 12, 2017, 10:20:17 PM »
That did not work either. I decided to move the sun and accept the results.

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 11618
  • Holy snagging ducks!
Re: Sun showing thru object
« Reply #12 on: September 13, 2017, 04:50:27 AM »
Oh, that's clever Ulco!

- Oshyan

 

anything