diff --git a/src/engine/BlockManager.js b/src/engine/BlockManager.js index 8ea6e1a..37e0bd9 100644 --- a/src/engine/BlockManager.js +++ b/src/engine/BlockManager.js @@ -373,8 +373,9 @@ export class BlockManager { if (blockType.normal) { try { mat.bumpTexture = new Texture(blockType.normal, this.scene); } catch (e) {} } - mat.specularColor = new Color3(0.2, 0.2, 0.2); - mat.specularPower = 24; + // Сочность (Roblox-look): почти-белая текстура × яркий vertex color, + // specular убран (он белит/тускнит цвет). + mat.specularColor = new Color3(0, 0, 0); mat.useVertexColors = true; return mat; } diff --git a/src/engine/BlockTypes.js b/src/engine/BlockTypes.js index d2762b0..75e65ee 100644 --- a/src/engine/BlockTypes.js +++ b/src/engine/BlockTypes.js @@ -108,8 +108,8 @@ export const BLOCK_TYPES = [ // === ОКРАШИВАЕМЫЕ (задача 09) — паритет со студией === cube('studs-block', 'Лего-кирпич', 'Окрашиваемые', - '/kubikon-assets/materials/studs_diffuse.png', - { colorable: true, normal: '/kubikon-assets/materials/studs_normal.png', defaultColor: '#3a7aff' }), + '/kubikon-assets/materials/studs_v4_diffuse.png', + { colorable: true, normal: '/kubikon-assets/materials/studs_v4_normal.png', defaultColor: '#3a7aff' }), ]; /** Все доступные категории в порядке появления. */ diff --git a/src/engine/GameRuntime.js b/src/engine/GameRuntime.js index 143d080..c376a49 100644 --- a/src/engine/GameRuntime.js +++ b/src/engine/GameRuntime.js @@ -2407,6 +2407,9 @@ export class GameRuntime { if (data.material === 'neon') { data.mesh.material.emissiveColor = c; } + if (data.material === 'studs') { + data.mesh.material.emissiveColor = new Color3(c.r * 0.45, c.g * 0.45, c.b * 0.45); + } } } } catch (e) { diff --git a/src/engine/PrimitiveManager.js b/src/engine/PrimitiveManager.js index 4f6ace3..2048214 100644 --- a/src/engine/PrimitiveManager.js +++ b/src/engine/PrimitiveManager.js @@ -34,8 +34,8 @@ import { Texture } from '@babylonjs/core/Materials/Textures/texture'; import { getPrimitiveType } from './PrimitiveTypes'; // === Материал «studs» (лего-кружки, задача 09) — паритет со студией === -const STUDS_DIFFUSE_URL = '/kubikon-assets/materials/studs_diffuse.png'; -const STUDS_NORMAL_URL = '/kubikon-assets/materials/studs_normal.png'; +const STUDS_DIFFUSE_URL = '/kubikon-assets/materials/studs_v4_diffuse.png'; +const STUDS_NORMAL_URL = '/kubikon-assets/materials/studs_v4_normal.png'; const STUD_UNIT = 1; const STUDS_GRID = 4; const _studsTexCache = new WeakMap(); @@ -457,8 +457,8 @@ export class PrimitiveManager { mat.specularColor = new Color3(0, 0, 0); break; case 'studs': { - // Лего-материал (паритет со студией): серая diffuse с кружками - // × цвет меша + normal map. Тайлинг по размеру меша. + // Лего-материал (паритет со студией): почти-белая diffuse × цвет + // меша + normal map. emissive = доля цвета → сочность (Roblox-look). const tex = _getStudsTextures(this.scene); const dt = tex.diffuse.clone(); const nt = tex.normal.clone(); @@ -468,9 +468,10 @@ export class PrimitiveManager { dt.vScale = nt.vScale = tile.v; mat.diffuseTexture = dt; mat.bumpTexture = nt; - mat.diffuseColor = Color3.FromHexString(color || '#cccccc'); - mat.specularColor = new Color3(0.25, 0.25, 0.25); - mat.specularPower = 24; + const sc = Color3.FromHexString(color || '#cccccc'); + mat.diffuseColor = sc; + mat.emissiveColor = new Color3(sc.r * 0.45, sc.g * 0.45, sc.b * 0.45); + mat.specularColor = new Color3(0, 0, 0); break; } case 'matte':