Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions examples/webgpu_centroid_sampling.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@

};

const withFlatFirstShader = createShader( THREE.InterpolationSamplingType.FLAT, THREE.InterpolationSamplingMode.FLAT_FIRST );
const withFlatEitherShader = createShader( THREE.InterpolationSamplingType.FLAT, THREE.InterpolationSamplingMode.FLAT_EITHER );
const withFlatFirstShader = createShader( THREE.InterpolationSamplingType.FLAT, THREE.InterpolationSamplingMode.FIRST );
const withFlatEitherShader = createShader( THREE.InterpolationSamplingType.FLAT, THREE.InterpolationSamplingMode.EITHER );

const withSampleShader = Fn( () => {

Expand Down Expand Up @@ -235,16 +235,16 @@
THREE.InterpolationSamplingMode.NORMAL,
THREE.InterpolationSamplingMode.CENTROID,
THREE.InterpolationSamplingMode.SAMPLE,
THREE.InterpolationSamplingMode.FLAT_FIRST,
THREE.InterpolationSamplingMode.FLAT_EITHER
'flat first',
'flat either'
] ).onChange( () => {

const interpolationShaderLib = {
[ THREE.InterpolationSamplingMode.NORMAL ]: withoutInterpolationShader,
[ THREE.InterpolationSamplingMode.CENTROID ]: withInterpolationShader,
[ THREE.InterpolationSamplingMode.SAMPLE ]: withSampleShader,
[ THREE.InterpolationSamplingMode.FLAT_FIRST ]: withFlatFirstShader,
[ THREE.InterpolationSamplingMode.FLAT_EITHER ]: withFlatEitherShader
[ 'flat first' ]: withFlatFirstShader,
[ 'flat either' ]: withFlatEitherShader
};

const shader = interpolationShaderLib[ effectController.sampling ];
Expand Down
4 changes: 2 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,8 @@ export const InterpolationSamplingMode = {
NORMAL: 'normal',
CENTROID: 'centroid',
SAMPLE: 'sample',
FLAT_FIRST: 'flat first',
FLAT_EITHER: 'flat either'
FIRST: 'first',
EITHER: 'either'
};

/**
Expand Down
4 changes: 1 addition & 3 deletions src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const interpolationTypeMap = {
};

const interpolationModeMap = {
'centroid': 'centroid',
'flat first': 'flat',
'flat either': 'flat'
'centroid': 'centroid'
};

const defaultPrecisions = `
Expand Down