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

Add a material flag to set a specific material to not receive decals #9055

Open
FoxdanceMedia opened this issue Feb 8, 2024 · 1 comment · May be fixed by godotengine/godot#89235
Open

Comments

@FoxdanceMedia
Copy link

FoxdanceMedia commented Feb 8, 2024

Describe the project you are working on

A first person horror game in the style of Resident Evil 7 or Amnesia: The Bunker, which features a single unkillable enemy that the player has to manage.

Describe the problem or limitation you are having in your project

This enemy in my game changes shape sometimes and I'm interested in using decals to achieve certain visual effects. There are certain parts of its mesh which use a separate material that should not receive these decals.

I know you can use cull mask to make decals not appear on certain meshes, but I'm not aware of any way to set a specific material to not be able to receive decals, for developers like me who may want to have two separate materials on the same mesh and only have one of them be capable of receiving decals while the other does not.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I know it's already possible to set a specific material to not cast shadows, so perhaps you could add a similar flag to have a material not receive decals.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

In the inspector there would be an option you could check to make a material not receive decals. I'm afraid I'm not familiar enough with the backend of Godot's editor to describe how I would do this with code.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I believe you could write a custom shader to achieve this, but it would be very convenient if we could disable decals as easily as disabling shadows and other similar material options we have already.

Is there a reason why this should be core and not an add-on in the asset library?

It's a relatively standard feature that is similar to other functionality that already exists in Godot.

@FoxdanceMedia
Copy link
Author

I apologize in advance if there's already an easy way to do this, I asked on the Godot subreddit and no one else seemed to know of one.

@Calinou Calinou changed the title Add a material flag to set a specific material to not receive decals? Add a material flag to set a specific material to not receive decals Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants