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

LDrawLoader: remove phong material use #22973

Merged
merged 2 commits into from
Dec 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions examples/jsm/loaders/LDrawLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Loader,
Matrix4,
Mesh,
MeshPhongMaterial,
MeshStandardMaterial,
ShaderMaterial,
UniformsLib,
Expand Down Expand Up @@ -1201,14 +1200,8 @@ class LDrawLoader extends Loader {

case FINISH_TYPE_PEARLESCENT:

// Try to imitate pearlescency by setting the specular to the complementary of the color, and low shininess
const specular = new Color( colour );
const hsl = specular.getHSL( { h: 0, s: 0, l: 0 } );
hsl.h = ( hsl.h + 0.5 ) % 1;
hsl.l = Math.min( 1, hsl.l + ( 1 - hsl.l ) * 0.7 );
specular.setHSL( hsl.h, hsl.s, hsl.l );

material = new MeshPhongMaterial( { color: colour, specular: specular, shininess: 10, reflectivity: 0.3 } );
// Try to imitate pearlescency by making the surface glossy
material = new MeshStandardMaterial( { color: colour, roughness: 0.3, metalness: 0.25 } );
break;

case FINISH_TYPE_CHROME:
Expand Down