diff options
| author | prospanclaudebot <[email protected]> | 2026-07-11 01:22:38 +0000 |
|---|---|---|
| committer | prospanclaudebot <[email protected]> | 2026-07-11 01:22:38 +0000 |
| commit | a65b9d221885d915e2216b541e739566b8b68042 (patch) | |
| tree | 0398b757a028718c4f3a76497a8c027fa7c79f02 | |
| parent | 31791588403d86e13a4dab4ae0b31ac719dea500 (diff) | |
| download | planeta-zhopa-a65b9d221885d915e2216b541e739566b8b68042.tar.gz planeta-zhopa-a65b9d221885d915e2216b541e739566b8b68042.zip | |
carrier: 🌭 палуба — реальный мокрый асфальт вместо зеркала (диэлектрик, процедурная крошка, пятнистая мокрость, дроблёные отражения)
| -rw-r--r-- | serve/index.html | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/serve/index.html b/serve/index.html index 32c195b..5cfacda 100644 --- a/serve/index.html +++ b/serve/index.html @@ -1780,7 +1780,18 @@ function rcTick() { const cubeRT = new THREE.WebGLCubeRenderTarget(128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter }); const cubeCam = new THREE.CubeCamera(1, 5000, cubeRT); cubeCam.position.set(0, wl + 26, 0); scene.add(cubeCam); const hullMat = new THREE.MeshStandardMaterial({ color: 0x3a3f45, roughness: 0.7, metalness: 0.35 }); - const deckMat = new THREE.MeshStandardMaterial({ color: 0x17171b, roughness: 0.26, metalness: 0.4, envMap: cubeRT.texture, envMapIntensity: 1.15 }); // мокрый асфальт + const deckMat = new THREE.MeshStandardMaterial({ color: 0x141417, roughness: 0.55, metalness: 0.0, envMap: cubeRT.texture, envMapIntensity: 1.0 }); // реальный мокрый асфальт + deckMat.onBeforeCompile = (sh) => { + sh.uniforms.uNoise = { value: noiseTex }; + sh.vertexShader = sh.vertexShader + .replace('#include <common>', '#include <common>\nvarying vec3 vWPd;') + .replace('#include <begin_vertex>', '#include <begin_vertex>\n vWPd=(modelMatrix*vec4(transformed,1.0)).xyz;'); + sh.fragmentShader = sh.fragmentShader + .replace('#include <common>', '#include <common>\nvarying vec3 vWPd;\nuniform sampler2D uNoise;\nfloat nzd(vec2 p){return texture2D(uNoise,p*0.00390625).r;}\nfloat fbd(vec2 p){float a=0.5,s=0.0;for(int i=0;i<3;i++){s+=a*nzd(p);p=p*2.03+7.0;a*=0.5;}return s;}') + .replace('#include <color_fragment>', '#include <color_fragment>\n diffuseColor.rgb *= 0.72 + 0.55*fbd(vWPd.xz*3.0); diffuseColor.rgb += (fbd(vWPd.xz*9.0)-0.5)*0.05;') + .replace('#include <roughnessmap_fragment>', '#include <roughnessmap_fragment>\n float wet=smoothstep(0.4,0.6,fbd(vWPd.xz*0.5)); roughnessFactor = mix(0.6, 0.12, wet) + (fbd(vWPd.xz*6.0)-0.5)*0.08;') + .replace('#include <normal_fragment_maps>', '#include <normal_fragment_maps>\n { float h=fbd(vWPd.xz*3.5); vec2 dH=vec2(dFdx(h),dFdy(h))*2.2; vec3 Sx=dFdx(-vViewPosition),Sy=dFdy(-vViewPosition); vec3 R1=cross(Sy,normal),R2=cross(normal,Sx); float dtn=dot(Sx,R1); vec3 gr=sign(dtn)*(dH.x*R1+dH.y*R2); normal=normalize(abs(dtn)*normal-gr); }'); + }; const lineMat = new THREE.MeshStandardMaterial({ color: 0xe0e0e0, roughness: 0.5, emissive: 0x1a1a1a }); const LEN = 320, WID = 84; const hull = new THREE.Mesh(new THREE.BoxGeometry(WID * 0.92, 24, LEN), hullMat); hull.position.y = -5; hull.castShadow = true; g.add(hull); |
