Skip to content

Commit 39b05b4

Browse files
authored
Nodes: Renamed DFGApprox to DFG (#32399)
1 parent c745aee commit 39b05b4

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/Three.TSL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const BasicShadowFilter = TSL.BasicShadowFilter;
77
export const Break = TSL.Break;
88
export const Const = TSL.Const;
99
export const Continue = TSL.Continue;
10-
export const DFGApprox = TSL.DFGApprox;
10+
export const DFGLUT = TSL.DFGLUT;
1111
export const D_GGX = TSL.D_GGX;
1212
export const Discard = TSL.Discard;
1313
export const EPSILON = TSL.EPSILON;

src/nodes/TSL.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export * from './materialx/MaterialXNodes.js';
163163
export { default as BRDF_GGX } from './functions/BSDF/BRDF_GGX.js';
164164
export { default as BRDF_Lambert } from './functions/BSDF/BRDF_Lambert.js';
165165
export { default as D_GGX } from './functions/BSDF/D_GGX.js';
166-
export { default as DFGApprox } from './functions/BSDF/DFGApprox.js';
166+
export { default as DFGLUT } from './functions/BSDF/DFGLUT.js';
167167
export { default as F_Schlick } from './functions/BSDF/F_Schlick.js';
168168
export { default as Schlick_to_F0 } from './functions/BSDF/Schlick_to_F0.js';
169169
export { default as V_GGX_SmithCorrelated } from './functions/BSDF/V_GGX_SmithCorrelated.js';

src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import BRDF_GGX from './BRDF_GGX.js';
2-
import DFGApprox from './DFGApprox.js';
2+
import DFGLUT from './DFGLUT.js';
33
import { normalView } from '../../accessors/Normal.js';
44
import { positionViewDirection } from '../../accessors/Position.js';
55
import { EPSILON } from '../../math/MathNode.js';
@@ -19,8 +19,8 @@ const BRDF_GGX_Multiscatter = /*@__PURE__*/ Fn( ( { lightDirection, f0, f90, rou
1919
const dotNV = normalView.dot( positionViewDirection ).clamp();
2020

2121
// Precomputed DFG values for view and light directions
22-
const dfgV = DFGApprox( { roughness: _roughness, dotNV } );
23-
const dfgL = DFGApprox( { roughness: _roughness, dotNV: dotNL } );
22+
const dfgV = DFGLUT( { roughness: _roughness, dotNV } );
23+
const dfgL = DFGLUT( { roughness: _roughness, dotNV: dotNL } );
2424

2525
// Single-scattering energy for view and light
2626
const FssEss_V = f0.mul( dfgV.x ).add( f90.mul( dfgV.y ) );

src/nodes/functions/BSDF/DFGApprox.js renamed to src/nodes/functions/BSDF/DFGLUT.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const DATA = new Uint16Array( [
3232

3333
let lut = null;
3434

35-
const DFGApprox = /*@__PURE__*/ Fn( ( { roughness, dotNV } ) => {
35+
const DFGLUT = /*@__PURE__*/ Fn( ( { roughness, dotNV } ) => {
3636

3737
if ( lut === null ) {
3838

@@ -53,4 +53,4 @@ const DFGApprox = /*@__PURE__*/ Fn( ( { roughness, dotNV } ) => {
5353

5454
} );
5555

56-
export default DFGApprox;
56+
export default DFGLUT;

src/nodes/functions/BSDF/EnvironmentBRDF.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import DFGApprox from './DFGApprox.js';
1+
import DFGLUT from './DFGLUT.js';
22
import { Fn } from '../../tsl/TSLBase.js';
33

44
const EnvironmentBRDF = /*@__PURE__*/ Fn( ( inputs ) => {
55

66
const { dotNV, specularColor, specularF90, roughness } = inputs;
77

8-
const fab = DFGApprox( { dotNV, roughness } );
8+
const fab = DFGLUT( { dotNV, roughness } );
99
return specularColor.mul( fab.x ).add( specularF90.mul( fab.y ) );
1010

1111
} );

src/nodes/functions/PhysicalLightingModel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import BRDF_Lambert from './BSDF/BRDF_Lambert.js';
22
import BRDF_GGX from './BSDF/BRDF_GGX.js';
33
import BRDF_GGX_Multiscatter from './BSDF/BRDF_GGX_Multiscatter.js';
4-
import DFGApprox from './BSDF/DFGApprox.js';
4+
import DFGLUT from './BSDF/DFGLUT.js';
55
import EnvironmentBRDF from './BSDF/EnvironmentBRDF.js';
66
import F_Schlick from './BSDF/F_Schlick.js';
77
import Schlick_to_F0 from './BSDF/Schlick_to_F0.js';
@@ -571,7 +571,7 @@ class PhysicalLightingModel extends LightingModel {
571571

572572
const dotNV = normalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV
573573

574-
const fab = DFGApprox( { roughness, dotNV } );
574+
const fab = DFGLUT( { roughness, dotNV } );
575575

576576
const Fr = iridescenceF0 ? iridescence.mix( f0, iridescenceF0 ) : f0;
577577

utils/generateDFGLUT.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ ${rows.join( ',\n' )}
297297
298298
let lut = null;
299299
300-
const DFGApprox = /*@__PURE__*/ Fn( ( { roughness, dotNV } ) => {
300+
const DFG = /*@__PURE__*/ Fn( ( { roughness, dotNV } ) => {
301301
302302
if ( lut === null ) {
303303
@@ -318,14 +318,14 @@ const DFGApprox = /*@__PURE__*/ Fn( ( { roughness, dotNV } ) => {
318318
319319
} );
320320
321-
export default DFGApprox;
321+
export default DFG;
322322
`;
323323

324324
fs.writeFileSync( './src/renderers/shaders/DFGLUTData.js', webgl );
325325
console.log( 'Saved WebGL version to ./src/renderers/shaders/DFGLUTData.js' );
326326

327-
fs.writeFileSync( './src/nodes/functions/BSDF/DFGApprox.js', webgpu );
328-
console.log( 'Saved WebGPU version to ./src/nodes/functions/BSDF/DFGApprox.js' );
327+
fs.writeFileSync( './src/nodes/functions/BSDF/DFG.js', webgpu );
328+
console.log( 'Saved WebGPU version to ./src/nodes/functions/BSDF/DFG.js' );
329329

330330
}
331331

0 commit comments

Comments
 (0)