-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Implement 2D instance uniforms #99230
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
Implement 2D instance uniforms #99230
Conversation
|
Can you link that original PR? Is this new PR meant to supersede it, or it's a follow-up and KoBeWi's PR needs to be merged first? |
It's the follow-up PR to #97058 but it is in VERY early stages. I am trying to wrap my head around the code. Clay gave me instructions on how it could be done for the compatability renderer. All the rest is already done |
6f26927 to
e77c9a8
Compare
e77c9a8 to
2365b66
Compare
|
I started writing up what to do, then I realized it was less work for me to just show you, so here is a patch that gets 2D instance uniforms working in 2D. 0001-Finish-GLES3-support.patch The final piece before this is ready is getting it to work with the "use_parent_material" property. CanvasItems often inherit the material from their parent. Currently it mostly works, but the editor doesn't expose the instance property for updating so you can't set the instance uniform in the editor. |
2365b66 to
8cf5298
Compare
Thank you! I applied your patch except for this part as I couldn't figure out where this goes: material_storage->shaders.canvas_shader.version_set_uniform(CanvasShaderGLES3::SPECULAR_SHININESS_IN, state.canvas_instance_batches[i].specular_shininess, shader_version, variant, specialization); |
214632e to
678adc6
Compare
678adc6 to
c399835
Compare
|
Updated with all feedback. Once the code changes are approved I will squash them so we have one commit at the end. The current two commits are for easier checking of the changes I made versus the previous authors made. Will need to put all previous authors in the commit description as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also suggest touching on the descriptions of the equivalent methods for instance geometry, so that they're consistent with the ones added in this PR (which are slightly better formatted). But it doesn't have to be done in this PR.
c399835 to
1c1f66f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected in all rendering methods.
Testing project: test_pr_99230.zip
|
I'd like to test this, is it possible to get those conflicts resolved? |
1c1f66f to
73ec629
Compare
|
@huwpascoe Conflicts resolved. Be aware that currently the editor doesn't show the parent material properties when |
I didn't even know that was a feature....well I remember enough about my own work to fix that! @paddy-exe Here is a patch that implements the parent materials. |
73ec629 to
40cf1d8
Compare
|
Alright, patch applied. Works great. Thank you for the assistance with this @huwpascoe. Squashed into one commit. Adjusted the code to AThousandShip's codestyle feedback. |
40cf1d8 to
a1f86f0
Compare
Co-authored-by: kobewi <[email protected]> Co-authored-by: yesfish <[email protected]> Co-authored-by: Álex Román Núñez <[email protected]>
a1f86f0 to
ceefc0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Tested locally and confirmed it is still working including with use_parent_material. I think it is ready to merge to get broader testing!!
|
Thanks! |
Reflects changes as of Godot 4.4 godotengine/godot#99230
Adds support for 2d instance shader parameters. Cherrypicked the original PR as first commit.
Supersedes #97058
Fixes #62943
Also works with
use_parent_material:Testing project (taken from original PR):
test_pr_97058.zip