Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Conversation

DanielBelmes
Copy link
Contributor

@DanielBelmes DanielBelmes commented Oct 9, 2023

Summary

Removed some code that was more specific to a general dissolve effect. Not necessary for Avatars since they should always have textures and uvs. Furthermore, I realized threejs is already gonna be passing in the map uniform. We don't want to enable it through USE_MAP though as it breaks some shader outputs. But if we just define the uniform ourselves then we aren't duplicating any data and we're being slightly more efficient.

Explanation

🤖 Generated by Copilot at c2312c5

  • Simplify and optimize the avatar dissolve effect shader code by removing unnecessary uniforms, conditionals, and variables that depend on the uv attribute or the color uniform. (link, link, link, link, link, link)
  • Use the map uniform directly as the original texture of the object before the dissolve effect, instead of assigning it to another uniform called origin_texture. (link, link)
  • Use the vUv3 varying as the texture coordinates for sampling the map uniform and the dissolve_texture uniform, instead of checking for the uv attribute in the object geometry. (link, link)
  • Remove the unused shader code for the dissolve effect without a texture map, which was stored in the fragmentColorShader variable. (link, link)
  • Remove the unused shader code for the vertex shader without the uv attribute, which was stored in the vertexNonUVShader variable. (link)
  • Remove the unused uniforms color and origin_texture from the common shader code for the dissolve effect, which was stored in the fragmentHeaderShader variable. (link)

🤖 Generated by Copilot at c2312c5

Burn the avatar, dissolve the flesh
No more uniforms, no more varyings
Simplify the shader, use the vUv3
Texture map the fire, unleash the chaos

Copy link
Contributor

@HexaField HexaField left a comment

Choose a reason for hiding this comment

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

Have you tested this works with UVOL?

@DanielBelmes
Copy link
Contributor Author

Have you tested this works with UVOL?

@HexaField how would I do so? Do I need a .uvol avatar uploaded somewhere?

@CITIZENDOT
Copy link
Contributor

On dev, UVOL's dissolve effect is broken long time ago (even before UVOL2). It's because, UVOL package overwrites the mesh.material during playback. Hence, dissolveComponent's material is not used, even after starting loading effect.

Other than that, this commit did not break anything w.r.t UVOL. Avatar loading effect is working as usual.

@HexaField HexaField self-requested a review October 15, 2023 23:54
@HexaField HexaField merged commit 69c4786 into dev Oct 16, 2023
@HexaField HexaField deleted the Daniel_Avatar_Dissolve_Improvement branch October 16, 2023 00:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants