[WL] 섬 · 던전 「선명 룩」(원신풍 밝고 화사한 색감) — #1148
PD 「원신 같은 밝고 화사한 색감 · 아름다운 화풍의 섬에서 벌어지는 액션 RPG」 · 「풀 느낌은 기존이 좋다 · 색감만 통일」 · 「던전도 적용」
- 새 폴더 Assets/WL/Look/Vivid/ (기존 코드 · 씬 · 원본 재질 0줄 · 씬 로드 훅 러너)
· WLVividLook.cs — 씬마다 러너 1개 · 후처리 볼륨(채도 6 · 대비 8 · 따뜻한 필터 · 블룸 0.3 · 톤매핑 없음)
· 지형 ToonTerrain 잔디/모래 색 + 빛 값 = 섬 값(구름 0.5 · 0.025 · 밝기 0.12 · 그늘 최소 0.2)
· 풀잎 · 꽃 = 원래 셰이더 유지 · 색과 빛 값을 같은 씬 지형과 똑같이(풀 모양 안 드러나게)
· 소품 그늘색 청록 쪽 · 밝기 곱은 Palette 재질만 · 등급 연출 복사본 이중 적용 방지
· 바다 = WL_VividWater 로 교체(깊이 3색 · 물가 거품 · 물결 줄 · 반짝임 · 깊은 바다 색 얼룩)
· WLVividLookSettings.cs + Resources/WL/WLVividLookSettings.asset — 값 전부(C45) · enabled_ 0 = 원래 화면
· Shaders/WL_VividWater.shader · WL_VividGrass.shader(grassShaderSwap 1 일 때만) · WLVividCommon.hlsl
- 대상 씬 Level01 · WL_FarmLook · WL_Dungeon01 · WL_Dungeon02
- 실측: 컴파일 · Play 콘솔 오류 0 · 섬 · 던전 1 · 2 캡처 비교 / 미확인: 안드로이드 셰이더 컴파일 · 실기 성능
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
68ba3b7a6f
commit
eb09d535b3
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 741fa1fce99e77543b55e992ef9d4a9f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e52ca2f0b4c38d438dcafa293c263a5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2e09cefd62368364889bf940ce1c581d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ddfb5dff9805547479f74fe19b3a3ddc, type: 3}
|
||||
m_Name: WLVividLookSettings
|
||||
m_EditorClassIdentifier: Assembly-CSharp::WL.Look.Vivid.WLVividLookSettings
|
||||
enabled_: 1
|
||||
scenes:
|
||||
- Level01
|
||||
- WL_FarmLook
|
||||
- WL_Dungeon01
|
||||
- WL_Dungeon02
|
||||
checkSeconds: 1
|
||||
verboseLog: 0
|
||||
volumeEnabled: 1
|
||||
volumePriority: 100
|
||||
tonemapMode: 0
|
||||
postExposure: 0
|
||||
contrast: 8
|
||||
saturation: 6
|
||||
colorFilter: {r: 1, g: 0.97, b: 0.9, a: 1}
|
||||
bloomThreshold: 0.9
|
||||
bloomIntensity: 0.3
|
||||
bloomScatter: 0.6
|
||||
vignette: 0.1
|
||||
propShadowEnabled: 1
|
||||
propShadowMul: 1.15
|
||||
propShadowAdd: {r: -0.03, g: 0.05, b: 0.06, a: 0}
|
||||
propDiffuseMul: {r: 1.2, g: 1.2, b: 1.12, a: 1}
|
||||
propDiffuseNameContains:
|
||||
- Palette
|
||||
propCloudStrength: 0.5
|
||||
propSkipNameContains:
|
||||
- _ToonP
|
||||
terrainEnabled: 1
|
||||
terrainGrassHighlight: {r: 0.56, g: 0.84, b: 0.48, a: 0}
|
||||
terrainGrassShadow: {r: 0.22, g: 0.52, b: 0.42, a: 0}
|
||||
terrainSandHighlight: {r: 0.97, g: 0.93, b: 0.8, a: 0}
|
||||
terrainSandShadow: {r: 0.74, g: 0.66, b: 0.55, a: 0}
|
||||
terrainCloudStrength: 0.5
|
||||
terrainCloudDensity: 0.025
|
||||
terrainBrightness: 0.12
|
||||
terrainMinimumDarkness: 0.2
|
||||
terrainShades: -1
|
||||
grassEnabled: 1
|
||||
grassShaderSwap: 0
|
||||
grassMatchTerrain: 1
|
||||
grassMatchTerrainLighting: 1
|
||||
flowerRecolor: 0
|
||||
flowerOrigDiffuse: {r: 0.975, g: 1, b: 0.59, a: 0}
|
||||
flowerOrigShadow: {r: 0.52, g: 0.45, b: 0.29, a: 0}
|
||||
grassShader: {fileID: 4800000, guid: 5f8b85d4326e84741bb454cf96eee381, type: 3}
|
||||
grassRoot: {r: 0.1, g: 0.42, b: 0.3, a: 1}
|
||||
grassTip: {r: 0.5, g: 0.84, b: 0.42, a: 1}
|
||||
grassShadowRoot: {r: 0.06, g: 0.3, b: 0.28, a: 1}
|
||||
grassShadowTip: {r: 0.22, g: 0.55, b: 0.45, a: 1}
|
||||
grassTipPower: 1.4
|
||||
grassBladeHeight: 1.14
|
||||
grassPatchTint: {r: 1.18, g: 1.08, b: 0.8, a: 1}
|
||||
grassPatchCoolTint: {r: 0.8, g: 0.95, b: 1.05, a: 1}
|
||||
grassPatchScale: 0.12
|
||||
grassPatchStrength: 1
|
||||
grassJitter: 0.18
|
||||
grassRampThreshold: 0.45
|
||||
grassRampSoftness: 0.12
|
||||
grassAmbient: 0.25
|
||||
grassWindStrength: 0.3
|
||||
grassWindDensity: 0.2
|
||||
grassWindMovement: {x: 6, y: 0}
|
||||
flowerEnabled: 1
|
||||
flowerRoot: {r: 0.4, g: 0.66, b: 0.3, a: 1}
|
||||
flowerTip: {r: 1, g: 0.98, b: 0.9, a: 1}
|
||||
flowerShadowRoot: {r: 0.2, g: 0.42, b: 0.34, a: 1}
|
||||
flowerShadowTip: {r: 0.78, g: 0.76, b: 0.8, a: 1}
|
||||
flowerAltTip: {r: 1, g: 0.86, b: 0.25, a: 1}
|
||||
flowerAltChance: 0.4
|
||||
flowerTipPower: 2.2
|
||||
flowerBladeHeight: 1.4
|
||||
waterEnabled: 1
|
||||
waterShader: {fileID: 4800000, guid: 6786d60223844ed4194ab0e4059ae7d3, type: 3}
|
||||
waterSourceShader: Shader Graphs/Water
|
||||
waterShallow: {r: 0.55, g: 0.96, b: 0.9, a: 0.3}
|
||||
waterMid: {r: 0.3, g: 0.86, b: 0.86, a: 0.8}
|
||||
waterDeep: {r: 0.12, g: 0.66, b: 0.78, a: 1}
|
||||
waterMidDepth: 0.3
|
||||
waterDeepDepth: 0.78
|
||||
waterFoamColor: {r: 1, g: 1, b: 1, a: 0.9}
|
||||
waterFoamDepth: 0.12
|
||||
waterRippleScale: 0.35
|
||||
waterRippleSpeed: 0.25
|
||||
waterRippleStrength: 0.05
|
||||
waterSparkle: 0.85
|
||||
waterSparkleScale: 7
|
||||
waterSparkleThreshold: 0.8
|
||||
waterDeepVariation: 0.35
|
||||
waterDeepVariationScale: 0.06
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d7521eb5c5a00f241824e39d122c1ab6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 84c3f8ca336b6ad45a91a18d53dcb320
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// WLVividCommon.hlsl — 선명 룩 셰이더 공통 잡음(2026-11-25 #1136) · 텍스처 0장 · 모바일용 값 잡음(해시 4번 + 보간)
|
||||
#ifndef WL_VIVID_COMMON_INCLUDED
|
||||
#define WL_VIVID_COMMON_INCLUDED
|
||||
|
||||
float WLHash21(float2 p)
|
||||
{
|
||||
p = frac(p * float2(123.34, 456.21));
|
||||
p += dot(p, p + 45.32);
|
||||
return frac(p.x * p.y);
|
||||
}
|
||||
|
||||
float WLValueNoise(float2 p)
|
||||
{
|
||||
float2 i = floor(p);
|
||||
float2 f = frac(p);
|
||||
float a = WLHash21(i);
|
||||
float b = WLHash21(i + float2(1, 0));
|
||||
float c = WLHash21(i + float2(0, 1));
|
||||
float d = WLHash21(i + float2(1, 1));
|
||||
float2 u = f * f * (3.0 - 2.0 * f);
|
||||
return lerp(lerp(a, b, u.x), lerp(c, d, u.x), u.y);
|
||||
}
|
||||
|
||||
float WLFbm2(float2 p)
|
||||
{
|
||||
return WLValueNoise(p) * 0.65 + WLValueNoise(p * 2.13 + 17.1) * 0.35;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 18f5f9e1083427446b0d4331efa7a47b
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
// WL_VividGrass — 섬 풀잎 · 꽃 「선명 룩」 셰이더(2026-11-25 #1136 PD 「원신 같은 밝고 화사한 색감」)
|
||||
// · 그리기 = 3DPixelArtEnvironment 인스턴서(DrawMeshInstancedIndirect · _InstanceData · _LocalToWorld)와 같은 입력 — 원본 InstancedBillboardToon 대체
|
||||
// · 색 = 뿌리 → 끝 그라데이션 + 큰 얼룩(노란 무리) + 포기마다 작은 흔들림 · 그늘은 검지 않고 청록
|
||||
// · 빛 = 지면 법선(인스턴스) · 해 그림자 1회 샘플 · 부드러운 2단 램프(원신식) · 모바일: 텍스처 0장 · 색 계산은 정점에서
|
||||
Shader "WL/VividGrass"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_GrassRoot ("Root", Color) = (0.25, 0.55, 0.30, 1)
|
||||
_GrassTip ("Tip", Color) = (0.86, 0.95, 0.42, 1)
|
||||
_GrassShadowRoot ("Shadow Root", Color) = (0.13, 0.36, 0.33, 1)
|
||||
_GrassShadowTip ("Shadow Tip", Color) = (0.36, 0.62, 0.42, 1)
|
||||
_TipPower ("Tip Power", Float) = 1.4
|
||||
_BladeHeight ("Blade Height (object)", Float) = 1.14
|
||||
_PatchTint ("Patch Tint (warm)", Color) = (1.18, 1.06, 0.70, 1)
|
||||
_PatchCoolTint ("Patch Tint (cool)", Color) = (0.85, 0.95, 1.0, 1)
|
||||
_AltTip ("Alt Tip (per clump)", Color) = (1, 0.85, 0.3, 1)
|
||||
_AltChance ("Alt Tip Chance", Float) = 0
|
||||
_PatchScale ("Patch Scale", Float) = 0.18
|
||||
_PatchStrength ("Patch Strength", Float) = 0.7
|
||||
_Jitter ("Per-clump Jitter", Float) = 0.18
|
||||
_RampThreshold ("Ramp Threshold", Float) = 0.45
|
||||
_RampSoftness ("Ramp Softness", Float) = 0.12
|
||||
_AmbientStrength ("Ambient", Float) = 0.25
|
||||
_WindStrength ("Wind Strength", Float) = 0.3
|
||||
_WindDensity ("Wind Density", Float) = 0.2
|
||||
_WindMovement ("Wind Movement", Vector) = (6, 0, 0, 0)
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "Queue" = "Geometry" }
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "WLVividCommon.hlsl"
|
||||
|
||||
struct WLInstanceData { float4x4 TRS; float3 normal; };
|
||||
StructuredBuffer<WLInstanceData> _InstanceData;
|
||||
float4x4 _LocalToWorld;
|
||||
void WLGrassSetup() { }
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
half4 _GrassRoot, _GrassTip, _GrassShadowRoot, _GrassShadowTip, _PatchTint, _PatchCoolTint, _AltTip;
|
||||
float _TipPower, _BladeHeight, _PatchScale, _PatchStrength, _Jitter, _AltChance;
|
||||
float _RampThreshold, _RampSoftness, _AmbientStrength;
|
||||
float _WindStrength, _WindDensity;
|
||||
float4 _WindMovement;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
// 인스턴스 → 월드(원본 셋업과 같은 식: 오브젝트 행렬 × _LocalToWorld × TRS) · 빌보드 · 바람
|
||||
void WLGrassPlace(Attributes v, out float3 positionWS, out float3 originWS, out float3 groundN, out float h)
|
||||
{
|
||||
uint id = 0;
|
||||
#if UNITY_ANY_INSTANCING_ENABLED
|
||||
id = unity_InstanceID;
|
||||
#endif
|
||||
WLInstanceData d = _InstanceData[id];
|
||||
float4x4 m = mul(GetObjectToWorldMatrix(), mul(_LocalToWorld, d.TRS));
|
||||
originWS = float3(m._m03, m._m13, m._m23);
|
||||
float scale = length(float3(m._m00, m._m10, m._m20));
|
||||
groundN = normalize(mul((float3x3)_LocalToWorld, d.normal) + float3(0, 1e-4, 0));
|
||||
h = saturate(v.positionOS.y / max(_BladeHeight, 1e-3));
|
||||
|
||||
float2 offs = v.positionOS.xy * scale;
|
||||
float wn = WLValueNoise(originWS.xz * _WindDensity + _Time.y * _WindMovement.xy * 0.1) * 2.0 - 1.0;
|
||||
float s, c;
|
||||
sincos(wn * _WindStrength * h, s, c);
|
||||
offs = float2(offs.x * c - offs.y * s, offs.x * s + offs.y * c);
|
||||
|
||||
float3 right = float3(UNITY_MATRIX_I_V._m00, UNITY_MATRIX_I_V._m10, UNITY_MATRIX_I_V._m20);
|
||||
float3 up = float3(UNITY_MATRIX_I_V._m01, UNITY_MATRIX_I_V._m11, UNITY_MATRIX_I_V._m21);
|
||||
positionWS = originWS + right * offs.x + up * offs.y;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Forward"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
Cull Off
|
||||
ZWrite On
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 4.5
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_instancing
|
||||
#pragma instancing_options procedural:WLGrassSetup
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float3 positionWS : TEXCOORD0;
|
||||
half3 litColor : TEXCOORD1;
|
||||
half3 shadowColor : TEXCOORD2;
|
||||
half ndl : TEXCOORD3;
|
||||
};
|
||||
|
||||
Varyings vert(Attributes v)
|
||||
{
|
||||
Varyings o = (Varyings)0;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
float3 posWS, originWS, n; float h;
|
||||
WLGrassPlace(v, posWS, originWS, n, h);
|
||||
o.positionWS = posWS;
|
||||
o.positionCS = TransformWorldToHClip(posWS);
|
||||
|
||||
float t = pow(h, _TipPower);
|
||||
float hc = WLHash21(floor(originWS.xz * 7.0)); // 포기 하나의 고정 난수
|
||||
half3 tipCol = (WLHash21(floor(originWS.xz * 7.0) + 13.7) < _AltChance) ? _AltTip.rgb : _GrassTip.rgb;
|
||||
half3 lit = lerp(_GrassRoot.rgb, tipCol, t);
|
||||
half3 shd = lerp(_GrassShadowRoot.rgb, _GrassShadowTip.rgb, t);
|
||||
// 큰 얼룩 — 월드 좌표 잡음: 높은 곳 = 따뜻한 노란 무리 · 낮은 곳 = 서늘한 청록 무리 · 끝 쪽일수록 세게
|
||||
float pn = WLFbm2(originWS.xz * _PatchScale);
|
||||
float warm = smoothstep(0.5, 0.75, pn);
|
||||
float cool = smoothstep(0.5, 0.25, pn);
|
||||
float k = _PatchStrength * (0.35 + 0.65 * t);
|
||||
half3 tint = half3(1, 1, 1) + (_PatchTint.rgb - 1.0) * warm * k + (_PatchCoolTint.rgb - 1.0) * cool * k;
|
||||
// 포기마다 작은 밝기 흔들림
|
||||
half jit = 1.0 + (hc - 0.5) * _Jitter;
|
||||
lit *= tint * jit;
|
||||
shd *= lerp(half3(1, 1, 1), tint, 0.5) * jit;
|
||||
// 그늘 쪽 하늘빛(SH) 조금
|
||||
shd += SampleSH(n) * _AmbientStrength;
|
||||
o.litColor = lit;
|
||||
o.shadowColor = shd;
|
||||
o.ndl = saturate(dot(n, GetMainLight().direction));
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(Varyings i) : SV_Target
|
||||
{
|
||||
Light L = GetMainLight(TransformWorldToShadowCoord(i.positionWS));
|
||||
half lit = i.ndl * L.shadowAttenuation;
|
||||
half ramp = smoothstep(_RampThreshold - _RampSoftness, _RampThreshold + _RampSoftness, lit);
|
||||
return half4(lerp(i.shadowColor, i.litColor, ramp), 1);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "DepthOnly"
|
||||
Tags { "LightMode" = "DepthOnly" }
|
||||
Cull Off
|
||||
ZWrite On
|
||||
ColorMask R
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 4.5
|
||||
#pragma vertex vertDepth
|
||||
#pragma fragment fragDepth
|
||||
#pragma multi_compile_instancing
|
||||
#pragma instancing_options procedural:WLGrassSetup
|
||||
|
||||
float4 vertDepth(Attributes v) : SV_POSITION
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
float3 posWS, originWS, n; float h;
|
||||
WLGrassPlace(v, posWS, originWS, n, h);
|
||||
return TransformWorldToHClip(posWS);
|
||||
}
|
||||
half4 fragDepth() : SV_Target { return 0; }
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack Off
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5f8b85d4326e84741bb454cf96eee381
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
// WL_VividWater — 섬 바다 「선명 룩」 셰이더(2026-11-25 #1136 PD 「원신 같은 밝고 화사한 색감」)
|
||||
// · 깊이 3색 그라데이션(얕은 곳 맑은 청록 · 중간 청록 · 깊은 곳 파랑) — 장면 깊이 1회 샘플로 「수직 물 깊이」를 복원
|
||||
// · 물가 거품(깊이 기준 · 잡음으로 끊김) · 물결 밝은 줄(잡음 2개 차이) · 반짝임(잡음 곱 임계)
|
||||
// · 모바일: 텍스처 0장(깊이 텍스처 1회만) · 투명 1패스 · 그림자 샘플 1회
|
||||
Shader "WL/VividWater"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Shallow ("Shallow (a = alpha)", Color) = (0.45, 0.95, 0.90, 0.35)
|
||||
_Mid ("Mid (a = alpha)", Color) = (0.10, 0.78, 0.88, 0.75)
|
||||
_Deep ("Deep (a = alpha)", Color) = (0.05, 0.42, 0.80, 0.95)
|
||||
_MidDepth ("Mid Depth (m)", Float) = 0.6
|
||||
_DeepDepth ("Deep Depth (m)", Float) = 2.2
|
||||
_FoamColor ("Foam", Color) = (1, 1, 1, 0.9)
|
||||
_FoamDepth ("Foam Depth (m)", Float) = 0.12
|
||||
_RippleScale ("Ripple Scale", Float) = 0.9
|
||||
_RippleSpeed ("Ripple Speed", Float) = 0.25
|
||||
_RippleStrength ("Ripple Strength", Float) = 0.10
|
||||
_Sparkle ("Sparkle", Float) = 0.85
|
||||
_SparkleScale ("Sparkle Scale", Float) = 7
|
||||
_SparkleThreshold ("Sparkle Threshold", Float) = 0.72
|
||||
_DeepVariation ("Deep Variation", Float) = 0.25
|
||||
_DeepVariationScale ("Deep Variation Scale", Float) = 0.06
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
|
||||
Pass
|
||||
{
|
||||
Name "Forward"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
Cull Back
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
|
||||
#include "WLVividCommon.hlsl"
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
half4 _Shallow, _Mid, _Deep, _FoamColor;
|
||||
float _MidDepth, _DeepDepth, _FoamDepth;
|
||||
float _RippleScale, _RippleSpeed, _RippleStrength;
|
||||
float _Sparkle, _SparkleScale, _SparkleThreshold;
|
||||
float _DeepVariation, _DeepVariationScale;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes { float4 positionOS : POSITION; };
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float3 positionWS : TEXCOORD0;
|
||||
float4 screenPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
Varyings vert(Attributes v)
|
||||
{
|
||||
Varyings o;
|
||||
o.positionWS = TransformObjectToWorld(v.positionOS.xyz);
|
||||
o.positionCS = TransformWorldToHClip(o.positionWS);
|
||||
o.screenPos = ComputeScreenPos(o.positionCS);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(Varyings i) : SV_Target
|
||||
{
|
||||
float2 suv = i.screenPos.xy / i.screenPos.w;
|
||||
float raw = SampleSceneDepth(suv);
|
||||
#if !UNITY_REVERSED_Z
|
||||
raw = lerp(UNITY_NEAR_CLIP_VALUE, 1, raw);
|
||||
#endif
|
||||
float3 sceneWS = ComputeWorldSpacePosition(suv, raw, UNITY_MATRIX_I_VP);
|
||||
float depth = max(0.0, i.positionWS.y - sceneWS.y); // 수직 물 깊이(m)
|
||||
|
||||
float t1 = smoothstep(0.0, 1.0, saturate(depth / max(_MidDepth, 1e-3)));
|
||||
float t2 = smoothstep(0.0, 1.0, saturate((depth - _MidDepth) / max(_DeepDepth - _MidDepth, 1e-3)));
|
||||
half4 col = lerp(lerp(_Shallow, _Mid, t1), _Deep, t2);
|
||||
// 깊은 바다 큰 색 얼룩(한 가지 파랑으로 평평해 보이지 않게 · 천천히 흐름)
|
||||
float dv = WLFbm2(i.positionWS.xz * _DeepVariationScale + _Time.y * 0.01) - 0.5;
|
||||
col.rgb = lerp(col.rgb, lerp(_Mid.rgb, _Deep.rgb * 0.85, dv + 0.5), saturate(abs(dv) * 2.0) * _DeepVariation * t2);
|
||||
|
||||
// 물결 밝은 줄 — 서로 다른 방향으로 흐르는 잡음 2개의 차이가 0 에 가까운 곳
|
||||
float2 p = i.positionWS.xz * _RippleScale * float2(0.45, 1.8); // 바람 방향(x)으로 길게 늘인 물결 줄
|
||||
float n1 = WLValueNoise(p + _Time.y * _RippleSpeed * float2(1.0, 0.6));
|
||||
float n2 = WLValueNoise(p * 1.7 - _Time.y * _RippleSpeed * float2(0.7, 1.1) + 31.7);
|
||||
float rip = saturate(1.0 - abs(n1 - n2) * 7.0);
|
||||
rip = rip * rip * rip;
|
||||
col.rgb += rip * _RippleStrength * (0.6 + 0.4 * t1);
|
||||
|
||||
// 반짝임 — 잡음 곱이 임계를 넘는 작은 점(깊은 쪽 위주)
|
||||
float2 q = i.positionWS.xz * _SparkleScale;
|
||||
float s1 = WLValueNoise(q + _Time.y * float2(0.9, -0.7));
|
||||
float s2 = WLValueNoise(q * 1.37 - _Time.y * float2(0.6, 0.8) + 7.3);
|
||||
float sp = smoothstep(_SparkleThreshold, _SparkleThreshold + 0.04, s1 * s2);
|
||||
col.rgb += sp * _Sparkle * (0.3 + 0.7 * t1);
|
||||
col.a = saturate(col.a + sp * 0.5);
|
||||
|
||||
// 물가 거품(깊이 얕은 띠 · 잡음으로 끊김)
|
||||
float fn = WLValueNoise(i.positionWS.xz * 3.0 + _Time.y * 0.3);
|
||||
float foam = saturate((1.0 - depth / max(_FoamDepth, 1e-3)) * 1.6 - fn * 0.6);
|
||||
foam = smoothstep(0.45, 0.6, foam) * _FoamColor.a;
|
||||
col.rgb = lerp(col.rgb, _FoamColor.rgb, foam);
|
||||
col.a = max(col.a, foam);
|
||||
|
||||
// 해 그림자(구름 · 소품 그림자가 물에도 살짝)
|
||||
Light L = GetMainLight(TransformWorldToShadowCoord(i.positionWS));
|
||||
col.rgb *= lerp(0.8, 1.0, L.shadowAttenuation);
|
||||
return col;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack Off
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6786d60223844ed4194ab0e4059ae7d3
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,334 @@
|
|||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// WLVividLook.cs — 섬 「선명 룩」 러너 (2026-11-25 #1136 PD 「원신 같은 밝고 화사한 색감 · 아름다운 화풍의 섬에서 벌어지는 액션 RPG」)
|
||||
//
|
||||
// ■ 무엇을 하나(값은 전부 WLVividLookSettings · 대상 씬만 · 원본 에셋 · 씬 파일 · 기존 코드 0줄)
|
||||
// ① 전역 후처리 볼륨(채도 · 대비 · 색 필터 · 약한 빛 번짐 · 비네트) — 런타임 프로필
|
||||
// ② 지형(ToonTerrain) 잔디 · 모래 밝은색/그늘색 · 구름 그림자 세기
|
||||
// ③ 풀잎 · 꽃(3DPixelArtEnvironment 인스턴서)의 재질을 WL_VividGrass 로 교체(뿌리 → 끝 색 · 노란 무리 얼룩)
|
||||
// ④ 툰 소품(덤불 · 나무 · 길) 그늘색을 검은 회색 대신 청록 쪽으로
|
||||
// ⑤ 바다 재질을 WL_VividWater 로 교체(얕은 곳 · 중간 · 깊은 곳 3색 · 거품 · 물결 · 반짝임)
|
||||
// ■ 원본 보호 — 에디터에서 에셋 재질은 복사본을 만들어 렌더러 · 지형 · 인스턴서에 꽂는다(Play 를 꺼도 에셋 값 그대로).
|
||||
// WLDemoTerrain 이 만든 런타임 복사본은 그 자리에서 바꾼다. 매 checkSeconds 멱등 재적용(늦게 생기는 지형 · 풀 · 재구성 대응).
|
||||
// 🔴 Debug.LogError 금지(ErrorLogHookManager 팝업) · asmdef 금지 · 새 싱글톤 = 씬 오브젝트 1개.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace WL.Look.Vivid
|
||||
{
|
||||
public sealed class WLVividLook : MonoBehaviour
|
||||
{
|
||||
public static WLVividLook Instance { get; private set; }
|
||||
const string CloneTag = " (WL vivid)";
|
||||
public static string LastLog = "";
|
||||
public static int Applied, GrassSwapped, WaterSwapped, PropsTinted, TerrainTuned;
|
||||
|
||||
WLVividLookSettings _cfg;
|
||||
Scene _scene;
|
||||
float _next;
|
||||
Volume _vol;
|
||||
VolumeProfile _prof;
|
||||
readonly Dictionary<Material, Material> _clones = new Dictionary<Material, Material>(); // 에셋 원본 → 런타임 복사본
|
||||
readonly HashSet<Material> _done = new HashSet<Material>(); // 이미 값을 넣은 런타임 재질
|
||||
readonly Dictionary<Material, Color> _origShadow = new Dictionary<Material, Color>(); // 소품 재질의 처음 그늘색
|
||||
readonly Dictionary<Material, Color> _origDiffuse = new Dictionary<Material, Color>(); // 소품 재질의 처음 밝은색
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
static void ResetStatics()
|
||||
{
|
||||
Instance = null; LastLog = ""; Applied = GrassSwapped = WaterSwapped = PropsTinted = TerrainTuned = 0; s_all.Clear();
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
}
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
||||
static void Boot()
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
for (int i = 0; i < SceneManager.sceneCount; i++) OnSceneLoaded(SceneManager.GetSceneAt(i), LoadSceneMode.Additive);
|
||||
}
|
||||
|
||||
static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Ensure(scene); }
|
||||
|
||||
// 씬마다 러너 1개 — 맵 이동(SceneInfo)은 새 씬 로드와 옛 씬 언로드가 동시에 돌아 두 씬이 잠깐 같이 있다(섬 → 던전 · 2026-11-25 #1136)
|
||||
static readonly List<WLVividLook> s_all = new List<WLVividLook>();
|
||||
|
||||
/// <summary>대상 씬이면 그 씬에 러너를 만든다(이미 있으면 그대로) — 씬 로드 훅 · 프로브가 부른다.</summary>
|
||||
public static WLVividLook Ensure(Scene scene)
|
||||
{
|
||||
var cfg = Resources.Load<WLVividLookSettings>(WLVividLookSettings.ResourcePath);
|
||||
if (cfg == null || cfg.enabled_ == 0 || !scene.IsValid() || !SceneAllowed(cfg, scene.name)) return null;
|
||||
for (int i = s_all.Count - 1; i >= 0; i--) { if (s_all[i] == null) { s_all.RemoveAt(i); continue; } if (s_all[i]._scene == scene) return s_all[i]; }
|
||||
var go = new GameObject("~WL_VividLook");
|
||||
if (scene.isLoaded) SceneManager.MoveGameObjectToScene(go, scene);
|
||||
var r = go.AddComponent<WLVividLook>();
|
||||
r._cfg = cfg; r._scene = scene;
|
||||
s_all.Add(r); Instance = r;
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>떠 있는 러너 전부(값 시도 프로브의 재적용용).</summary>
|
||||
public static void ReapplyAll() { for (int i = 0; i < s_all.Count; i++) if (s_all[i] != null) s_all[i].Reapply(); }
|
||||
|
||||
public static bool SceneAllowed(WLVividLookSettings cfg, string sceneName)
|
||||
{
|
||||
if (cfg.scenes == null || cfg.scenes.Length == 0) return true;
|
||||
for (int i = 0; i < cfg.scenes.Length; i++) if (cfg.scenes[i] == sceneName) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if (_vol != null) Destroy(_vol.gameObject);
|
||||
if (_prof != null) Destroy(_prof);
|
||||
foreach (var kv in _clones) if (kv.Value != null) Destroy(kv.Value);
|
||||
_clones.Clear();
|
||||
s_all.Remove(this);
|
||||
if (Instance == this) Instance = s_all.Count > 0 ? s_all[s_all.Count - 1] : null;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (_cfg == null || _cfg.enabled_ == 0) return;
|
||||
if (Time.unscaledTime < _next) return;
|
||||
_next = Time.unscaledTime + Mathf.Max(0.2f, _cfg.checkSeconds);
|
||||
Apply();
|
||||
}
|
||||
|
||||
/// <summary>설정 값을 바꾼 뒤 즉시 다시 넣기(같은 Play 에서 값 비교용) — 이미 넣은 표시를 지우고 재적용.</summary>
|
||||
public void Reapply()
|
||||
{
|
||||
_done.Clear();
|
||||
if (_vol != null) { Destroy(_vol.gameObject); _vol = null; }
|
||||
if (_prof != null) { Destroy(_prof); _prof = null; }
|
||||
Apply();
|
||||
}
|
||||
|
||||
static bool IsAsset(Material m)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return m != null && UnityEditor.AssetDatabase.Contains(m);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>에셋 재질이면 복사본(캐시) · 런타임 재질이면 그대로.</summary>
|
||||
Material Own(Material m)
|
||||
{
|
||||
if (m == null || !IsAsset(m)) return m;
|
||||
Material c;
|
||||
if (_clones.TryGetValue(m, out c) && c != null) return c;
|
||||
c = new Material(m) { name = m.name + CloneTag };
|
||||
c.hideFlags = HideFlags.DontSave;
|
||||
_clones[m] = c;
|
||||
return c;
|
||||
}
|
||||
|
||||
bool InScene(Component c) { return !_scene.IsValid() || c.gameObject.scene == _scene; }
|
||||
|
||||
void Apply()
|
||||
{
|
||||
var cfg = _cfg; int n = 0;
|
||||
if (cfg.volumeEnabled != 0 && _vol == null) { MakeVolume(cfg); n++; }
|
||||
if (cfg.terrainEnabled != 0) n += ApplyTerrain(cfg);
|
||||
if (cfg.grassEnabled != 0 && cfg.grassShader != null) n += ApplyGrass(cfg);
|
||||
n += ApplyRenderers(cfg);
|
||||
if (n > 0)
|
||||
{
|
||||
Applied += n;
|
||||
LastLog = "선명 룩 " + n + "건 (누적 " + Applied + " · 지형 " + TerrainTuned + " · 풀 " + GrassSwapped + " · 소품 " + PropsTinted + " · 물 " + WaterSwapped + " · 볼륨 " + (_vol != null) + ")";
|
||||
if (cfg.verboseLog != 0) Debug.Log("[WLVividLook] " + LastLog);
|
||||
}
|
||||
}
|
||||
|
||||
void MakeVolume(WLVividLookSettings cfg)
|
||||
{
|
||||
var vgo = new GameObject("~WL_VividVolume");
|
||||
if (_scene.IsValid() && _scene.isLoaded) SceneManager.MoveGameObjectToScene(vgo, _scene);
|
||||
_vol = vgo.AddComponent<Volume>();
|
||||
_vol.isGlobal = true; _vol.priority = cfg.volumePriority; _vol.weight = 1f;
|
||||
_prof = ScriptableObject.CreateInstance<VolumeProfile>();
|
||||
_prof.name = "WL_VividProfile(runtime)"; _prof.hideFlags = HideFlags.DontSave;
|
||||
var tm = _prof.Add<Tonemapping>(true); tm.mode.Override((TonemappingMode)Mathf.Clamp(cfg.tonemapMode, 0, 2));
|
||||
var ca = _prof.Add<ColorAdjustments>(true);
|
||||
ca.postExposure.Override(cfg.postExposure); ca.contrast.Override(cfg.contrast); ca.saturation.Override(cfg.saturation); ca.colorFilter.Override(cfg.colorFilter);
|
||||
var bl = _prof.Add<Bloom>(true); bl.threshold.Override(cfg.bloomThreshold); bl.intensity.Override(cfg.bloomIntensity); bl.scatter.Override(cfg.bloomScatter);
|
||||
var vg = _prof.Add<Vignette>(true); vg.intensity.Override(cfg.vignette);
|
||||
_vol.sharedProfile = _prof;
|
||||
}
|
||||
|
||||
int ApplyTerrain(WLVividLookSettings cfg)
|
||||
{
|
||||
int n = 0;
|
||||
var ts = Object.FindObjectsByType<Terrain>(FindObjectsSortMode.None);
|
||||
for (int i = 0; i < ts.Length; i++)
|
||||
{
|
||||
var t = ts[i]; if (t == null || !InScene(t)) continue;
|
||||
var src = t.materialTemplate; if (src == null || src.shader == null || src.shader.name.IndexOf("ToonTerrain", System.StringComparison.Ordinal) < 0) continue;
|
||||
var m = Own(src); if (t.materialTemplate != m) t.materialTemplate = m;
|
||||
_terrainMat = m;
|
||||
if (_done.Contains(m)) continue;
|
||||
SetColor(m, "_RedHighlight", cfg.terrainGrassHighlight); SetColor(m, "_RedShadow", cfg.terrainGrassShadow);
|
||||
SetColor(m, "_GreenHighlight", cfg.terrainSandHighlight); SetColor(m, "_GreenShadow", cfg.terrainSandShadow);
|
||||
if (cfg.terrainCloudStrength >= 0f && m.HasProperty("_Cloud_Strength")) m.SetFloat("_Cloud_Strength", cfg.terrainCloudStrength);
|
||||
if (cfg.terrainCloudDensity >= 0f && m.HasProperty("_Cloud_Density")) m.SetFloat("_Cloud_Density", cfg.terrainCloudDensity);
|
||||
if (cfg.terrainBrightness >= 0f && m.HasProperty("_Brightness")) m.SetFloat("_Brightness", cfg.terrainBrightness);
|
||||
if (cfg.terrainMinimumDarkness >= 0f && m.HasProperty("_MinimumDarkness")) m.SetFloat("_MinimumDarkness", cfg.terrainMinimumDarkness);
|
||||
if (cfg.terrainShades >= 0f && m.HasProperty("_Shades")) m.SetFloat("_Shades", cfg.terrainShades);
|
||||
_done.Add(m); TerrainTuned++; n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static readonly string[] s_lightFloats = { "_Cloud_Strength", "_Cloud_Density", "_Cloud_Cover", "_Cloud_Change", "_Brightness", "_MinimumDarkness", "_Shades" };
|
||||
static readonly string[] s_lightVectors = { "_Cloud_Movement", "_Cloud_Step" };
|
||||
Material _terrainMat; // 이 씬 지형의 런타임 재질(풀잎 빛 값 기준)
|
||||
static FieldInfo s_cfgField;
|
||||
int ApplyGrass(WLVividLookSettings cfg)
|
||||
{
|
||||
int n = 0;
|
||||
var insts = Object.FindObjectsByType<global::Environment.Instancing.InstancesBehaviour>(FindObjectsSortMode.None);
|
||||
if (s_cfgField == null) s_cfgField = typeof(global::Environment.Instancing.InstancesBehaviour).GetField("instancingConfigurations", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if (s_cfgField == null) return 0;
|
||||
for (int i = 0; i < insts.Length; i++)
|
||||
{
|
||||
var ib = insts[i]; if (ib == null || !InScene(ib)) continue;
|
||||
var list = s_cfgField.GetValue(ib) as List<global::Environment.Instancing.InstancingConfiguration>;
|
||||
if (list == null) continue;
|
||||
for (int k = 0; k < list.Count; k++)
|
||||
{
|
||||
var c = list[k]; if (c == null || c.Material == null) continue;
|
||||
var src = c.Material;
|
||||
if (_done.Contains(src)) continue;
|
||||
bool flower = src.name.IndexOf("Flower", System.StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
bool grass = src.name.IndexOf("Grass", System.StringComparison.OrdinalIgnoreCase) >= 0;
|
||||
if (!(grass || (flower && cfg.flowerEnabled != 0))) continue;
|
||||
var m = Own(src);
|
||||
if (cfg.grassShaderSwap == 0)
|
||||
{ // 원래 셰이더 · 원래 모양 그대로 — 색만 지형 잔디색과 통일(원래 데모도 풀잎 = 지형 잔디 같은 값)
|
||||
// 2026-11-25 던전 2 실측: 지형 그늘 최소 0.12 · 풀잎 0.2(섬 값 맞춤 장치가 안 걸린 씬) → 구름 그늘에서 풀잎만 밝게 떠 모양이 도드라짐
|
||||
// → 같은 씬 지형의 빛 값(구름 · 밝기 · 그늘 최소 · 단계)을 풀잎 · 꽃에 그대로 복사(지형이 아직 없으면 다음 확인 때)
|
||||
if (cfg.grassMatchTerrainLighting != 0)
|
||||
{
|
||||
if (_terrainMat == null) continue;
|
||||
for (int p = 0; p < s_lightFloats.Length; p++) if (m.HasProperty(s_lightFloats[p]) && _terrainMat.HasProperty(s_lightFloats[p])) m.SetFloat(s_lightFloats[p], _terrainMat.GetFloat(s_lightFloats[p]));
|
||||
for (int p = 0; p < s_lightVectors.Length; p++) if (m.HasProperty(s_lightVectors[p]) && _terrainMat.HasProperty(s_lightVectors[p])) m.SetVector(s_lightVectors[p], _terrainMat.GetVector(s_lightVectors[p]));
|
||||
}
|
||||
if (grass && cfg.grassMatchTerrain != 0) { SetColor(m, "_DiffuseColor", cfg.terrainGrassHighlight); SetColor(m, "_ShadowDiffuseColor", cfg.terrainGrassShadow); }
|
||||
if (flower && cfg.flowerRecolor != 0) { SetColor(m, "_DiffuseColor", cfg.flowerOrigDiffuse); SetColor(m, "_ShadowDiffuseColor", cfg.flowerOrigShadow); }
|
||||
if (c.Material != m) c.Material = m;
|
||||
_done.Add(m); GrassSwapped++; n++;
|
||||
continue;
|
||||
}
|
||||
if (m.shader != cfg.grassShader) m.shader = cfg.grassShader;
|
||||
if (flower) { SetGrass(m, cfg.flowerRoot, cfg.flowerTip, cfg.flowerShadowRoot, cfg.flowerShadowTip, cfg.flowerTipPower, cfg.flowerBladeHeight, cfg); m.SetColor("_AltTip", cfg.flowerAltTip); m.SetFloat("_AltChance", cfg.flowerAltChance); }
|
||||
else { SetGrass(m, cfg.grassRoot, cfg.grassTip, cfg.grassShadowRoot, cfg.grassShadowTip, cfg.grassTipPower, cfg.grassBladeHeight, cfg); m.SetFloat("_AltChance", 0f); }
|
||||
c.Material = m;
|
||||
_done.Add(m); GrassSwapped++; n++;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static void SetGrass(Material m, Color root, Color tip, Color sRoot, Color sTip, float tipPow, float bladeH, WLVividLookSettings cfg)
|
||||
{
|
||||
m.SetColor("_GrassRoot", root); m.SetColor("_GrassTip", tip); m.SetColor("_GrassShadowRoot", sRoot); m.SetColor("_GrassShadowTip", sTip);
|
||||
m.SetFloat("_TipPower", tipPow); m.SetFloat("_BladeHeight", bladeH);
|
||||
m.SetColor("_PatchTint", cfg.grassPatchTint); m.SetColor("_PatchCoolTint", cfg.grassPatchCoolTint); m.SetFloat("_PatchScale", cfg.grassPatchScale); m.SetFloat("_PatchStrength", cfg.grassPatchStrength); m.SetFloat("_Jitter", cfg.grassJitter);
|
||||
m.SetFloat("_RampThreshold", cfg.grassRampThreshold); m.SetFloat("_RampSoftness", cfg.grassRampSoftness); m.SetFloat("_AmbientStrength", cfg.grassAmbient);
|
||||
m.SetFloat("_WindStrength", cfg.grassWindStrength); m.SetFloat("_WindDensity", cfg.grassWindDensity);
|
||||
m.SetVector("_WindMovement", new Vector4(cfg.grassWindMovement.x, cfg.grassWindMovement.y, 0f, 0f));
|
||||
}
|
||||
|
||||
static readonly List<Material> s_mats = new List<Material>();
|
||||
int ApplyRenderers(WLVividLookSettings cfg)
|
||||
{
|
||||
int n = 0;
|
||||
var rs = Object.FindObjectsByType<Renderer>(FindObjectsSortMode.None);
|
||||
for (int i = 0; i < rs.Length; i++)
|
||||
{
|
||||
var r = rs[i]; if (r == null || !InScene(r)) continue;
|
||||
r.GetSharedMaterials(s_mats);
|
||||
bool changed = false;
|
||||
for (int k = 0; k < s_mats.Count; k++)
|
||||
{
|
||||
var src = s_mats[k]; if (src == null || src.shader == null) continue;
|
||||
string sn = src.shader.name;
|
||||
if (cfg.waterEnabled != 0 && cfg.waterShader != null && (sn == cfg.waterSourceShader || src.shader == cfg.waterShader))
|
||||
{
|
||||
var m = Own(src);
|
||||
if (!_done.Contains(m)) { if (m.shader != cfg.waterShader) m.shader = cfg.waterShader; SetWater(m, cfg); _done.Add(m); WaterSwapped++; n++; }
|
||||
if (m != src) { s_mats[k] = m; changed = true; }
|
||||
}
|
||||
else if (cfg.propShadowEnabled != 0 && src.HasProperty("_ShadowDiffuseColor") && sn.IndexOf("Toon", System.StringComparison.Ordinal) >= 0 && !Skip(cfg, src.name))
|
||||
{
|
||||
var m = Own(src);
|
||||
// 다른 시스템(등급 연출 「WL tier3」)이 우리 복사본을 다시 복사한 재질 = 이미 값이 들어 있음 → 두 번 곱하지 않는다(9차 실측 1.2 × 1.2)
|
||||
if (!_done.Contains(m) && m.name.IndexOf(CloneTag, System.StringComparison.Ordinal) >= 0 && !_clones.ContainsValue(m)) _done.Add(m);
|
||||
if (!_done.Contains(m))
|
||||
{
|
||||
Color sh;
|
||||
if (!_origShadow.TryGetValue(m, out sh)) { sh = m.GetColor("_ShadowDiffuseColor"); _origShadow[m] = sh; } // 처음 본 값 = 원래 값(재적용 시 이중 변환 방지)
|
||||
m.SetColor("_ShadowDiffuseColor", new Color(Mathf.Clamp01(sh.r * cfg.propShadowMul + cfg.propShadowAdd.r), Mathf.Clamp01(sh.g * cfg.propShadowMul + cfg.propShadowAdd.g), Mathf.Clamp01(sh.b * cfg.propShadowMul + cfg.propShadowAdd.b), sh.a));
|
||||
if (m.HasProperty("_DiffuseColor"))
|
||||
{
|
||||
Color df;
|
||||
if (!_origDiffuse.TryGetValue(m, out df)) { df = m.GetColor("_DiffuseColor"); _origDiffuse[m] = df; }
|
||||
if (NameHas(cfg.propDiffuseNameContains, src.name)) m.SetColor("_DiffuseColor", new Color(df.r * cfg.propDiffuseMul.r, df.g * cfg.propDiffuseMul.g, df.b * cfg.propDiffuseMul.b, df.a));
|
||||
else m.SetColor("_DiffuseColor", df);
|
||||
}
|
||||
if (cfg.propCloudStrength >= 0f && m.HasProperty("_Cloud_Strength")) m.SetFloat("_Cloud_Strength", cfg.propCloudStrength);
|
||||
_done.Add(m); PropsTinted++; n++;
|
||||
}
|
||||
if (m != src) { s_mats[k] = m; changed = true; }
|
||||
}
|
||||
}
|
||||
if (changed) r.sharedMaterials = s_mats.ToArray();
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
static bool NameHas(string[] keys, string name)
|
||||
{
|
||||
if (keys == null || keys.Length == 0) return true; // 비면 전부
|
||||
for (int i = 0; i < keys.Length; i++) if (!string.IsNullOrEmpty(keys[i]) && name.IndexOf(keys[i], System.StringComparison.Ordinal) >= 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool Skip(WLVividLookSettings cfg, string name)
|
||||
{
|
||||
if (cfg.propSkipNameContains == null) return false;
|
||||
for (int i = 0; i < cfg.propSkipNameContains.Length; i++)
|
||||
if (!string.IsNullOrEmpty(cfg.propSkipNameContains[i]) && name.IndexOf(cfg.propSkipNameContains[i], System.StringComparison.Ordinal) >= 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void SetWater(Material m, WLVividLookSettings cfg)
|
||||
{
|
||||
m.SetColor("_Shallow", cfg.waterShallow); m.SetColor("_Mid", cfg.waterMid); m.SetColor("_Deep", cfg.waterDeep);
|
||||
m.SetFloat("_MidDepth", cfg.waterMidDepth); m.SetFloat("_DeepDepth", cfg.waterDeepDepth);
|
||||
m.SetColor("_FoamColor", cfg.waterFoamColor); m.SetFloat("_FoamDepth", cfg.waterFoamDepth);
|
||||
m.SetFloat("_RippleScale", cfg.waterRippleScale); m.SetFloat("_RippleSpeed", cfg.waterRippleSpeed); m.SetFloat("_RippleStrength", cfg.waterRippleStrength);
|
||||
m.SetFloat("_Sparkle", cfg.waterSparkle); m.SetFloat("_SparkleScale", cfg.waterSparkleScale); m.SetFloat("_SparkleThreshold", cfg.waterSparkleThreshold);
|
||||
m.SetFloat("_DeepVariation", cfg.waterDeepVariation); m.SetFloat("_DeepVariationScale", cfg.waterDeepVariationScale);
|
||||
m.renderQueue = (int)RenderQueue.Transparent;
|
||||
}
|
||||
|
||||
static void SetColor(Material m, string prop, Color c)
|
||||
{
|
||||
if (!m.HasProperty(prop)) return;
|
||||
c.a = m.GetColor(prop).a;
|
||||
m.SetColor(prop, c);
|
||||
}
|
||||
|
||||
public static string Describe()
|
||||
{
|
||||
return "vivid runner=" + (Instance != null) + " " + LastLog;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4758e0fd5fba2e449bf876938bef54a4
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// WLVividLookSettings.cs — 섬 「선명 룩」(원신풍 밝고 화사한 색감) 값 (2026-11-25 #1136 PD 「원신 같은 밝고 화사한 색감 · 아름다운 화풍의 섬」)
|
||||
//
|
||||
// 값만 여기 둔다(C45) — 러너 = WLVividLook.cs · 셰이더 = Shaders/WL_VividGrass.shader · WL_VividWater.shader
|
||||
// 모든 변경은 Play 중 런타임 복사본에만 한다(원본 에셋 · 씬 파일 0줄). enabled_ 0 = 지금 화면 그대로.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
using UnityEngine;
|
||||
|
||||
namespace WL.Look.Vivid
|
||||
{
|
||||
[CreateAssetMenu(menuName = "WL/Look/Vivid Look Settings", fileName = "WLVividLookSettings")]
|
||||
public sealed class WLVividLookSettings : ScriptableObject
|
||||
{
|
||||
public const string ResourcePath = "WL/WLVividLookSettings";
|
||||
|
||||
[Header("전체")]
|
||||
[Tooltip("0 = 끔(지금 화면 그대로)")] public int enabled_ = 1;
|
||||
[Tooltip("적용할 씬 이름(비면 전부) — 섬 + 던전 전투 맵(2026-11-25 PD 「던전도 적용」)")] public string[] scenes = { "Level01", "WL_FarmLook", "WL_Dungeon01", "WL_Dungeon02" };
|
||||
[Tooltip("다시 확인 간격(s) — 지형 · 풀 · 물이 늦게 생겨도 멱등 적용")] public float checkSeconds = 1f;
|
||||
public int verboseLog = 0;
|
||||
|
||||
[Header("후처리 볼륨(런타임 프로필)")]
|
||||
public int volumeEnabled = 1;
|
||||
public float volumePriority = 100f;
|
||||
[Tooltip("톤매핑 0 = 쓰지 않음(1차 실측: Neutral 은 흰 거품을 회색으로 누름)")] public int tonemapMode = 0;
|
||||
public float postExposure = 0f;
|
||||
public float contrast = 12f;
|
||||
public float saturation = 20f;
|
||||
public Color colorFilter = new Color(1f, 0.98f, 0.94f, 1f);
|
||||
public float bloomThreshold = 0.9f;
|
||||
public float bloomIntensity = 0.3f;
|
||||
public float bloomScatter = 0.6f;
|
||||
public float vignette = 0.1f;
|
||||
|
||||
[Header("툰 소품(덤불 · 나무 · 길 · 바위) 그늘색 — 새 색 = 원래 × mul + add")]
|
||||
public int propShadowEnabled = 1;
|
||||
public float propShadowMul = 1.15f;
|
||||
public Color propShadowAdd = new Color(-0.03f, 0.05f, 0.06f, 0f);
|
||||
[Tooltip("소품 밝은색 곱(덤불 · 나무가 밝은 섬에서 검게 뭉쳐 보이지 않게)")] public Color propDiffuseMul = new Color(1.2f, 1.2f, 1.12f, 1f);
|
||||
[Tooltip("밝은색 곱을 이 문자열이 이름에 든 재질에만(팔레트 텍스처 소품 = 덤불 · 섬 나무) — 던전 바위 · 사암에 곱하면 베이지로 바램(2026-11-25 실측)")] public string[] propDiffuseNameContains = { "Palette" };
|
||||
[Tooltip("소품 구름 그림자 세기(음수 = 원래 값 · 팩 기본 1.0 은 구름이 지나갈 때 덤불이 검게 꺼짐 · 지형과 같게)")] public float propCloudStrength = 0.25f;
|
||||
[Tooltip("이 문자열이 이름에 든 재질은 건너뛴다(캐릭터)")] public string[] propSkipNameContains = { "_ToonP" };
|
||||
|
||||
[Header("지형(ToonTerrain · R = 잔디 · G = 모래)")]
|
||||
public int terrainEnabled = 1;
|
||||
public Color terrainGrassHighlight = new Color(0.66f, 0.88f, 0.36f, 0f);
|
||||
public Color terrainGrassShadow = new Color(0.20f, 0.45f, 0.36f, 0f);
|
||||
public Color terrainSandHighlight = new Color(0.98f, 0.91f, 0.70f, 0f);
|
||||
public Color terrainSandShadow = new Color(0.66f, 0.55f, 0.42f, 0f);
|
||||
[Tooltip("구름 그림자 세기(음수 = 원래 값)")] public float terrainCloudStrength = 0.25f;
|
||||
[Tooltip("구름 크기(음수 = 원래 값 · 섬 · 던전 1 = 0.025 · 던전 2 원래 0.01 = 큰 구름이 화면을 덮어 어두움)")] public float terrainCloudDensity = -1f;
|
||||
[Tooltip("툰 밝기(음수 = 원래 값 · 섬 = 0.12)")] public float terrainBrightness = -1f;
|
||||
[Tooltip("그늘 최소 밝기(음수 = 원래 값)")] public float terrainMinimumDarkness = -1f;
|
||||
[Tooltip("명암 단계 수(음수 = 원래 값)")] public float terrainShades = -1f;
|
||||
|
||||
[Header("풀잎 — 기본 = 원래 셰이더 · 원래 모양 그대로 색만 지형 잔디색과 통일(2026-11-25 PD 「풀 느낌은 기존이 훨씬 좋다 · 색감만 통일」)")]
|
||||
public int grassEnabled = 1;
|
||||
[Tooltip("0 = 원래 셰이더(InstancedBillboardToon) 그대로 색만 맞춤 · 1 = WL_VividGrass 로 교체(끝 색 그라데이션 · 무리 얼룩)")] public int grassShaderSwap = 0;
|
||||
[Tooltip("원래 셰이더일 때 풀잎 밝은색/그늘색 = 지형 잔디 밝은색/그늘색(원래 데모도 두 값이 같았다)")] public int grassMatchTerrain = 1;
|
||||
[Tooltip("1 = 풀잎 · 꽃의 빛 값(구름 · 밝기 · 그늘 최소 · 단계)을 같은 씬 지형과 똑같이 — 다르면 구름 그늘에서 풀잎 모양이 도드라진다(던전 2 실측 0.12 vs 0.2)")] public int grassMatchTerrainLighting = 1;
|
||||
[Tooltip("원래 셰이더일 때 꽃 색을 바꿀지(0 = 원래 꽃 색)")] public int flowerRecolor = 0;
|
||||
public Color flowerOrigDiffuse = new Color(0.975f, 1f, 0.59f, 0f);
|
||||
public Color flowerOrigShadow = new Color(0.52f, 0.45f, 0.29f, 0f);
|
||||
public Shader grassShader;
|
||||
public Color grassRoot = new Color(0.25f, 0.55f, 0.30f, 1f);
|
||||
public Color grassTip = new Color(0.86f, 0.95f, 0.42f, 1f);
|
||||
public Color grassShadowRoot = new Color(0.13f, 0.36f, 0.33f, 1f);
|
||||
public Color grassShadowTip = new Color(0.36f, 0.62f, 0.42f, 1f);
|
||||
[Tooltip("끝 색이 올라오는 곡선(1 = 직선 · 클수록 끝에만)")] public float grassTipPower = 1.4f;
|
||||
[Tooltip("풀잎 메시 높이(오브젝트 좌표) — 끝 색 기준")] public float grassBladeHeight = 1.14f;
|
||||
[Tooltip("큰 얼룩 — 따뜻한(노란) 무리 색 곱")] public Color grassPatchTint = new Color(1.18f, 1.06f, 0.70f, 1f);
|
||||
[Tooltip("큰 얼룩 — 서늘한(청록) 무리 색 곱")] public Color grassPatchCoolTint = new Color(0.85f, 0.95f, 1.0f, 1f);
|
||||
public float grassPatchScale = 0.18f;
|
||||
public float grassPatchStrength = 0.7f;
|
||||
[Tooltip("작은 얼룩(한 포기씩 색 흔들림)")] public float grassJitter = 0.18f;
|
||||
public float grassRampThreshold = 0.45f;
|
||||
public float grassRampSoftness = 0.12f;
|
||||
public float grassAmbient = 0.25f;
|
||||
public float grassWindStrength = 0.3f;
|
||||
public float grassWindDensity = 0.2f;
|
||||
public Vector2 grassWindMovement = new Vector2(6f, 0f);
|
||||
|
||||
[Header("꽃(같은 셰이더 · 뿌리 = 줄기색 · 끝 = 꽃잎색)")]
|
||||
public int flowerEnabled = 1;
|
||||
public Color flowerRoot = new Color(0.40f, 0.66f, 0.30f, 1f);
|
||||
public Color flowerTip = new Color(1.00f, 0.98f, 0.86f, 1f);
|
||||
public Color flowerShadowRoot = new Color(0.20f, 0.42f, 0.34f, 1f);
|
||||
public Color flowerShadowTip = new Color(0.78f, 0.76f, 0.80f, 1f);
|
||||
[Tooltip("포기마다 이 확률로 꽃잎색을 바꾼다(흰 꽃 사이 노란 꽃)")] public Color flowerAltTip = new Color(1.00f, 0.86f, 0.30f, 1f);
|
||||
public float flowerAltChance = 0.35f;
|
||||
public float flowerTipPower = 2.2f;
|
||||
public float flowerBladeHeight = 1.4f;
|
||||
|
||||
[Header("물(WL_VividWater 로 셰이더 교체)")]
|
||||
public int waterEnabled = 1;
|
||||
public Shader waterShader;
|
||||
[Tooltip("원래 물 셰이더 이름(이 셰이더 재질만 교체)")] public string waterSourceShader = "Shader Graphs/Water";
|
||||
public Color waterShallow = new Color(0.45f, 0.95f, 0.90f, 0.35f);
|
||||
public Color waterMid = new Color(0.10f, 0.78f, 0.88f, 0.75f);
|
||||
public Color waterDeep = new Color(0.05f, 0.42f, 0.80f, 0.95f);
|
||||
[Tooltip("얕음 → 중간이 되는 깊이(m)")] public float waterMidDepth = 0.6f;
|
||||
[Tooltip("중간 → 깊음이 되는 깊이(m)")] public float waterDeepDepth = 2.2f;
|
||||
public Color waterFoamColor = new Color(1f, 1f, 1f, 0.9f);
|
||||
[Tooltip("물가 거품 폭(m · 깊이 기준)")] public float waterFoamDepth = 0.12f;
|
||||
public float waterRippleScale = 0.9f;
|
||||
public float waterRippleSpeed = 0.25f;
|
||||
[Tooltip("물결 밝은 줄 세기")] public float waterRippleStrength = 0.10f;
|
||||
[Tooltip("반짝임 세기 · 밀도")] public float waterSparkle = 0.85f;
|
||||
public float waterSparkleScale = 7f;
|
||||
[Tooltip("잡음 2개의 곱이 이 값을 넘는 곳만 반짝(클수록 드묾 · 0.7~0.85)")] public float waterSparkleThreshold = 0.72f;
|
||||
[Tooltip("깊은 바다 큰 색 얼룩 세기 · 크기")] public float waterDeepVariation = 0.25f;
|
||||
public float waterDeepVariationScale = 0.06f;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ddfb5dff9805547479f74fe19b3a3ddc
|
||||
Loading…
Reference in New Issue