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.
+1 vote

I'm using ArrayMesh to generate a mesh, but now I would like to pass some custom data only available while generating the mesh into a custom shader. ArrayMesh only provides the default position, color, uv, etc. But i would like to pass something other than these values into the shader (namely a single int). From my OpenGL experience, I recall you could basically dump whatever data you need into an AttribArray and send it to the shader pipeline. Is anything like this possible within godot?

in Engine by (69 points)

1 Answer

0 votes

Uniforms are what you're looking for.
You can then access your parameters through code with setshaderparam().

by (24 points)

Sadly uniforms are an identical value per material instance. What I need is a way to pass custom vertex specific data to the shader, like the position, normal or UV.

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.