-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Modify newly generated custom shaders on AnimatedSprite3D to preserve built-in spritesheet animation #4607
Comments
This sounds like a bug. |
Related to godotengine/godot#61563. |
+1 for this. Godot currently seems to lack an option of adding a shader on a Sprite3D or AnimatedSprite3D, and overriding the material breaks sprite sheet animations since there's no way to access and modify current frame's texture. |
UPDATE: I've found a workaround to modify AnimatedSprite3D:
Alternatively, you can apply canvas_item shader to your AnimatedSprite and simply use it as albedo inside SpatialMaterial of MeshInstance. |
I use shaders on AnimatedSprite3D nodes and have done for a while. Is there a specific use case it doesn't work for? I have 1 image texture as a spritesheet for a given SpriteFrames resource. I use the same image texture as the albedo texture of the shader. The AnimatedSprite3D now displays the frames of the animation as normal, but they are rendered via the shader. Now I can do what I like to the image in the shader and its applied to the current frame of the animation. I guess this doesn't work if you have more than one spritesheet texture in a single SpriteFrames resource. |
3D shadows are working? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Actually this works, thanks! If you have the same texture in AnimatedSprite3D and in your shader, so you have a shader like one below - it works with animation. I am still figuring out why the colors are dull though
|
Add |
Thanks! I found it out the other way, but that's exactly what was missing |
This comment was marked as off-topic.
This comment was marked as off-topic.
@nakano15 Please don't bump issues without contributing significant new information. Use the 👍 reaction button on the first post instead. |
In a recent Reddit discussion about Sprite3D shaders, I've been encouraged to post the solution I'm currently using that doesn't involve viewports. Here is the class that tracks animation changes. I'm a bit wary about making proposals, being quite new to Godot, but I hope posting this will help those who search for solutions in the future, even if it turns out to be a backwards approach. Still, I do wish accessing Sprite3D's textures didn't require workarounds, so I hope this issue gets traction. |
Describe the project you are working on
I'm creating 2.5D game with 3Danimatedsprites and I need some shaders like swaying grass and distortion effect on the Player.
Describe the problem or limitation you are having in your project
Shaders do not provide for working with 3Danimatedsprite. Information about SpriteFrames disappears and 3DAnimatedSprite becomes blank
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The only idea I have is that when you create a shader, it will be overlap the existing 3Danimatedsprite texture like 2Danimatedsprite.
OR
Just copy existing shader of 3Danimated sprite and then modify it.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Shader will work with 3D sprite like 2D sprite
If this enhancement will not be used often, can it be worked around with a few lines of script?
If you do it through code, it will be very long and very inconvenient
Is there a reason why this should be core and not an add-on in the asset library?
This feature should have been there from the beginning
The text was updated successfully, but these errors were encountered: