glB material import not displaying correctly #248
This commit is contained in:
parent
df05dd9a51
commit
e178e53fbd
@ -23,7 +23,7 @@ const GltfComponentType =
|
||||
SHORT : 5122,
|
||||
UNSIGNED_SHORT : 5123,
|
||||
UNSIGNED_INT : 5125,
|
||||
FLOAT : 5126
|
||||
FLOAT : 5126
|
||||
};
|
||||
|
||||
const GltfDataType =
|
||||
@ -69,8 +69,10 @@ function GetGltfVertexColor (color, componentType)
|
||||
function GetColorComponent (component, componentType)
|
||||
{
|
||||
let normalized = component;
|
||||
if (componentType !== GltfComponentType.FLOAT) {
|
||||
if (componentType === GltfComponentType.UNSIGNED_BYTE) {
|
||||
normalized /= 255.0;
|
||||
} else if (componentType === GltfComponentType.UNSIGNED_SHORT) {
|
||||
normalized /= 65535.0;
|
||||
}
|
||||
return ColorComponentFromFloat (LinearToSRGB (normalized));
|
||||
}
|
||||
|
||||
@ -28,8 +28,7 @@ class ModelFinalizer
|
||||
|
||||
FinalizeMaterials (model)
|
||||
{
|
||||
let hasVertexColors = (model.VertexColorCount () > 0);
|
||||
if (!hasVertexColors) {
|
||||
if (model.VertexColorCount () === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user