Skip to content

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;
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.

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.

3 participants