2026-06-09 룸 프로토타입 디자인 (진행중)

This commit is contained in:
skrwns304@gmail.com
2026-06-09 20:53:26 +09:00
parent 3a18351d17
commit 4c955dafc3
3544 changed files with 226503 additions and 17 deletions

View File

@@ -0,0 +1,38 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
#define THREAD_GROUPS 64
#pragma kernel SampleOffsets
#include "..\Libraries\Height.hlsl"
//Input
StructuredBuffer<float3> positions;
uint sampleCount; //Length of 'positions' array
//Output
RWStructuredBuffer<float> offsets;
[numthreads(THREAD_GROUPS,1,1)]
void SampleOffsets(uint id : SV_DispatchThreadID)
{
//Early out when no more positions are left to process
//Important for the Metal API, as it avoids accessing unbound array elements!
if(id > sampleCount) return;
const uint index = (uint)(id);
//Input positions to sample at
const float3 positionWS = positions[index];
//Position, relative to rendering bounds (normalized 0-1)
const float2 uv = WorldToHeightUV(positionWS);
//Texel value at coordinates
float2 heights = SampleHeightBuffer(uv).rg;
//Output
offsets[index] = heights.r + heights.g;
}