Glass & transparency

Started by Kevin F, September 20, 2018, 08:15:30 AM

Previous topic - Next topic

Kevin F

Anybody know how to make a glass sphere cast a shadow AND allow light through as in real life?
For some reason applying the glass shader to a sphere always gives a full black shadow.

RichTwo

Try this thread: https://planetside.co.uk/forums/index.php/topic,25672.0.html

Masonspappy provided a .tgo which is a clear glass sphere, rather than the solid glass which the sphere / glass shader creates.  It works well at a smallish scale, but I tried enlarging to almost astronomical dimensions and it got a little wonky.

Good luck!
They're all wasted!

Hannes

Usually my workaround would be to duplicate your glass sphere, uncheck cast shadows for the first one, and assign a default shader to the duplicated one. Make the last one invisible and set the opacity to something lower than 1, let's say 0.25. Thus you have the glass shader and a transparent shadow. You don't have caustics (yet), but that's a known issue. It's a cheat, but better than nothing I'd say.
Unfortunately this doesn't seem to work with the built in sphere for whatever reason. You'll always get an opaque shadow... :(

Kevin F

Thanks, I've seen that and it doesn't solve the problem.
If you use the glass shader on either the build in sphere or an imported .obj, they still produce a solid (all black) shadow, which is wrong. Glass objects either solid or two sided (as a wine glass say) should be able to be transparent and cast a shadow that allows some light through as well. The shadows produced by TG are those of a solid opaque object.

Kevin F

Thanks Hannes, just posted when I saw your reply.
So it's a work around then. I'll give it a go.


archonforest

Quote from: Hannes on September 20, 2018, 12:21:51 PM
Usually my workaround would be to duplicate your glass sphere, uncheck cast shadows for the first one, and assign a default shader to the duplicated one. Make the last one invisible and set the opacity to something lower than 1, let's say 0.25. Thus you have the glass shader and a transparent shadow. You don't have caustics (yet), but that's a known issue. It's a cheat, but better than nothing I'd say.
Unfortunately this doesn't seem to work with the built in sphere for whatever reason. You'll always get an opaque shadow... :(
Good to know this trick. Thx Hannes 8)
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram, GTX 1080
Amiga 1200 8Mb ram, 8Gb ssd

WAS

Here is an example gather project showing Hanne's method, and my own method for 'semi-transparent' shadows within the same object. Due to the way it's built you get about "half" transparent shadows. But it's useful for some stuff, like thicker glasses (lowering transparency on glass/default shadow), or effects like my RGB Orbs in file sharing.

Kevin F

Thanks guys but these workarounds don't really work, they just produce a lighter shadow.
Here's an example of what I'm trying for.

WAS

Quote from: Kevin F on September 21, 2018, 03:58:36 AM
Thanks guys but these workarounds don't really work, they just produce a lighter shadow.
Here's an example of what I'm trying for.

Yes, as noted caustics are not even a thing in TG yet. You'll only get shadows, which will be lighter and double up (as shown in the image) through different solid sides and densities. TG can simulate doubled up shadows, but not density, nor caustics.