diff options
| -rw-r--r-- | serve/index.html | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/serve/index.html b/serve/index.html index faf9e73..ec30506 100644 --- a/serve/index.html +++ b/serve/index.html @@ -1178,7 +1178,7 @@ function groundH(x, z) { // ---------- scene ---------- // ---------- КАРТЫ (тема Планеты Жопа поверх той же геометрии; выбор на старте) ---------- const PZ_MAPS = { - jopa: { label:'🌊 Жопоград (затоплен)', sky:0x8fb7e8, fog:0xc2d6ea, fogN:240, fogF:900, sun:0xfff2d8, hemiS:0xbcd6ff, hemiG:0x55442f, waterY:9.0, water:0x1d3d55, cLow:0x4a7a3a, cHigh:0x8f9a6a, cRock:0x6b6660, cSnow:0xe8ecf0 }, + jopa: { label:'🌊 Жопоград (затоплен)', sky:0x8fb7e8, fog:0xc2d6ea, fogN:240, fogF:900, sun:0xfff2d8, hemiS:0xbcd6ff, hemiG:0x55442f, waterY:9.0, water:0x17a89e, cLow:0x4a7a3a, cHigh:0x8f9a6a, cRock:0x6b6660, cSnow:0xe8ecf0 }, dust: { label:'🏜 de_dust_жопа', flat:true, floorY:12, sky:0xd9c39a, fog:0xd8c7a0, fogN:200, fogF:820, sun:0xfff0d0, hemiS:0xe8d8b0, hemiG:0x6b5636, waterY:-60.0, water:0x2a3a2a, cLow:0xc2a867, cHigh:0xd9c79b, cRock:0xa8894f, cSnow:0xe8dcc0 }, mirage: { label:'🕌 de_mirage_жопа', sky:0xe6c79a, fog:0xdcc29a, fogN:210, fogF:840, sun:0xffe6c0, hemiS:0xe8cfa0, hemiG:0x7a5a3a, waterY:-60.0, water:0x2f4a4a, cLow:0xb98a5a, cHigh:0xd8b88a, cRock:0x9c7b54, cSnow:0xead9be }, perdun: { label:'🌋 Окраина пердунов', sky:0x4a3b30, fog:0x5a4a3a, fogN:120, fogF:600, sun:0xd8905a, hemiS:0x6a5540, hemiG:0x2a1e14, waterY:7.0, water:0x3a2a12, cLow:0x4a3420, cHigh:0x6a5236, cRock:0x3a2e24, cSnow:0x8a7a5a } @@ -1267,8 +1267,13 @@ terrainMat.onBeforeCompile = (sh) => { .replace('#include <common>', '#include <common>\nvarying vec3 vWPosT;\n' + 'float h21T(vec2 p){ return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453); }\n' + 'float vnT(vec2 p){ vec2 i=floor(p),f=fract(p); f=f*f*(3.0-2.0*f); return mix(mix(h21T(i),h21T(i+vec2(1.0,0.0)),f.x),mix(h21T(i+vec2(0.0,1.0)),h21T(i+vec2(1.0,1.0)),f.x),f.y); }\n' + - 'float fbmT(vec2 p){ float a=0.5,s=0.0; for(int i=0;i<4;i++){ s+=a*vnT(p); p=p*2.03+17.1; a*=0.5; } return s; }\n') - .replace('#include <color_fragment>', '#include <color_fragment>\n diffuseColor.rgb *= 0.9 + 0.18*fbmT(vWPosT.xz*0.3);') + 'float fbmT(vec2 p){ float a=0.5,s=0.0; for(int i=0;i<4;i++){ s+=a*vnT(p); p=p*2.03+17.1; a*=0.5; } return s; }\nfloat WY=' + WATER_Y.toFixed(2) + ';\n') + .replace('#include <color_fragment>', '#include <color_fragment>\n' + + ' float sand = smoothstep(WY + 7.0, WY - 3.0, vWPosT.y);' + // песок у берега и под водой + ' diffuseColor.rgb = mix(diffuseColor.rgb, vec3(0.93, 0.85, 0.62), sand);' + + ' diffuseColor.rgb *= 0.88 + 0.20 * fbmT(vWPosT.xz * 0.3);' + // общий детейл + ' float ero = 1.0 - abs(2.0 * fbmT(vWPosT.xz * 0.55) - 1.0);' + // ридж-эрозия + ' diffuseColor.rgb *= 1.0 - 0.30 * ero * ero;') // затемнить промоины .replace('#include <roughnessmap_fragment>', '#include <roughnessmap_fragment>\n roughnessFactor *= 0.5 + 0.65*fbmT(vWPosT.xz*0.16);') .replace('#include <normal_fragment_maps>', '#include <normal_fragment_maps>\n' + ' { float hh=fbmT(vWPosT.xz*0.15); vec2 dH=vec2(dFdx(hh),dFdy(hh))*5.5;' + @@ -1283,7 +1288,7 @@ scene.add(terrain); // glossy WATER in the low areas — roughness also varies (calm/rippled patches), never a perfect uniform mirror const WATER_Y = MAP.waterY; const waterTime = { value: 0 }; -const waterMat = new THREE.MeshStandardMaterial({ color: MAP.water, roughness: 0.2, metalness: 0.0, transparent: true, opacity: 0.9, polygonOffset: true, polygonOffsetFactor: -2, polygonOffsetUnits: -2 }); +const waterMat = new THREE.MeshStandardMaterial({ color: MAP.water, roughness: 0.14, metalness: 0.0, transparent: true, opacity: 0.72, polygonOffset: true, polygonOffsetFactor: -2, polygonOffsetUnits: -2 }); waterMat.onBeforeCompile = (sh) => { // гёрстнер-волны (vertex) + процедурная roughness/пена (fragment) — БЕЗ запечённых текстур sh.uniforms.uTime = waterTime; const vfn = 'uniform float uTime;\nvarying float vWH; varying vec2 vWXZ;\n' + |
