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

materialDatabase updates #660

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Changes from 1 commit
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
16 changes: 12 additions & 4 deletions example/materialDatabase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ACESFilmicToneMapping,
AgXToneMapping,
PerspectiveCamera,
Scene,
Box3,
Expand Down Expand Up @@ -48,7 +48,7 @@

// renderer
renderer = new WebGLRenderer( { antialias: true } );
renderer.toneMapping = ACESFilmicToneMapping;
renderer.toneMapping = AgXToneMapping;
document.body.appendChild( renderer.domElement );

// path tracer
Expand Down Expand Up @@ -181,14 +181,23 @@
material.roughness = 1.0;
material.ior = 1.5;
material.thickness = 1.0;
material.iridescence = 0.0;
material.iridescenceIOR = 1.0;
material.iridescenceThicknessRange = [ 0, 0 ]

Check failure on line 186 in example/materialDatabase.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (95% of all statements in the enclosing function have an explicit semicolon).

if ( info.specularColor ) material.specularColor.setRGB( ...info.specularColor );
if ( 'metalness' in info ) material.metalness = info.metalness;
if ( 'roughness' in info ) material.roughness = info.roughness;
if ( 'ior' in info ) material.ior = info.ior;
if ( 'transmission' in info ) material.transmission = info.transmission;
if ( 'thinFilmThickness' in info ) {

material.iridescence = 1.0;
material.iridescenceIOR = info.thinFilmIor;
material.iridescenceThicknessRange = [ info.thinFilmThickness, info.thinFilmThickness ];

}
if ( material.transmission ) {

Check failure on line 200 in example/materialDatabase.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected blank line before this statement

if ( info.color ) material.attenuationColor.setRGB( ...info.color );
material.attenuationDistance = 200 / info.density;
Expand All @@ -199,8 +208,7 @@

}

const cleanName = info.name.replace( /\s+/g, '-' ).replace( /[()]+/g, '' );
imgEl.src = `https://physicallybased.info/reference/render/${ cleanName }-cycles.png`;
imgEl.src = info.reference[0];

Check failure on line 211 in example/materialDatabase.js

View workflow job for this annotation

GitHub Actions / build (16.x)

A space is required after '['

Check failure on line 211 in example/materialDatabase.js

View workflow job for this annotation

GitHub Actions / build (16.x)

A space is required before ']'

}

Expand Down
Loading