This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I am creating a tree and was wondering if it is possible to apply a material while at the same time having a vertex shader that makes the tree sway forwards and backwards a bit.

My problem is that i can't apply both the shader and material at the same time.

Godot version 3.3.3 stable mono
in Engine by (15 points)

1 Answer

+1 vote
Best answer

It's not possible to use vertex() and fragment() functions from different shaders yet.

However, you can convert a SpatialMaterial resource to a ShaderMaterial. First, configure your material so that the correct shader version is used (with the features you need), then use this button in the SpatialMaterial resource dropdown by clicking on the arrow on the right of the resource:

You can then click the ShaderMaterial resource, edit the shader and modify its vertex() function.

by (12,908 points)
selected by

Thank you so much, this has been bugging me for so long!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.