Skip to content

Commit

Permalink
remove normal map from atlas for now
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Nov 13, 2023
1 parent ae1c5ee commit 4fc93b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/library/create-texture-atlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export const createTextureAtlasBrowser = async ({ backColor, meshes, atlasSize,
ResetRenderTextureContainer();

const ATLAS_SIZE_PX = atlasSize;
const IMAGE_NAMES = ["diffuse", "orm"];
const IMAGE_NAMES = mtoon ? ["diffuse"] : ["diffuse", "orm"];// not using normal texture for now
const bakeObjects = [];
// save if there is vrm data
let vrmMaterial = null;
Expand Down Expand Up @@ -452,14 +452,19 @@ export const createTextureAtlasBrowser = async ({ backColor, meshes, atlasSize,
map: textures["diffuse"],
roughnessMap: textures["orm"],
metalnessMap: textures["orm"],
normalMap: textures["normal"],
transparent: transparentMaterial
});

if (transparentTexture){
material.alphaTest = 0.5;
}
material.name = "standard_" + materialPostName;

material.roughnessMap.name = material.name + "_orm";
if (material.roughnessMap != null)
material.roughnessMap.name = material.name + "_orm";
if (material.normalMap != null)
material.normalMap.name = material.name + "_normal";
}
// xxxreturn material with textures, dont return uvs nor textures
return { bakeObjects, material };
Expand Down

0 comments on commit 4fc93b7

Please sign in to comment.