bug url
https://playground.babylonjs.com/#CUFI3B
i want volumetric clouds Generate shadows
Hey,
Here the cloud box is just a plain box, added “as-is” on the Shadow Caster, so I would say it’s not a bug that the shadow is dark. Your volumetric cloud here is just a custom post-process which runs after render, on the box only :
vec2 tBox = boxIntersection(rayOrigin, rayDir, boxMin, boxMax);
if (tBox.x < 0.0) {
gl_FragColor = baseColor;
return;
}
You are testing if the fragment is hitting the cloud box, and if not you return baseColor so your post-process won’t affect the ground is anyway here
Considering your level of GLSL dev here, I would say the best for you would be to :
NB: 2. Box shadow hit means, a ray from this point toward the light collides with the box. So you need to send light pos to the frag shader as well