Realistic Shadows from Volumetric Shaders

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/04/2009 at 10:16, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   9.6-11 
Platform:   Windows  ;   Mac OSX  ; 
Language(s) :     C++  ;

---------
Hello all,

I'm wondering if any of you know how to cast realistic shadows from a volumetric shader. Right now, I have a volumetric shader used to display objects (ie. at some points the shader is fully transparent, at others it contains objects). The shader successfully cast shadows onto C4D objects, but these shadows are always hard, no matter the type of shadows of the lights (shadow maps, area, etc.). Needless to say, it's quite unrealistic, especially when your C4D scene has a mix of hard/soft shadows only induced by the volumetric shader.

I don't really expect C4D to take into account volumetric shaders when building the shadow maps, but it should at least work with the "area" mode.

During C4D shadow computation, the volumetric act as any other objects (blocking or not a shadow ray), so i don't see how it would interfere in any way with the computation of area shadows, IMHO.

It's like C4D is seeing the volumetric shader and decides to just cast one ray into it, resulting in a hard shadow. Maybe I just missed a setting somewhere, but I searched...

Any idea?

Thanks!
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/04/2009 at 10:17, xxxxxxxx wrote:

I forgot to mention that this volumetric shader is applied to an environment object, to surround the whole scene. Maybe it's important...

Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/04/2009 at 10:39, xxxxxxxx wrote:

Mmm, maybe I understand what C4D is doing:

When it wants to compute light contribution to a surface, it first do some normal shadow computation (shadow map=>map evaluation, raytraced=>shadow ray casting, area=>multiple ray casting). Then, it will call the volumetric shader to attenuate the light, like a fog would do.

If I'm true, then my question becomes: how can I make C4D evaluate my shader for intersections during the "normal shadow computation"?

Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/04/2009 at 03:28, xxxxxxxx wrote:

It should work with area shadows, there is nothing really special you have to do. Just make sure to overload all the necessary methods, CalcVolumetric(), ClacTransarency etc. Have a look at the ParticleVolume example shader, it works with area shadows.

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/04/2009 at 06:17, xxxxxxxx wrote:

I've just tried the ParticleVolume sample, and modified it so it returns hard intersections (the original one returns soft intersections) to be sure it would work in my case, and it indeed worked great (with area shadows and even with shadow maps).

But then I tried to apply this modified shader to an environment object, and it doesn't work anymore. Shadows are hard in all three modes... any idea?

Thanks,
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/04/2009 at 06:41, xxxxxxxx wrote:

You are right, as soon as the shader is applied to an environment object it cast only hard shadows. I have to look into this.

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/04/2009 at 06:50, xxxxxxxx wrote:

Let me know if this is something that will be fixed or that can be changed by some settings in the app or in the shader.

I'm trying to workaround the problem by using two separate shaders, one for transparency and one for volume. I'll try to apply the volume one to the environment object and the transparency one to a large invisible cube.

Thanks!
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/04/2009 at 07:51, xxxxxxxx wrote:

afaik for volumetric environement shaders you must do your own shadow calculations (expect for hard shadows of course).

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/04/2009 at 08:07, xxxxxxxx wrote:

ouch. that would be a tough job...

Since applying the same shader to a giant cube works, C4D seems to be able to do great shadows with volumetric shaders. It's just a matter of taking into account shaders applied to environments...

Thanks for your help
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 05/05/2009 at 05:51, xxxxxxxx wrote:

Matthias, any news on this?
Will there be a fix in future versions of C4D?

Thanks,
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 07:26, xxxxxxxx wrote:

Hi Ben, I can't say when this will be fixed. I'll report it as feature request.

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 07:54, xxxxxxxx wrote:

Ok!

Thanks for letting me know.

best,
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/09/2009 at 03:32, xxxxxxxx wrote:

Hello Matthias,

Any news on this problem? Is it supposed to be fixed in R11.5?

Best,
Ben

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/09/2009 at 03:53, xxxxxxxx wrote:

Afaik nothing has changed regarding this issue. I have to check again.

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/01/2010 at 07:32, xxxxxxxx wrote:

Hello Matthias,

I'm Julien. Since Ben left our development team, I was forwarded his messages here, at PluginCafé. Could you please tell me if you had time to check this problem of hard shadows? Thank you!
(by the way, I wish you a happy new year!)

Regards,
Julien.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/01/2011 at 10:22, xxxxxxxx wrote:

Hello Matthias,

I wish you a Hapy New Year!
Could you please tell us if this very old issue has been fixed (in Cinema4D 12), or, if not, if it is going to be fixed in a future update. Thanks!

Cheers,
Julien.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/01/2011 at 05:53, xxxxxxxx wrote:

Hello Julien,

I wish you a Happy New Year too.

I am sorry to inform you that regarding the issue with the shadow calculation nothing has changed so far. So far I am nor aware of any changes in future releases. I will mention it to the developers again.

cheers,
Matthias

On 13/01/2016 at 09:33, xxxxxxxx wrote:

Hello Matthias,

I wish you a Hapy New Year 2016!

We still have issues with this problem (a customer recently reported the issue again, and it prevented him from using xStream in his project...)

I just wonder if this is going to be fixed this year (in Ciname 4D R17, for instance?)
Thank you in advance!

Best regards,
Julien.