A question about shadows

Right now, I have been playing with shadows to add a feel to an office scene. And it is driving me “up the wall” - if you will pardon the pun.

I want to cast shadows onto the floor and walls of the office, and I want to use a point light. As you can see from the first image below, I get no shadow on the walls and floor when I have that wall/floor mesh set to receive shadows even though the desktop is receiving shadows from the same light (mug and gun)

If I split the wall and floor apart, and set both to receive shadows the floor does get shadows, but not the walls (and again so does the desk top mug and gun) Second image below.

I looked at some playgrounds to see if there had to be flat meshes to receive shows, but this example shows a 3d object - a sphere - receiving shadows. And it uses a Point light

Any thoughts …

cheers, gryff :slight_smile:

Can you repro in the PG? This should work for sure

@Deltakosh : I will try to post to the PG in the next couple of days - life is a bit weird for us old folk these days. :pensive:

cheers, gryff :slight_smile:

I can relate ;D

@Deltakosh here is a playground . Shadows cast on desktop (mug and gun) , floor (chair) but no chair shadow on the wall (office mesh).

Hope it is clear - been a while since I’ve used the PG.

cheers, gryff :slight_smile:

Not that this is an answer, but could you not use the exporter to almost all of this code? Meshes have cast and receive custom properties.

Lights have shadow map custom properties. Kind of feel like I am setting myself up by pointing this out though, unless you are already doing that, and just doing it in code now for the PG.

1 Like

You don’t have texture coordinates on your wall, so the shadow texture can’t be drawn over it:

1 Like

After playing a bit with your PG and using inspector i have found out that your point light has set includedOnlyMeshes property, setting that to empty array solves your issue:

aPoint.includedOnlyMeshes = [];

So you have to play with that.

Here is updated PG.

3 Likes

Thank you @Evgeni_Popov and @ludevik for the thoughts and suggestions, I will be trying those out later today :slight_smile:

@JCPalmer

The last time I tried the exporter - it did not like the “point” light for shadows. That is why I switched to code. And you know me - I stay away from code if I can :laughing:

cheers, gryff :slight_smile:

My mistake, you don’t need coordinate textures for shadows to work!

@ludevik found the problem.