какашки мне в кармашки

This commit is contained in:
lapich committed 2026-10-21 22:17:24 +03:00
1 parent 7fba61f7a0
commit cbda26dfc0
335 files changed
+51926 -7266

No files matched your search

+38 -13
View File
@@ -4,7 +4,8 @@ Shader "Custom/EchoCloudShader"
{
[Header(Base Appearance)]
_BaseColor("Base Ambient Color", Color) = (0.015, 0.015, 0.02, 1.0)
_BaseMap("Base Map (Optional)", 2D) = "white" {}
[MainTexture] _BaseMap("Base Map (Optional)", 2D) = "white" {}
[HideInInspector] _MainTex("MainTex", 2D) = "white" {}
[Header(Echo Cloud Visuals)]
[HDR] _EchoColor("Echo Mist Color", Color) = (4.0, 3.026, 1.049, 1.0)
@@ -23,6 +24,11 @@ Shader "Custom/EchoCloudShader"
_FresnelPower("Edge Rim Power", Range(0.5, 5.0)) = 2.5
_FresnelStrength("Edge Rim Strength", Range(0.0, 2.0)) = 0.4
[Header(Momentary Color Reveal on Wave)]
_ColorRevealIntensity("Color Reveal Brightness", Range(0.0, 4.0)) = 1.6
_ColorRevealSharpness("Color Reveal Sharpness", Range(0.5, 4.0)) = 1.0
_WaveTintWeight("Yellow Wave Tint Blend", Range(0.0, 1.0)) = 0.45
[Header(Wave Inputs from Script)]
_EchoPosition1("Echo Position 1", Vector) = (0, 0, 0, 0)
_EchoPosition2("Echo Position 2", Vector) = (0, 0, 0, 0)
@@ -103,6 +109,9 @@ Shader "Custom/EchoCloudShader"
float _RippleStrength;
float _FresnelPower;
float _FresnelStrength;
float _ColorRevealIntensity;
float _ColorRevealSharpness;
float _WaveTintWeight;
float4 _EchoPosition1;
float4 _EchoPosition2;
@@ -177,21 +186,23 @@ Shader "Custom/EchoCloudShader"
// Organic cloud boundary distortion via 3D noise
float distortedDist = rawDist + (noiseVal - 0.5) * _NoiseDistortion;
float distFromWave = distortedDist - waveRadius;
// Soft leading edge (smoothly fades into darkness ahead)
float leadingEdge = smoothstep(waveRadius + 0.2, waveRadius - _LeadingEdgeSoftness, distortedDist);
// Ahead of wavefront (distFromWave > 0): smooth drop-off into darkness
float aheadFade = 1.0 - saturate(distFromWave / max(0.01, _LeadingEdgeSoftness));
// Soft trailing cloud body (billowy tail behind the wavefront)
float trailingEdge = smoothstep(waveRadius - _CloudBandWidth, waveRadius - 0.2, distortedDist);
// Behind wavefront (distFromWave < 0): smooth cloud tail
float behindFade = 1.0 - saturate(-distFromWave / max(0.1, _CloudBandWidth));
// Combined cloud puff shape
float cloudDensity = leadingEdge * trailingEdge;
// Pulse profile peaking right at the wave crest
float cloudDensity = (distFromWave > 0.0) ? aheadFade : behindFade;
cloudDensity = smoothstep(0.0, 1.0, cloudDensity);
// Subtle acoustic harmonic ripples inside the cloud
float ripple = sin((rawDist - waveRadius) * _RippleFrequency) * 0.5 + 0.5;
cloudDensity *= lerp(1.0, ripple, _RippleStrength);
// Subtle edge rim glow on surfaces facing away (gives 3D depth to rooms)
// Subtle edge rim glow on surfaces facing away
float NdotV = saturate(dot(normalWS, viewDirWS));
float rim = pow(1.0 - NdotV, _FresnelPower) * _FresnelStrength;
cloudDensity += cloudDensity * rim;
@@ -220,8 +231,10 @@ Shader "Custom/EchoCloudShader"
float3 normalWS = normalize(input.normalWS);
float3 viewDirWS = normalize(GetCameraPositionWS() - worldPos);
// Base ambient appearance (deep dark atmospheric tone)
// Base diffuse texture from object
half4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv);
// Deep dark ambient appearance in shadows
half4 baseCol = texColor * _BaseColor;
// 3D procedural noise
@@ -234,11 +247,23 @@ Shader "Custom/EchoCloudShader"
float totalWave = saturate(w1 + w2 + w3);
// Color gradient: soft outer mist (_EchoColor) to glowing core (_EchoCoreColor)
half4 mistColor = _EchoColor * totalWave;
half4 coreBloom = _EchoCoreColor * pow(totalWave, 2.2);
// --- МОМЕНТАЛЬНОЕ ПРОЯВЛЕНИЕ СОБСТВЕННОГО ЦВЕТА ПРЕДМЕТА ПРИ ПРОХОЖДЕНИИ ВОЛНЫ ---
// Мягкое затенение граней по нормали к камере для 3D-объема
half NdotV = saturate(dot(normalWS, viewDirWS));
half3 surfaceLighting = half3(1, 1, 1) * (NdotV * 0.35 + 0.65);
half4 finalColor = baseCol + mistColor + coreBloom;
// Собственный цвет текстуры объекта, активируемый ровно в момент прохождения волны
half revealFactor = pow(totalWave, _ColorRevealSharpness);
half3 naturalRevealedColor = texColor.rgb * surfaceLighting * (_ColorRevealIntensity * revealFactor);
// Желтая акустическая волна (гребень и ядро эхолокации)
half4 mistColor = _EchoColor * totalWave;
half4 coreBloom = _EchoCoreColor * pow(totalWave, 2.5) * 0.35;
half3 waveGlow = mistColor.rgb * _WaveTintWeight + coreBloom.rgb;
// Итог: темная база + проявленный собственный цвет предмета + золотистый ореол волны
half3 finalRgb = baseCol.rgb + naturalRevealedColor + waveGlow;
half4 finalColor = half4(finalRgb, 1.0);
// Apply scene fog
finalColor.rgb = MixFog(finalColor.rgb, input.fogFactor);