Skip to content

Commit

Permalink
added some comments, added some material ext animation properties
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed May 30, 2022
1 parent 8b18546 commit 8c232c3
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,8 @@ PropertyBinding.findNode = ( node, path ) => {
else if ( remainingPath.endsWith( '.emissiveMap' ) )
res = res[ 'emissiveMap' ];

// TODO add other texture slots. Better would be a list of texture slots

}

}
Expand Down Expand Up @@ -3926,6 +3928,7 @@ class GLTFParser {
// TODO implement all properties and/or find a better way to have a good mapping here
switch ( targetProperty ) {

// Core Spec PBR Properties
case 'baseColorFactor':
targetProperty = 'color';
break;
Expand All @@ -3941,9 +3944,8 @@ class GLTFParser {
case 'alphaCutoff':
targetProperty = 'alphaTest';
break;
case 'extensions/KHR_materials_emissive_strength/emissiveStrength':
targetProperty = 'emissiveIntensity';
break;

// Core Spec + KHR_texture_transform
case 'baseColorTexture/extensions/KHR_texture_transform/scale':
targetProperty = 'map/repeat';
break;
Expand All @@ -3957,6 +3959,45 @@ class GLTFParser {
targetProperty = 'emissiveMap/offset';
break;

// KHR_materials_emissive_strength
case 'extensions/KHR_materials_emissive_strength/emissiveStrength':
targetProperty = 'emissiveIntensity';
break;

// KHR_materials_transmission
case 'extensions/KHR_materials_transmission/transmissionFactor':
targetProperty = 'transmission';
break;

// KHR_materials_ior
case 'extensions/KHR_materials_ior/ior':
targetProperty = 'ior';
break;

// KHR_materials_volume
case 'extensions/KHR_materials_volume/thicknessFactor':
targetProperty = 'thickness';
break;
case 'extensions/KHR_materials_volume/attenuationColor':
targetProperty = 'attenuationColor';
break;
case 'extensions/KHR_materials_volume/attenuationDistance':
targetProperty = 'attenuationDistance';
break;

// KHR_materials_iridescence
case 'extensions/KHR_materials_iridescence/iridescenceFactor':
targetProperty = 'iridescence';
break;
case 'extensions/KHR_materials_iridescence/iridescenceIor':
targetProperty = 'iridescenceIor';
break;
case 'extensions/KHR_materials_iridescence/iridescenceThicknessMinimum':
targetProperty = 'iridescenceThicknessRange[0]';
break;
case 'extensions/KHR_materials_iridescence/iridescenceThicknessMaximum':
targetProperty = 'iridescenceThicknessRange[1]';
break;
}

path = pathStart + targetProperty;
Expand Down

0 comments on commit 8c232c3

Please sign in to comment.