Light source itself, casting shadow

Started by N-drju, December 31, 2019, 06:34:06 am

Previous topic - Next topic

N-drju

There is a significant problem (possibly a bug) with the "light source" lighting object. It turns out the light source itself is casting shadow directly underneath the object's center, producing an unwanted shading effect:

shadow_from light.png

I checked for other possible culprits, but the problem is most likely caused by the light source object. What is even more puzzling is that this effect is visible in the regular preview but not in the RTP!

I'm stumped... What do you think might be the cause?
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

Hmmm... Just found out where the problem lies. Turns out it's the cube's native object shadow (used as a base instead of ground in this render) that is at fault... I just wonder how on Earth a cube shadow can be cast this way and be a perfect circle too!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Oshyan

Interesting. I wonder if it's actually a GI cache artifact. What happens if you turn off "Cast shadows" for the Cube? Do you get no shadow at all? What about if GI is 0/0 (or enviro light is disabled)?

- Oshyan

N-drju

It cannot be a GI cache artifact because I did not use one. ;) Yes - turning the shadow off in the cube object fixed this issue, though (using conventional physics) I cannot fathom how...

I can live with no cube shadow in this render, and I'm glad I got off easily with that. But it probably needs an investigation.

Happy new year!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

Quote from: N-drju on December 31, 2019, 05:27:44 pmIt cannot be a GI cache artifact because I did not use one. ;)

There's always a GI cache, though. Saving one just saves the cache to file so TG doesn't need to do it before render.

Oshyan

Quote from: WAS on December 31, 2019, 08:45:17 pmhere's always a GI cache, though. Saving one just saves the cache to file so TG doesn't need to do it before render.
Exactly.


- Oshyan

N-drju

I stand corrected. Not a cause though, as mentioned above.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Oshyan

I can't reproduce the square shadow issue here yet. Can you send a TGD perhaps?

- Oshyan

N-drju

No problem. I'll attach it in the evening or if not - tomorrow evening.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

There you go.

LSource_CubeShadow.tgd

I use the latest TG version (no frontier build.)
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

Well, first thing I did is turn off the cubes shadows, and then, no shadow...

Oshyan

That is, indeed, weird as heck. I tried everything I could think of and the "shadow" remains. I'm not *as* concerned by it being circular as I am by it being there at all, for a couple reasons. First, the cube is *below* the light source, so shouldn't be casting a shadow on *itself*. Second, if you disable the cube and re-enable the planet surface, there is no shadow, so it's clearly handling the light source differently on cube vs. planet. Matt will have to look at this one I think. It may well be a bug, just a rare one. :D

- Oshyan

N-drju

I knew you'd be interested. ;)

Quote from: Oshyan on January 02, 2020, 04:28:48 pmFirst, the cube is *below* the light source, so shouldn't be casting a shadow on *itself*. Second, if you disable the cube and re-enable the planet surface, there is no shadow, so it's clearly handling the light source differently on cube vs. planet.

Precisely! This is what I thought as well - there has to be a difference in how light is being handled by this native object. You know what? Now I'm curious if the same will happen with the sphere, rock or grass!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Matt

January 16, 2020, 10:30:52 pm #13 Last Edit: January 16, 2020, 10:37:08 pm by Matt
The shadow is cast by the other side of the cube. Obviously this doesn't make sense in the real world, but there's a reason why it happens here. The cube is very thin compared to the distance (it's 1 metre thick but it's about 20 km away from the camera). It's only a problem with displaceable objects. With a non-displaceable object this wouldn't matter, but Terragen makes some simplifications when it casts shadows from displaceable surfaces onto other displaceable surfaces and it needs to add some bias to the ray positions to make it look correct in most cases. This is one case where it fails.

There are a few ways you can fix this. You could make the cube thicker, or you could replace it with a Plane object. You might also be able fix it by using a higher micropoly detail or higher ray detail multiplier.
Just because milk is white doesn't mean that clouds are made of milk.