Skip to content

Conversation

@mrxz
Copy link
Contributor

@mrxz mrxz commented Jun 16, 2023

Description:
The property combination is: "attribute" doesn't really do anything any more as attributes don't have to be manually specified for (Raw)ShaderMaterial. This PR removes it from the code and cleans up the Shader file and corresponding test cases.

Changes proposed:

  • Remove attributes and special handling of is: "attribute" in shader.js


for (key in schema) {
if (schema[key].is !== type) { continue; }
if (schema[key].is !== 'uniform') { continue; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should 'is' property be removed from schema and all shaders updated accordingly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did contemplate that as well, but I think it's safer to leave it. It can also serve some purpose. Say for example you rename or deprecate a uniform on your shader. Now you can add a property to the schema under the old name, but not mark it as a uniform. By overloading the update method you can then print a warning message and delegate to the old behaviour without it ending up as a uniform.

@dmarcos
Copy link
Member

dmarcos commented Mar 10, 2024

Looking at this now. Nothing pending here?

@mrxz mrxz force-pushed the cleanup-register-shader branch from 90dab37 to ac0fa06 Compare March 11, 2024 09:50
@mrxz
Copy link
Contributor Author

mrxz commented Mar 11, 2024

@dmarcos Rebased on master, the msdf and sdf shaders started using initVariables (#5409), so updated those.

@dmarcos
Copy link
Member

dmarcos commented Mar 12, 2024

Thanks!

@dmarcos dmarcos merged commit d94bf47 into aframevr:master Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants