godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.46k stars 21.07k forks source link

No way to disable casting of shadows on gridmap #17005

Closed Scott3730 closed 5 years ago

Scott3730 commented 6 years ago

Godot version: 3.0.1 rc

OS/device including version: Windows 10

Issue description: I'm attempting to stop meshes in a gridmap from casting shadows. The only way to do this that I'm aware of is via a property on the GeometryInstance, which does not appear to be exposed through the gridmap API at all.

Steps to reproduce: Create a gridmap the usual way, supply it with a meshlib theme, and try to stop it from casting shadows on other objects.

reduz commented 6 years ago

There is now an option to not receive shadows in the material, so i guess this may suffice?

akien-mga commented 5 years ago

No answer, so assuming what reduz mentioned is sufficient.

Janders1800 commented 1 year ago

Resurrecting this post because I'm encountering this problem.

Godot 3.X: Wen lighting GridMaps sometimes it is necessary to disable shadows if you are working with Lightmaps. In this example I need to disable the GridMap shadows wen executing the game so the character can have dynamic shadows casting on the baked GridMap.

This is an example of the GridMap casting unwanted shadows. Screenshot from 2023-08-15 11-37-17

Wen the desired outcome would be something more like this + character shadows that can be accomplished disabling the Gridmap shadows. Screenshot from 2023-08-15 11-38-57

reduz solution doesn't work because disabling receive shadows in the material will also disable other shadows cast by other objects, same as shown in the second screenshot.

Calinou commented 1 year ago

@Janders1800 This is already being tracked in https://github.com/godotengine/godot/issues/78344.

In this example I need to disable the GridMap shadows wen executing the game so the character can have dynamic shadows casting on the baked GridMap.

I find it surprising you have to do this. If you disable shadows on the GridMap, the directional light will shine through, which breaks the point of baking lightmaps in the first place.

Instead, you have two solutions:

Janders1800 commented 1 year ago

Neither are good solutions. I'm using 3.X, I don't know if the option is available on 4.X but it isn't on 3.X.