FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove attributes array and cleanup Shader by mrxz · Pull Request #5310 · aframevr/aframe · GitHub

Remove attributes array and cleanup Shader - #5310

Merged
dmarcos merged 2 commits into
aframevr:masterfrom
mrxz:cleanup-register-shader
Mar 12, 2024
Merged

Remove attributes array and cleanup Shader#5310
dmarcos merged 2 commits into
aframevr:masterfrom
mrxz:cleanup-register-shader

Conversation

mrxz commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

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

Comment thread src/core/shader.js

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 commented Mar 10, 2024

Copy link
Copy Markdown
Member

Looking at this now. Nothing pending here?

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

mrxz commented Mar 11, 2024
edited
Loading

Copy link
Copy Markdown
Contributor Author

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

dmarcos commented Mar 12, 2024

Copy link
Copy Markdown
Member

Thanks!

dmarcos merged commit d94bf47 into aframevr:master Mar 12, 2024
vincentfretin added a commit to vincentfretin/moonrider that referenced this pull request Apr 19, 2026
- panel-shader.js, supercurve-shader.js: A-Frame aframevr/aframe#5310
  removed updateVariables and the attributes array from the Shader
  base class. Delegate the uniform-update work to the inherited base
  update via the prototype chain so our registerPanel/registerCurve
  side effect still runs.
- trail.js: THREE.VertexColors was removed in three.js r125 — the
  material property is now a plain boolean.
- scene.html: set renderer="colorManagement: false" so colors and
  textures keep the pre-1.3.0 behavior our custom GLSL was authored
  against. Without this A-Frame enables THREE.ColorManagement and
  switches outputColorSpace to sRGB, which throws off every shader
  that mixes raw color uniforms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL