1
1
import {
2
- ACESFilmicToneMapping ,
2
+ AgXToneMapping ,
3
3
PerspectiveCamera ,
4
4
Scene ,
5
5
Box3 ,
@@ -48,7 +48,7 @@ async function init() {
48
48
49
49
// renderer
50
50
renderer = new WebGLRenderer ( { antialias : true } ) ;
51
- renderer . toneMapping = ACESFilmicToneMapping ;
51
+ renderer . toneMapping = AgXToneMapping ;
52
52
document . body . appendChild ( renderer . domElement ) ;
53
53
54
54
// path tracer
@@ -181,12 +181,22 @@ function applyMaterialInfo( info, material ) {
181
181
material . roughness = 1.0 ;
182
182
material . ior = 1.5 ;
183
183
material . thickness = 1.0 ;
184
+ material . iridescence = 0.0 ;
185
+ material . iridescenceIOR = 1.0 ;
186
+ material . iridescenceThicknessRange = [ 0 , 0 ] ;
184
187
185
188
if ( info . specularColor ) material . specularColor . setRGB ( ...info . specularColor ) ;
186
189
if ( 'metalness' in info ) material . metalness = info . metalness ;
187
190
if ( 'roughness' in info ) material . roughness = info . roughness ;
188
191
if ( 'ior' in info ) material . ior = info . ior ;
189
192
if ( 'transmission' in info ) material . transmission = info . transmission ;
193
+ if ( 'thinFilmThickness' in info ) {
194
+
195
+ material . iridescence = 1.0 ;
196
+ material . iridescenceIOR = info . thinFilmIor ;
197
+ material . iridescenceThicknessRange = [ info . thinFilmThickness , info . thinFilmThickness ] ;
198
+
199
+ }
190
200
191
201
if ( material . transmission ) {
192
202
@@ -199,8 +209,7 @@ function applyMaterialInfo( info, material ) {
199
209
200
210
}
201
211
202
- const cleanName = info . name . replace ( / \s + / g, '-' ) . replace ( / [ ( ) ] + / g, '' ) ;
203
- imgEl . src = `https://physicallybased.info/reference/render/${ cleanName } -cycles.png` ;
212
+ imgEl . src = info . reference [ 0 ] ;
204
213
205
214
}
206
215
0 commit comments