Is/was there a "castShadows" property?

The BlenderExporter plugin adds a checkbox that sets “castShadows”, but it doesn’t get exported, and there isn’t really any such property on any of the Mesh classes anyway. There are some .js test files that set such a property, but I’m not sure it actually exists in the engine. Is this something deprecated?

This would actually be quite useful… I’m trying to add/remove meshes dynamically to a shadowmap’s render list as they move in/out of range of the light, and having such a property would be very useful.

You can add/remove ShadowCaster for mesh by helper function or push/splice renderlist of ShadowMap:

1 Like

Thanks, but the problem is that I don’t know which meshes to add/remove. I need something like a “castShadows” property on the mesh to identify it as a shadow caster.

It needs to be “should” flag, rather than “is”, so I know whether to add it to a shadowmap in the first place. I’m thinking of updating the BabylonExporter plugin to write that property to the mesh’s metadata… That way I could use it without having to modify the engine.

I’m still wondering why the blender plugin even has such a property when it doesn’t write it to the .babylon file, and when it doesn’t exist in the engine anyway.

Will check / give a better answer, but the cast shadows is used by the exporter internally to create shadow maps & lights also for export. The property did not actually exist in the export file.

Yup, I process all the meshes in the .blend before lights for a reason. Any lights wt shadow generators use that info. That is what gets exported.

PBR materials have kind of thrown some “shade” on all lighting/shadows. They have fallen off in usage.

Shadows have to be set at maximum strength, or you’ll never see them in PBR. In the exporter, I have made sure that you can switch to a standard material when the default is export PBR materials, as well as overriding the world environmental intensity to address this.

You can change the purpose of that custom property to also do that if you wish. I really do not use the metadata features of the exporter. Someone recently added a feature where any mesh custom properties get exported in the metadata. I would do a quick check it works for you, first, before breaking down and start python coding.

Ahh, that property is for shadow maps. That clears it up.

Someone recently added a feature where any mesh custom properties get exported in the metadata.

Hehe, that was me. I use empty meshes as markers where entities will spawn, and they need some extra properties. I could add a castShadows custom property…