Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set multimesh instance from VoxelInstancer to not cast shadows #729

Open
grasspixel opened this issue Feb 9, 2025 · 2 comments
Open

Set multimesh instance from VoxelInstancer to not cast shadows #729

grasspixel opened this issue Feb 9, 2025 · 2 comments

Comments

@grasspixel
Copy link

I'm using a VoxelInstancer to spread stylized grass on a terrain. I can't seem to turn off "Cast Shadows", either in the editor or in code.

In the editor, I see this:

Image

As you can see, the whole "Scene properties" submenu is grayed out and I can't click on the Cast Shadow select input.

I also tried turning off shadows via code:
`extends VoxelInstancer

func _ready() -> void:
library.get_item(library.find_item_by_name("grass")).cast_shadow = -1
print("did it")
`

This doesn't cause any errors, and "did it" gets printed, but it doesn't seem to affect the shadows either (I've tried setting cast_shadow to all values between -1 and 4).

For reference in case it helps, here's an extremely close up picture in of the shadows I'm seeing under the grass:
Image

Would love any advice on the best way to generate instances that don't cast shadows using the VoxelInstancer!

P.S. This is such an incredible tool, thanks so much for building it! Really blown away after having tried various permutations of procedural terrain + foliage generators, amazing work!

@Zylann
Copy link
Owner

Zylann commented Feb 9, 2025

You have chosen to use the scene property to setup this item, so you should change options in that scene. That's why the properties are greyed out, it's because they all come from the scene and are only shown for reference.
The current implementation makes the scene take precedence over manual settings. The cast_shadow_settings in code does not work because of that.

@grasspixel
Copy link
Author

Ah, very obvious that's how it'd work now that you've explained it! Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants