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

Small Improvements to Avatar Dissolve #9023

Merged
merged 3 commits into from Oct 16, 2023

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
Member

@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
Collaborator

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
11 of 13 checks passed
@HexaField HexaField deleted the Daniel_Avatar_Dissolve_Improvement branch October 16, 2023 00:17
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.

None yet

3 participants