-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Conversation
|
||
varying vec4 vColor; | ||
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
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?