Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Aug 25, 2023
1 parent 3b2f9d0 commit 810f8c5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/renderers/webgl/WebGLProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,27 @@ function handleSource( string, errorLine ) {

function getEncodingComponents( colorSpace ) {

let gamutMapping = '';
const workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );
const encodingPrimaries = ColorManagement.getPrimaries( colorSpace );

if ( colorSpace !== NoColorSpace ) {
let gamutMapping;

const workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );
const encodingPrimaries = colorSpace === NoColorSpace ? '' : ColorManagement.getPrimaries( colorSpace );
if ( workingPrimaries === encodingPrimaries ) {

if ( workingPrimaries === P3Primaries && encodingPrimaries === Rec709Primaries ) {
gamutMapping = '';

gamutMapping = 'P3ToRec709';
} else if ( workingPrimaries === P3Primaries && encodingPrimaries === Rec709Primaries ) {

} else if ( workingPrimaries === Rec709Primaries && encodingPrimaries === P3Primaries ) {
gamutMapping = 'P3ToRec709';

gamutMapping = 'Rec709ToP3';
} else if ( workingPrimaries === Rec709Primaries && encodingPrimaries === P3Primaries ) {

}
gamutMapping = 'Rec709ToP3';

}

switch ( colorSpace ) {

case NoColorSpace:
case LinearSRGBColorSpace:
case LinearDisplayP3ColorSpace:
return [ gamutMapping, 'LinearTransferOETF' ];
Expand Down

0 comments on commit 810f8c5

Please sign in to comment.