diff --git a/src/editor/engine/PrimitiveManager.js b/src/editor/engine/PrimitiveManager.js index 20cc931..b1094fc 100644 --- a/src/editor/engine/PrimitiveManager.js +++ b/src/editor/engine/PrimitiveManager.js @@ -506,12 +506,12 @@ export class PrimitiveManager { _applyMaterial(mesh, typeDef, color, material, textureUrl) { const matName = `${mesh.name}_mat`; const mat = new StandardMaterial(matName, this.scene); - mat.diffuseColor = Color3.FromHexString(color || '#888888'); - // ambient НЕ выставляем — иначе scene.ambient (0.3) + ambient(0.4-1.0) - // приплюсовывается к diffuse и цвета становятся пересвеченными - // (особенно белые/серые становятся пересветлёнными). - // Babylon default (0,0,0) даёт чистый Lambert: освещённый цвет=diffuse, - // тень=чёрная (что в Roblox смягчается scene.ambient). + const dc = Color3.FromHexString(color || '#888888'); + mat.diffuseColor = dc; + // ambient = СОБСТВЕННЫЙ цвет (умеренный). Это даёт цвет в тени + // равный ~30% от собственного, а не белый (как делал ambient=(1,1,1)). + // На светлом полу: белые цвета остаются белыми, тёмные грани не чёрные. + mat.ambientColor = dc; // Если задан textureUrl — подгружаем PNG как diffuseTexture. Это // используется для GD-скинов куба (например /gd/skins/cube_smile.png).