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

Remove attributes array and cleanup Shader #5310

Merged
merged 2 commits into from
Mar 12, 2024

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

var key;
var schema = this.schema;
var variables = {};
var varType;

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
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
1 check passed
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.

None yet

4 participants