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

Prefix shader uniforms with "shader_parameter/". #64092

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

nathanfranke
Copy link
Contributor

@nathanfranke nathanfranke commented Aug 8, 2022

This may have been a regression from #62972
Assuming this is not intentional, since shader uniforms like shader collide with existing properties, causing an invalid state.

CC @Chaosus

Correctly fixed the properties on my project, although note shader params set between the merge of #62972 and this PR won't be auto corrected. These are now also corrected for.
image

@Chaosus
Copy link
Member

Chaosus commented Aug 8, 2022

Did you test group uniforms with that fix?

@nathanfranke
Copy link
Contributor Author

nathanfranke commented Aug 8, 2022

Ah, good idea. Almost works, but I think I need to add the hint string for all generated groups:
image

Edit: Corrected
image

scene/resources/shader.h Outdated Show resolved Hide resolved
@TokisanGames
Copy link
Contributor

note shader params set between the merge of #62972 and this PR won't be auto corrected.

Does this mean materials created within the last 3 weeks and counting, (since this isn't merged yet) will be broken again after this is merged? I have over 400 materials and have been porting my project during the last 3 weeks. The current materials have no shader_param/ prefix, so there's nothing to search and replace. Why isn't this PR extended to read the current working parameters for backwards compatibility. There's already backward compatible code in there. The extension code could be taken out once gd4 hit stable.

@nathanfranke
Copy link
Contributor Author

nathanfranke commented Aug 16, 2022

@tinmanjuggernaut Added compatibility code.

Once this PR is merged, I'll make a follow-up draft PR to remove the legacy compatibility (I propose removing both "param/" and "" prefixes).

@akien-mga
Copy link
Member

This will likely need to be changed after #64952.

@nathanfranke nathanfranke requested review from a team as code owners August 29, 2022 10:40
@nathanfranke nathanfranke marked this pull request as draft August 29, 2022 10:41
@nathanfranke nathanfranke changed the title Prefix shader uniforms with "shader_param/". Prefix shader uniforms with "shader_parameter/". Aug 29, 2022
@TokisanGames
Copy link
Contributor

I'd introduce a deprecated phase. Get all the renames in by beta. All old names still work, but are deprecated, and are documented as such. Then they'll be removed by 4.0, or 4.1. 4.0 isn't going to be any time soon, so might be fine as long as it's clearly communicated.

The problem isn't the renames so much, it is the lack of documentation noting the changes in a centralized place, attached to each changing PR. Us game devs just get to "discover" the renames when our project doesn't work. Each is an unpleasant surprise.

@Zireael07
Copy link
Contributor

Yep, and a dedicated documentations page listing changes in ONE place. I've been using the mega-ass renames tracker on GitHub, but even that misses some...

@Calinou
Copy link
Member

Calinou commented Aug 29, 2022

Yep, and a dedicated documentations page listing changes in ONE place. I've been using the mega-ass renames tracker on GitHub, but even that misses some...

This is already planned: godotengine/godot-docs#4960

I suppose we can generate a reStructuredText table with all renames based on the 3to4 conversion code. Some notes will also need to be manually written at the top of the page, as some things can't be converted automatically.

@TokisanGames
Copy link
Contributor

That conversion code is incomplete. Doesn't even touch shaders for instance, and there's countless more things lacking.

@akien-mga
Copy link
Member

This can now be rebased.

@nathanfranke nathanfranke marked this pull request as ready for review September 3, 2022 01:45
@clayjohn
Copy link
Member

This looks good to me. But I am unfamiliar with this system. Would be good to have approval from @Chaosus

@Chaosus
Copy link
Member

Chaosus commented Sep 14, 2022

The category "Shader Uniforms" for the instance uniforms should be renamed:

image

so the tweener code should looks like:
create_tween().tween_property(child, "shader_parameter/test", Vector3(1, 0, 0), 1.0) instead of create_tween().tween_property(child, "shader_uniforms/test", Vector3(1, 0, 0), 1.0)

Copy link
Member

@Chaosus Chaosus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, it can be done later ^^ I think it's good for now

@akien-mga akien-mga merged commit b094e4f into godotengine:master Sep 14, 2022
@akien-mga
Copy link
Member

Thanks!

@nathanfranke nathanfranke deleted the shader-uniform branch September 14, 2022 20:30
reduz added a commit to reduz/godot that referenced this pull request Jan 21, 2023
This PR is a follow up to godotengine#64092, which fixed important issues but it was implemented in an overly complex and inefficient way (because it forced the default code path to always go through string operations).
This cleans up all the shader parameter code.

This fixes godotengine#54336. Also fixes godotengine#56219 because, as the new code never queries the RenderingServer on load, potential deadlocks are avoided.

**NOTE**: materials saved between godotengine#62972 and godotengine#64092 will no longer work and will need to be resaved in an earlier version.
Streq pushed a commit to Streq/godot that referenced this pull request Feb 9, 2023
This PR is a follow up to godotengine#64092, which fixed important issues but it was implemented in an overly complex and inefficient way (because it forced the default code path to always go through string operations).
This cleans up all the shader parameter code.

This fixes godotengine#54336. Also fixes godotengine#56219 because, as the new code never queries the RenderingServer on load, potential deadlocks are avoided.

**NOTE**: materials saved between godotengine#62972 and godotengine#64092 will no longer work and will need to be resaved in an earlier version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants