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

Allow SurfaceTool to add data to INSTANCE_CUSTOM for shader #31299

Closed
orosmatthew opened this issue Aug 11, 2019 · 1 comment
Closed

Allow SurfaceTool to add data to INSTANCE_CUSTOM for shader #31299

orosmatthew opened this issue Aug 11, 2019 · 1 comment

Comments

@orosmatthew
Copy link
Contributor

I am trying to write a shader and need to send just 3 more values to the shader for each vertex (which would massively simplify the whole process). The docs say that this value is mostly used for particles but since I am not using particles, it would be great if I could use those values instead for a different purpose. It would be optimal if I could set these values using the SurfaceTool

@clayjohn
Copy link
Member

I am assuming you figured out the correct answer yourself. But as a note for others who may struggle with the same problem. INSTANCE_CUSTOM is only used by Particles and MultiMeshes. To set it yourself, you can use the MultiMesh function set_instance_custom_data. The reason it can't be accessed through the surfacetool is that the surfacetool sets per-vertex parameters on the surface, while INSTANCE_CUSTOM is a per-instance variable that can only be set on MultiMeshes.

Hope that helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants