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

Clarify where INSTANCE_CUSTOM can be accessed #102338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tetrapod00
Copy link
Contributor

Closes godotengine/godot-docs#10604.

INSTANCE_CUSTOM is only available in the vertex() function. While this is sufficiently documented by the fact that it is listed in the vertex built-in table and not the fragment built-in table, this is easy to miss (see also #57584).

@tetrapod00 tetrapod00 added this to the 4.x milestone Feb 2, 2025
@tetrapod00 tetrapod00 requested a review from a team February 2, 2025 20:38
@tetrapod00 tetrapod00 requested a review from a team as a code owner February 2, 2025 20:38
@@ -87,7 +87,7 @@
Sets custom data for a specific instance. [param custom_data] is a [Color] type only to contain 4 floating-point numbers.
[b]Note:[/b] Each number is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method.
For the custom data to be used, ensure that [member use_custom_data] is [code]true[/code].
This custom instance data has to be manually accessed in your custom shader using [code]INSTANCE_CUSTOM[/code].
This custom instance data has to be manually accessed in your custom shader using [code]INSTANCE_CUSTOM[/code] in the [code]vertex()[/code] function, or in the [code]fragment()[/code] function using a varying.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This custom instance data has to be manually accessed in your custom shader using [code]INSTANCE_CUSTOM[/code] in the [code]vertex()[/code] function, or in the [code]fragment()[/code] function using a varying.
This custom instance data has to be manually accessed in your custom shader using [code]INSTANCE_CUSTOM[/code] in the [code]vertex()[/code] function.

Alternate, if we want to assume that users already know their way around shaders and want to avoid tutorializing in the class reference.

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

Successfully merging this pull request may close these issues.

INSTANCE_CUSTOM information regarding accesibility only in vertex shader.
1 participant