Planetside Software Forums

General => Terragen Discussion => Topic started by: Hannes on August 12, 2019, 08:17:44 AM

Title: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 08:17:44 AM
At the moment I'm creating a space scene with a planet that has rings. I want the ring cast a shadow onto the atmosphere of the planet (using an opacity image), so I enabled "receive shadows from surfaces" in the atmosphere's quality tab.
No matter what I do, I get a nasty bright area on the dark side of the planet, which drives me crazy! >:( >:( >:(
(Disabling the opacity image creates a correct shadow of the plane, but that's not what I want of course!)

Does anyone have an idea to get rid of this?

I attached a simplified version of the scene to explore it.
Title: Re: Atmosphere shadow problem
Post by: cyphyr on August 12, 2019, 08:38:36 AM
I had exactly the same issue last year. The only solution I found was to model the rings.
It's also worth asking if you REALLY need an atmosphere. Although technically accurate a gas giant would not necessarily have a perceivable haze on its atmosphere. It will look pretty solid.

Also remember that Saturn has a quite noticeable equatorial bulge (something like 10% if I remember) and whilst the planet can be easily squashed the atmosphere can not so easily.
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 09:25:53 AM
Thanks a lot, Richard!! Yes, I thought of modeling the rings, but still I wonder, why the shadow of an object is displayed correctly, but leaves this bright area when using an image map in the opacity slot.

And I really like the planet with its atmosphere (I mean the final one in my project. I uploaded only a very simple version)

By the way, in an older thread by you I found a way to use clouds for a planetary ring, but unfortunately the download link is dead. Could you maybe upload it again? I'd love to see, how you managed to use clouds for that.
Title: Re: Atmosphere shadow problem
Post by: Hetzen on August 12, 2019, 09:35:15 AM
Maybe do a shadow pass with the atmosphere off and all surfaces/background white, then multiply it over in post?
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 09:47:19 AM
Thanks Jon, this is of course a solution. Nevertheless I'd love to see it fixed. Still fighting.... ;)
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 09:56:33 AM
Btw, the RTP displays it correctly!!
Title: Re: Atmosphere shadow problem
Post by: Tangled-Universe on August 12, 2019, 10:15:37 AM
I wonder if it might be due to the atmosphere ceiling settings causing the renderer to disobey to calculate the shadows cast by an "out of atmosphere object" correctly.
Title: Re: Atmosphere shadow problem
Post by: cyphyr on August 12, 2019, 10:49:46 AM
Quote from: Hannes on August 12, 2019, 09:56:33 AMBtw, the RTP displays it correctly!!
It's actually not that correct, if you make the rings plane invisible (in it's render properties) you can see that where the shadow area is it actually gets brighter!
Weird bug
Title: Re: Atmosphere shadow problem
Post by: cyphyr on August 12, 2019, 10:59:26 AM
I don't think I would have uploaded to anywhere other than the planetside forum ...
The cloud setup (which is seriously NOT ideal lol) is just a huge thick cloud layer (v2) extending to the limit of the rings and a y projection "Ring" image map.

Ah found it
I had to strip out the images but I'm sure you can supply your own :)
Ring-03-simple.tgd
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 11:07:35 AM
Quote from: cyphyr on August 12, 2019, 10:49:46 AMIt's actually not that correct, if you make the rings plane invisible (in it's render properties) you can see that where the shadow area is it actually gets brighter!
Weird bug
Indeed!!

Quote from: Tangled-Universe on August 12, 2019, 10:15:37 AMI wonder if it might be due to the atmosphere ceiling settings causing the renderer to disobey to calculate the shadows cast by an "out of atmosphere object" correctly.

Playing around with the settings didn't make the bright area go away...

Anyway, thanks, guys!!
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 11:08:32 AM
Quote from: cyphyr on August 12, 2019, 10:59:26 AMI don't think I would have uploaded to anywhere other than the planetside forum ...
The cloud setup (which is seriously NOT ideal lol) is just a huge thick cloud layer (v2) extending to the limit of the rings and a y projection "Ring" image map.

Ah found it
I had to strip out the images but I'm sure you can supply your own :)
Ring-03-simple.tgd

Cool!!! Thanks, Richard!
Title: Re: Atmosphere shadow problem
Post by: Tangled-Universe on August 12, 2019, 11:33:36 AM
Quote from: Hannes on August 12, 2019, 11:07:35 AM
Quote from: cyphyr on August 12, 2019, 10:49:46 AMIt's actually not that correct, if you make the rings plane invisible (in it's render properties) you can see that where the shadow area is it actually gets brighter!
Weird bug
Indeed!!

Quote from: Tangled-Universe on August 12, 2019, 10:15:37 AMI wonder if it might be due to the atmosphere ceiling settings causing the renderer to disobey to calculate the shadows cast by an "out of atmosphere object" correctly.

Playing around with the settings didn't make the bright area go away...

Anyway, thanks, guys!!
Ok, that's interesting, since it seems to work with a very thick cloud layer extending from the planet all the way up to the ring, which to me sounds similar to increasing the atmosphere ceiling all the way up to the ring. Oh well, it probably has a different way of things, I guess.
Title: Re: Atmosphere shadow problem
Post by: Matt on August 12, 2019, 04:53:22 PM
I wasn't aware of this bug until now. I'll fix it.
Title: Re: Atmosphere shadow problem
Post by: WAS on August 12, 2019, 05:18:37 PM
Was this bug introduced somewhere recently? I used shadows from surfaces I believe in my reflective ring with transparency and don't remember the effect.

I do know the angles of reflections at that scale were wrong. Literally couldn't get the planet to reflect on the rings at direct angles (from memory).
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 05:33:36 PM
Actually it happens only with shadows onto the atmosphere, when the opacity of the shadow casting object's default shader is either less than 1, or if an image is used for opacity.
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 05:38:19 PM
I also tried your cloud solution, Richard. 
It looks quite nice, but takes ages to render. 
And it doesn't seem to cast a shadow. 
Thanks anyway, cool idea!!!!
Title: Re: Atmosphere shadow problem
Post by: WAS on August 12, 2019, 05:45:06 PM
Quote from: Hannes on August 12, 2019, 05:33:36 PMActually it happens only with shadows onto the atmosphere, when the opacity of the shadow casting object's default shader is either less than 1, or if an image is used for opacity.

I believe this coincides with a transparency ring setup like yours and mine. Both needed opacity. Mine though did feed into a surface layer, with glass shader as main input, and secondary alpha mask as surface mask. For semitransparency.
Title: Re: Atmosphere shadow problem
Post by: Hannes on August 12, 2019, 05:51:12 PM
In my scene I used two ring objects (planes).
One with the glass shader setup with cast shadows off, and one invisible plane with a simple default shader and a b/w image map in the opacity slot with cast shadows on.
Title: Re: Atmosphere shadow problem
Post by: WAS on August 12, 2019, 06:30:01 PM
Quote from: Hannes on August 12, 2019, 05:51:12 PMIn my scene I used two ring objects (planes).
One with the glass shader setup with cast shadows off, and one invisible plane with a simple default shader and a b/w image map in the opacity slot with cast shadows on.

I think that's what I did, since the glass trans plane will give you it's full shadow. Not positive though. Just throwing it out there, it may be something that can be referred in change logs. Cause, like I said I don't remember it, and it should have been very obvious.
Title: Re: Atmosphere shadow problem
Post by: Tangled-Universe on August 13, 2019, 04:18:37 AM
Quote from: Hannes on August 12, 2019, 05:38:19 PMI also tried your cloud solution, Richard.
It looks quite nice, but takes ages to render.
And it doesn't seem to cast a shadow.
Thanks anyway, cool idea!!!!
At least that fits with why my idea (of increasing atmo ceiling) didn't work either...interesting.
Title: Re: Atmosphere shadow problem
Post by: Hannes on December 15, 2022, 05:10:24 AM
I have to dig out this old thread. I'm working on another project with planetary rings. The problem is still there.
Matt, you wrote, you wanted to fix it. Is there any progress so far?
Recently I watched "Ad Astra", knowing Richard did a wonderful job creating the planets, and having the same problem with Saturn's rings. Since Terragen has been used for quite some Sci fi movies, it would be fantastic to have this bug fixed, so that TG will be (or stay) the first choice for Sci fi planetary VFX.
So, to summarize it: if you have an object outside of the atmosphere (receive shadows from surfaces checked - clouds as well) casting shadows on it with a texture in the opacity slot, or an opacity less than 1, the problem occurs.
The example project is still downloadable.
Title: Re: Atmosphere shadow problem
Post by: Hannes on January 13, 2023, 05:47:40 AM
Once again I have to bring this up. There seems to be another problem which is not caused by the atmosphere but looks quite similar.
Image one shows the mentioned problem with objects casting shadows onto the atmosphere with a reduced opacity or a greyscale image.

Just to describe the settings again: There's a visible, not shadow casting ring object with the glass shader transparency falloff method for the diffuse color. Then there's an identical ring object (slightly moved downwards to not intersect with the other one), which is invisible and shadow casting. I just used a default shader with a greyscale map for the opacity.

In image two "receive shadows from surfaces" is off. The ugly bright area is gone, but the red arrows show some weird terrain artifacts where the terminator and the shadows intersect.

The third image shows the same problem with the atmosphere turned off, and the artifacts are still there, so it's not only caused by the atmosphere.

Image four shows the planet without rings, just to see, how it should look. No problems here.

I have no idea what the problem is here. It's just a semi transparent object casting shadows on another object. There is no problem on a smaller scale.

While I'm writing this, I just had the idea, that the location of the planet (far, far away...) could be causing this (for whatever reason), but I made a test with the planet at 0,0,0, and it was still there (see last image).
Title: Re: Atmosphere shadow problem
Post by: WAS on January 15, 2023, 05:25:38 PM
Yeah I encountered this recently before retiring my old PC, and still had the same issue. I tried many methods to fix it but the only thing there really was, was doing a torus shape for the rings, which was solid, and ugly. So I just gave up on the idea. This wasn't a issue in past versions, so curious where it popped up, and why.

Is it possibly due to the new Rayleigh scattering?
Title: Re: Atmosphere shadow problem
Post by: Hannes on January 16, 2023, 04:18:46 AM
Thanks Jordan. Just did some tests with version 4.3.16 (that's the oldest version I can run), and the problems were already there. Too bad... :(
Title: Re: Atmosphere shadow problem
Post by: Mahnmut on January 18, 2023, 01:08:49 PM
Hi, i´ll try to rephrase my idea here where it belongs:
I wonder if the bright stripe surrounding the shadow corresponds to the outer margin of the opacity image.
Maybe parts of the image that are opacity<1 do somehow influence not only the ring shadow, but also the planets shadow, or they get applied as "negative shadow value", thus brightening the region they apply to?
In that case, using a broader opacity image should result in a broader bright stripe.
Just an idea.
Best Regards,
J
Title: Re: Atmosphere shadow problem
Post by: Dune on January 19, 2023, 02:21:50 AM
Despite the fact that opacity is on or off above or below 0.5, an intermediate greyscale above 0.5 (say 0.7) will still affect shadows. It is somehow calculated as such. I use that feature to have more light between canopies in (RT mode). So it might have an influence here too.
Title: Re: Atmosphere shadow problem
Post by: Hannes on January 19, 2023, 05:25:56 AM
Thanks guys!
However, it is a bug indeed. I made a test with a very small planet, since I thought maybe it is something that happens only with planets at planetary scale, but I found it's the same with a small (internal) sphere.
As you can see, the RTP doesn't show the planet shadow correctly (I resetted it first and let it run for a few minutes), but at least the intersection of the two shadows is correct.
The render shows the problem. The two shadows don't seem to add, but subtract, if one of those is restricted by opacity. I thought, why didn't I notice this earlier, and did another test with an imported object, and voilà, the shadows are correct ??? ??? ??? !!! See the render with my long time companion. So, I guess the bug is somewhere inside the planet or the internal sphere (maybe even other internal objects?).


So, maybe I have a temporary (!) solution for ring planets until this bug is fixed: I could use an imported high res sphere the same size of the planet with the same textures and make the original planet invisible.



Title: Re: Atmosphere shadow problem
Post by: Hannes on January 19, 2023, 05:59:20 AM
And Tadaaaaaaah!!!! An imported sphere the same size as the planet at the same location with "force displacement" checked did the trick. The planet's "render surface" is unchecked to make it invisible. In the atmosphere's quality tab "receive shadows from surfaces is checked.
I had to use some transform input shaders with world space checked for the textures to make them work. I haven't managed to put these exactly like on the planet, but this is not the problem.

So, actually this thread has a wrong name. It's definitely no atmosphere problem, but a problem with the planet (or other internal objects as Ialready wrote).
I think, now it's time for Matt, Kevin or Cris to chime in. ;)
Title: Re: Atmosphere shadow problem
Post by: Dune on January 19, 2023, 07:04:35 AM
Great work!
Title: Re: Atmosphere shadow problem
Post by: Dune on January 20, 2023, 02:18:11 AM
And what if you use an internal sphere with force displacement on? And what if you use a polysphere?
 No, doesn't work either.
Title: Re: Atmosphere shadow problem
Post by: KlausK on January 20, 2023, 11:37:32 AM
" I think, now it's time for Matt, Kevin or Cris to chime in. ;) "

Maybe you could send a example file directly to support to be shure they see this?
But maybe you did thst already...

CHeers, Klaus
Title: Re: Atmosphere shadow problem
Post by: Hannes on January 20, 2023, 11:50:46 AM
No, I didn't, but I posted this in the Alpha Testing area as a bug report. I guess, it might be read there.
Title: Re: Atmosphere shadow problem
Post by: Matt on June 05, 2023, 06:15:23 PM
This is fixed in build 4.6.43 (Release) which was released today for Windows, Mac and Linux.