Hi,
I’m having an issue with shadows. I have a ground which receives shadows, a point-light and a PointLightShadowRenderer, nothing else. So, my question is: Why is there a Shadow on the ground?
If i insert an object which casts a shadow everthing works fine.
The same behaviour is if I use a SpotLightShadowRenderer. The DirectionalLightShadowRenderer is ok.
heh looks like I forgot about that…
We’re in the case there is nothing to cast shadows…
Maybe I could skip the post shadow too in this particular case…
So I guess there is a similiar problem if I have a shadow receiver (red box) and a shadow caster (blue box)?
behind the red box shouldn’t be a shadow.
same code as above except:
[java]
// --------------------------------------------
// box1
Box box = new Box(0.1f, 1, 1);
Geometry box_geom = new Geometry(“box_geom”, box);
Material box_mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
box_mat.setColor(“Color”, ColorRGBA.Blue);
box_geom.setMaterial(box_mat);
box_geom.setLocalTranslation(-3f, 3f, 0);
I would argue that is expected behavior given how you setup the second geo to only receive. The first geo is the only one being added to the shadow map and since those pixels on the back are farther away they get shadowed. You could probably generate another shadow map of the geometry only set to receive and then filter out values using that but that seems like a lot of wasted time. Most of the time I think people will have the second geo set to cast as well and it would be shadowed anyways.
But I don’t want that the red box cast shadows
So everytime I use shadowMode.receive I must be aware of that strange shadows are on the back of the object and shadows go through it?
At the moment my workaround is for example instead of using a box, to use a self-made box with 6 quads but thats always a fumbling :amused:
If I would set it to ShadowMode.Off … then it is non existent for shadowing. I would think the red cube is an opaque object that only receives shadows and doesn’t cast or let other shadows through because it’s opaque.
Or is there maybe another way to only receive shadows without letting them through like an one side black hole? :-?
@OPM87 said:
I would think the red cube is an opaque object that only receives shadows and doesn't cast or let other shadows through because it's opaque.
…except you told the shadow code that it is not opaque.