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

MeshPhysicalMaterial: Add clearcoatMap and clearcoatRoughnessMap. #18769

Merged
merged 2 commits into from
Mar 3, 2020

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Feb 28, 2020

Core parts of #18682, without the GLTFLoader changes for now. Note that .x and .y channels are used for the two textures respectively.

@mrdoob mrdoob added this to the r115 milestone Feb 28, 2020
@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 28, 2020

It would be also good to enhance MaterialLoader and Material.toJSON() so both properties can be serialized/deserialized properly.

if ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap );
if ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );

if ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;
if ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;
if ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) {
data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid;
data.clearcoatNormalScale = this.clearcoatNormalScale.toArray();
}

@donmccurdy
Copy link
Collaborator Author

Done ✅

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 29, 2020

Reminder: Docs need an update, too. But it's okay to do this in a later PR.

@donmccurdy
Copy link
Collaborator Author

Yep! I'll get the docs later.

@donmccurdy
Copy link
Collaborator Author

It's also lacking an example, but I was just planning to do that with the glTF portion.

@mrdoob mrdoob merged commit 17702e5 into mrdoob:dev Mar 3, 2020
@mrdoob
Copy link
Owner

mrdoob commented Mar 3, 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