Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 9, 2020

This PR makes Material.vertexColors to a boolean. However, it's still possible for backwards compatibility reasons to use the old style by assigning one of the constants THREE.NoColors, THREE.VertexColors and THREE.FaceColors.

More information: #14788 (comment)

@donmccurdy
Copy link
Collaborator

donmccurdy commented Feb 10, 2020

Agreed on this change!

Do you want the strict .vertexColors === true checks in this PR, though? Just looking for truthiness would be more backward-compatible.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 10, 2020

Just looking for truthiness would be more backward-compatible.

Makes totally sense! I've changed Projector and SVGRenderer accordingly.

@donmccurdy
Copy link
Collaborator

Does Geometry + FaceColors do anything a this point? With the former deprecated I don't think we want to keep FaceColors in the Material API, but just want to know what to expect for the next release.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 10, 2020

Does Geometry + FaceColors do anything a this point?

At least not in context of WebGLRenderer. It's just important where you define color values in Face3.

var vertexColors = face.vertexColors;
if ( vertexColors.length === 3 ) {
this.colors.push( vertexColors[ 0 ], vertexColors[ 1 ], vertexColors[ 2 ] );
} else {
var color = face.color;
this.colors.push( color, color, color );
}

SVGRenderer and Projector were the last classes performing checks on THREE.FaceColors. However, both treat THREE.FaceColors and THREE.VertexColors equally since a while. They do not really support vertex colors because of missing color interpolation. They expect vertex color values to be equal for a single triangle.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 10, 2020

TBH, I would remove Projector and SVGRenderer at some point. Especially since SVGLoader can be used now to render SVG files with WebGL.

@donmccurdy
Copy link
Collaborator

At least not in context of WebGLRenderer. It's just important where you define color values in Face3.

Ok, thanks!

@mrdoob mrdoob added this to the r114 milestone Feb 10, 2020
@mrdoob
Copy link
Owner

mrdoob commented Feb 10, 2020

Nice clean up!

@mrdoob
Copy link
Owner

mrdoob commented Feb 10, 2020

TBH, I would remove Projector and SVGRenderer at some point. Especially since SVGLoader can be used now to render SVG files with WebGL.

Well, the idea of SVGRenderer is to produce SVGs, which I've seem people using for creating vector illustrations for books.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 10, 2020

Well, the idea of SVGRenderer is to produce SVGs, which I've seem people using for creating vector illustrations for books.

Okay, that's of course a valid use case for the renderer.

@mrdoob mrdoob merged commit 7a3d9d9 into mrdoob:dev Feb 10, 2020
@mrdoob
Copy link
Owner

mrdoob commented Feb 10, 2020

Thanks!

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