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

WebGLRenderer: Refactored vertex color alpha code #21530

Merged
merged 3 commits into from
Mar 27, 2021
Merged

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Mar 26, 2021

Related issue: #20975

Description

Refactored some of the logic and glsl defines in the vertex color alpha code.

@chubei @Mugen87 What do you guys think?

@mrdoob mrdoob added this to the r127 milestone Mar 26, 2021

varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is kind of ugly. Sure needs another clean up pass in the future.

@@ -1466,7 +1466,7 @@ function WebGLRenderer( parameters ) {
const environment = material.isMeshStandardMaterial ? scene.environment : null;
const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : _currentRenderTarget.texture.encoding;
const envMap = cubemaps.get( material.envMap || environment );
const vertexAlpha = ( ( object.isMesh || object.isLine || object.isPoints ) && object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4 );
const vertexAlphas = material.vertexColors === true && object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4;
Copy link
Owner Author

Choose a reason for hiding this comment

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

@Mugen87 This should work then, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good!

@mrdoob mrdoob merged commit a80cccc into dev Mar 27, 2021
@mrdoob mrdoob deleted the vertex_color_alpha branch March 27, 2021 19:59
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.

2 participants