From 3752b0484c9d0563e1cabc70446b17ba04c9378f Mon Sep 17 00:00:00 2001 From: swrring Date: Tue, 15 Sep 2026 23:39:35 +0900 Subject: [PATCH] =?UTF-8?q?[WL-816ze]=20=EB=B0=94=EB=8B=A4=20=EB=B0=94?= =?UTF-8?q?=EB=8B=A5=ED=8C=90(SpawnSeabed)=20=E2=80=94=20=EB=8D=B0?= =?UTF-8?q?=EB=AA=A8=20=EB=AC=BC=20=EC=85=B0=EC=9D=B4=EB=8D=94=EB=8A=94=20?= =?UTF-8?q?=EA=B9=8A=EC=9D=B4=EB=A1=9C=20=EC=83=89=C2=B7=EA=B1=B0=ED=92=88?= =?UTF-8?q?=EC=9D=84=20=EC=A0=95=ED=95=98=EB=8A=94=EB=8D=B0=20=EB=B0=94?= =?UTF-8?q?=EB=8B=A5=EC=9D=B4=20=EC=97=86=EC=96=B4=20=EB=B0=B0=EA=B2=BD?= =?UTF-8?q?=EC=83=89=EC=9D=B4=20=EB=B9=84=EC=B3=90=20=EC=A7=84=ED=8C=8C?= =?UTF-8?q?=EB=9E=91=EC=9D=B4=EB=8D=98=20=EA=B2=83=20=E2=86=92=20=EB=AC=BC?= =?UTF-8?q?=20=EC=95=84=EB=9E=98=200.8=20m=20=EB=AA=A8=EB=9E=98=EC=83=89?= =?UTF-8?q?=20=ED=8C=90=201=EC=9E=A5(=EC=82=BC=EA=B0=81=ED=98=95=202=20?= =?UTF-8?q?=C2=B7=20=EB=90=98=EB=8F=8C=EB=A6=AC=EA=B8=B0=20seabedEnabled?= =?UTF-8?q?=200)=20(#816)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 --- Assets/WL/Look/Farm/WLIslandLook.cs | 54 +++++++++++++++++++++ Assets/WL/Look/Farm/WLIslandLookSettings.cs | 14 ++++++ 2 files changed, 68 insertions(+) diff --git a/Assets/WL/Look/Farm/WLIslandLook.cs b/Assets/WL/Look/Farm/WLIslandLook.cs index 473ce2324..a1f1714d7 100644 --- a/Assets/WL/Look/Farm/WLIslandLook.cs +++ b/Assets/WL/Look/Farm/WLIslandLook.cs @@ -134,6 +134,7 @@ namespace WL.Look.Farm // ๐Ÿ”ด 816zf โ€” ํ™ ๋ฐ์นผ์€ **ํ’€๋ณด๋‹ค ๋จผ์ €** ๋งŒ๋“ ๋‹ค. ํ’€์˜ ๋ฐญ ์ œ์™ธ๊ฐ€ ์ด ๋งˆ์Šคํฌ๋ฅผ ์ฝ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. if (cfg.softDirtEnabled != 0) SpawnSoftDirt(cfg, scene); + if (cfg.seabedEnabled != 0) SpawnSeabed(cfg, scene); if (cfg.grassEnabled != 0) SpawnGrass(cfg, scene); if (cfg.shoreFoamEnabled != 0) SpawnShoreFoam(cfg, scene); @@ -305,6 +306,59 @@ namespace WL.Look.Farm SoftDirtSpawned = true; } + public static bool SeabedSpawned; + public static string SeabedLog = ""; + + /// + /// 2026-09-15 Lead ์‹ค์ธก โ€” ๋ฐ๋ชจ ๋ฌผ ์…ฐ์ด๋”(`Farm_Water_Demo3` = ๋ฐ๋ชจ `Water.mat`)๋Š” **๊นŠ์ด**๋กœ ์ƒ‰ยท๊ฑฐํ’ˆ์„ ์ •ํ•œ๋‹ค. + /// ๋ฐ๋ชจ ์—ฐ๋ชป์€ ๋ฐ”๋‹ฅ์ด 1 m ์•ˆํŒŽ์ด๋ผ ์ฒญ๋ก + ํฐ ๋ฌผ๊ฐ€๊ฐ€ ๋‚˜์˜ค์ง€๋งŒ, ์šฐ๋ฆฌ ๋ฐ”๋‹ค๋Š” ๋ฐ‘์— ์•„๋ฌด๊ฒƒ๋„ ์—†์–ด ์นด๋ฉ”๋ผ ๋ฐฐ๊ฒฝ์ƒ‰์ด ๋น„์ณ + /// ์ง„ํŒŒ๋ž‘์œผ๋กœ ์ฐํ˜”๋‹ค(PD ใ€Œ๋ฐ๋ชจ์™€ ๋А๋‚Œ์ด ๋‹ค๋ฅด๋‹คใ€์˜ ํฐ ๋ชซ). ๋ฌผ ์•„๋ž˜ `seabedDepth` ์— ๋ชจ๋ž˜์ƒ‰ ์–ธ๋ฆฟ ํŒ 1์žฅ(์‚ผ๊ฐํ˜• 2 ยท ๋“œ๋กœ์šฐ์ฝœ 1)์„ ๊น๋‹ค. + /// ๐Ÿ”ด ๋ชจ๋ฐ”์ผ ๋นŒ๋“œ: `Universal Render Pipeline/Unlit` ์ด ๋นŒ๋“œ์— ํฌํ•จ๋˜์ง€ ์•Š์œผ๋ฉด ๋ถ„ํ™ โ†’ Always Included ํ™•์ธ. + /// + public static void SpawnSeabed(WLIslandLookSettings cfg, Scene scene) + { + const string Name = "~WL_Seabed"; + float waterY = -1f; bool found = false; + var mrs = Object.FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None); + for (int i = 0; i < mrs.Length; i++) + { + var r = mrs[i]; + if (r == null || r.gameObject.name != "Water" || (scene.IsValid() && r.gameObject.scene != scene)) continue; + waterY = r.transform.position.y; found = true; break; + } + GameObject go = null; + for (int i = 0; i < mrs.Length; i++) if (mrs[i] != null && mrs[i].gameObject.name == Name) { go = mrs[i].gameObject; break; } + if (go == null) + { + go = new GameObject(Name); + if (scene.IsValid()) SceneManager.MoveGameObjectToScene(go, scene); + var mf = go.AddComponent(); + var mesh = new Mesh { name = "WL_SeabedQuad" }; + mesh.vertices = new[] { new Vector3(-0.5f, 0f, -0.5f), new Vector3(-0.5f, 0f, 0.5f), new Vector3(0.5f, 0f, 0.5f), new Vector3(0.5f, 0f, -0.5f) }; + mesh.triangles = new[] { 0, 1, 2, 0, 2, 3 }; + mesh.normals = new[] { Vector3.up, Vector3.up, Vector3.up, Vector3.up }; + mesh.uv = new[] { Vector2.zero, Vector2.up, Vector2.one, Vector2.right }; + mesh.RecalculateBounds(); + mf.sharedMesh = mesh; + var mr = go.AddComponent(); + var sh = Shader.Find("Universal Render Pipeline/Unlit"); + var mat = new Material(sh != null ? sh : Shader.Find("Unlit/Color")) { name = "WL_Seabed(runtime)" }; + mr.sharedMaterial = mat; + mr.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; + mr.receiveShadows = false; + mr.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; + } + var m = go.GetComponent().sharedMaterial; + if (m.HasProperty("_BaseColor")) m.SetColor("_BaseColor", cfg.seabedColor); + if (m.HasProperty("_Color")) m.SetColor("_Color", cfg.seabedColor); + go.transform.position = new Vector3(0f, waterY - Mathf.Max(0.05f, cfg.seabedDepth), 0f); + go.transform.rotation = Quaternion.identity; + go.transform.localScale = new Vector3(Mathf.Max(1f, cfg.seabedSize), 1f, Mathf.Max(1f, cfg.seabedSize)); + go.SetActive(cfg.seabedEnabled != 0); + SeabedSpawned = true; + SeabedLog = "๋ฐ”๋‹ค ๋ฐ”๋‹ฅํŒ y=" + go.transform.position.y.ToString("F2") + (found ? "(๋ฌผ " + waterY.ToString("F2") + ")" : "(๋ฌผ ๋ฏธ๋ฐœ๊ฒฌ ยท ๊ธฐ๋ณธ -1)") + " ยท ๊นŠ์ด " + cfg.seabedDepth + " m"; + } + /// ์„ฌ ๋‘˜๋ ˆ ๊ฑฐํ’ˆ ๋  โ€” ํ’€๊ณผ ๊ฐ™์€ ์ž๋ฆฌ์—์„œ ๋งŒ๋“ค๊ณ  ๊ฐ™์€ ํ›…์œผ๋กœ ๋‹ค์‹œ ๋งŒ๋“ ๋‹ค(816j2). public static void SpawnShoreFoam(WLIslandLookSettings cfg, Scene scene) { diff --git a/Assets/WL/Look/Farm/WLIslandLookSettings.cs b/Assets/WL/Look/Farm/WLIslandLookSettings.cs index a7dfe1773..a0bc3f118 100644 --- a/Assets/WL/Look/Farm/WLIslandLookSettings.cs +++ b/Assets/WL/Look/Farm/WLIslandLookSettings.cs @@ -292,6 +292,20 @@ namespace WL.Look.Farm [Tooltip("ํ™ ์–ผ๋ฃฉ์˜ ์„ธ๊ธฐ(0~1). ํ•œ ๋ฉ์–ด๋ฆฌ ๋‹จ์ƒ‰์œผ๋กœ ๋ณด์ด์ง€ ์•Š๊ฒŒ ๋ฐ๊ธฐ๋ฅผ ์ด๋งŒํผ ํ”๋“ ๋‹ค.")] [Range(0f, 1f)] public float softDirtTexNoise = 0.08f; + // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยง0-b ๋ฐ”๋‹ค ๋ฐ”๋‹ฅ (2026-09-15 Lead ์‹ค์ธก) + [Header("ยง0-b โ€” ๋ฌผ ๋ฐ‘ ๋ฐ”๋‹ฅํŒ (๋ฐ๋ชจ ์—ฐ๋ชป์€ ๋ฐ”๋‹ฅ์ด ์–•์•„ ๋ฌผ์ด ์ฒญ๋ก ยท ์šฐ๋ฆฌ๋Š” ๋ฐ”๋‹ฅ์ด ์—†์–ด ๋ฐฐ๊ฒฝ์ƒ‰์ด ๋น„์ณ ์ง„ํŒŒ๋ž‘)")] + [Tooltip("1 = ๋ฌผ ํ‘œ๋ฉด ์•„๋ž˜์— ๋ชจ๋ž˜์ƒ‰ ๋ฐ”๋‹ฅํŒ 1์žฅ์„ ๊น๋‹ค. ๋ฐ๋ชจ ๋ฌผ ์…ฐ์ด๋”๋Š” ๊นŠ์ด๋กœ ์ƒ‰ยท๊ฑฐํ’ˆ์„ ์ •ํ•˜๋ฏ€๋กœ ๋ฐ”๋‹ฅ์ด ์žˆ์–ด์•ผ ๋ฐ๋ชจ์ฒ˜๋Ÿผ ์ฒญ๋ก ๋ฌผ + ํฐ ๋ฌผ๊ฐ€๊ฐ€ ๋‚˜์˜จ๋‹ค. 0 = ์—†์Œ(๋ฐฐ๊ฒฝ์ƒ‰์ด ๋น„์นจ).")] + public int seabedEnabled = 1; + + [Tooltip("๋ฌผ ํ‘œ๋ฉด์—์„œ ๋ฐ”๋‹ฅํŒ๊นŒ์ง€ ๊นŠ์ด(m). ์–•์„์ˆ˜๋ก ์ฒญ๋กยท๊ฑฐํ’ˆ์ด ์ง„ํ•ด์ง„๋‹ค.")] + public float seabedDepth = 0.8f; + + [Tooltip("๋ฐ”๋‹ฅํŒ ํ•œ ๋ณ€ ๊ธธ์ด(m). ์นด๋ฉ”๋ผ๊ฐ€ ๋ณด๋Š” ๋ฒ”์œ„๋งŒ ๋ฎ์œผ๋ฉด ๋œ๋‹ค.")] + public float seabedSize = 400f; + + [Tooltip("๋ฐ”๋‹ฅํŒ ์ƒ‰(์–ธ๋ฆฟ ยท sRGB). ๊ธฐ๋ณธ = ๋ฐ๋ชจ ๋ชจ๋ž˜์ƒ‰.")] + public Color seabedColor = new Color(0.71f, 0.706f, 0.549f, 1f); + // โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ยง1 ํ’€๋ฐญ [Header("ยง1 โ€” ์„ฌ ํƒ€์ผ ์œ„ ํ’€๋ฐญ (๋ฐ๋ชจ์™€ ๊ฐ™์€ ์ธ์Šคํ„ด์‹ฑ)")] [Tooltip("0 ์ด๋ฉด ํ’€์„ ๊น”์ง€ ์•Š๋Š”๋‹ค.")]