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

Expose METALLIC in the light() function for spatial shaders #1604

Closed
pezcode opened this issue Oct 3, 2020 · 1 comment · Fixed by godotengine/godot#42548
Closed

Expose METALLIC in the light() function for spatial shaders #1604

pezcode opened this issue Oct 3, 2020 · 1 comment · Fixed by godotengine/godot#42548

Comments

@pezcode
Copy link

pezcode commented Oct 3, 2020

Describe the project you are working on:
Writing a spatial shader with custom lighting code

Describe the problem or limitation you are having in your project:
light() doesn't expose a METALLIC built-in which is needed for correct lighting calculation.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
My workaround is using metallic which is a variable in Godot's shader code. This could break with any other version of Godot, having a proper built-in would be preferrable.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
This would just be another built-in defined exactly like ROUGHNESS.

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

Is there a reason why this should be core and not an add-on in the asset library?:
It seems like a nice minor QoL improvement, and I don't know enough about add-ons to say if replacing the core shaders is possible or feasible.

Thanks!

PS: I'm not exactly familiar with Godot internals, but this seems simple enough that I could send a PR myself, if this is deemed useful.

@clayjohn
Copy link
Member

clayjohn commented Oct 4, 2020

@Calinou Calinou changed the title Expose METALLIC in light() for spatial shaders Expose METALLIC in the light() function for spatial shaders Oct 8, 2020
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