diff --git a/Assets/VoxelProjectSeries/Scenes/World.unity b/Assets/VoxelProjectSeries/Scenes/World.unity index c36b92f..57cdac1 100644 --- a/Assets/VoxelProjectSeries/Scenes/World.unity +++ b/Assets/VoxelProjectSeries/Scenes/World.unity @@ -135,6 +135,7 @@ GameObject: - component: {fileID: 414495108} - component: {fileID: 414495107} - component: {fileID: 414495110} + - component: {fileID: 414495112} - component: {fileID: 414495111} m_Layer: 0 m_Name: Main Camera @@ -258,6 +259,23 @@ MonoBehaviour: freeLookSensitivity: 3 zoomSensitivity: 10 fastZoomSensitivity: 50 +--- !u!114 &414495112 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 414495106} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa0594ff7769e8f44bb15eb5bf3f67db, type: 3} + m_Name: + m_EditorClassIdentifier: + ReplaceBlockInPlace: 0 + toolMode: 1 + toolType: 1 + radiusToAffect: 4 + voxelIDToPlace: 0 --- !u!1 &1147823335 GameObject: m_ObjectHideFlags: 0 @@ -475,7 +493,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e0e65ef4e51bde8429033f2ff79c2aa4, type: 3} m_Name: m_EditorClassIdentifier: - worldMaterial: {fileID: 2100000, guid: d41578d92bc26b04bb2355aed476d2cb, type: 2} + worldMaterials: + - {fileID: 2100000, guid: d41578d92bc26b04bb2355aed476d2cb, type: 2} + - {fileID: 2100000, guid: 313f0b3da4a8a8b4ea348a14fbeb4548, type: 2} voxelDetails: - texture: {fileID: 2800000, guid: 64b479ecc48ec9343aa615792b72a11d, type: 3} color: @@ -512,7 +532,7 @@ MonoBehaviour: maxHeight: 256 renderDistance: 64 sharedVertices: 0 - useTextures: 1 + useTextures: 0 mainCamera: {fileID: 414495109} maxChunksToProcessPerFrame: 8 --- !u!114 &1755072227 diff --git a/Assets/VoxelProjectSeries/Scripts/Camera/TerrainInteractor.cs b/Assets/VoxelProjectSeries/Scripts/Camera/TerrainInteractor.cs new file mode 100644 index 0000000..b6d28e4 --- /dev/null +++ b/Assets/VoxelProjectSeries/Scripts/Camera/TerrainInteractor.cs @@ -0,0 +1,124 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.Mathematics; +using UnityEngine; + +public class TerrainInteractor : MonoBehaviour +{ + public bool ReplaceBlockInPlace = false; + public ToolMode toolMode; + public ToolType toolType; + public int radiusToAffect = 2; + public int voxelIDToPlace = 4; + + + void Update() + { + if (Input.GetKeyDown(KeyCode.Space)) + { + ReplaceBlockInPlace = !ReplaceBlockInPlace; + } + if (Input.GetKeyDown(KeyCode.Tab)) + { + int indexOf = (int)toolMode; + toolMode = indexOf == 1 ? ToolMode.Single : ToolMode.Continuous; + } + if (Input.GetKeyDown(KeyCode.M)) + { + toolMode = ToolMode.Continuous; + toolType = ToolType.SingleBlock; + voxelIDToPlace = 240; + } + + if (toolMode == ToolMode.Single ? Input.GetMouseButtonDown(1) : Input.GetMouseButton(1)) + { + //Spawn water as demo + if (GetBlockCoordAtRay(out Vector3 chunkPos, out Vector3 blockPos)) + { + if (blockPos.y < 0) + return; + + float v = voxelIDToPlace == 240 ? 1 : 0; + if (toolType == ToolType.SingleBlock) + WorldManager.Instance.SetVoxelAtCoord(chunkPos, math.round(blockPos), new Voxel() { ID = voxelIDToPlace, ActiveValue = v }); + else + { + for (int x = -radiusToAffect; x < radiusToAffect; x++) + for (int y = -radiusToAffect; y < radiusToAffect; y++) + for (int z = -radiusToAffect; z < radiusToAffect; z++) + { + Vector3 modPos = math.round(blockPos + new Vector3(x, y, z)); + if ((modPos.y < 0 && voxelIDToPlace != 0) || (modPos.y < 1 && voxelIDToPlace == 0)) + continue; + WorldManager.Instance.SetVoxelAtCoord(chunkPos, blockPos + new Vector3(x, y, z), new Voxel() { ID = voxelIDToPlace, ActiveValue = v }); + + } + } + } + + } + } + + bool GetBlockCoordAtRay(out Vector3 ChunkPos, out Vector3 blockPos) + { + if (Physics.Raycast(new Ray(transform.position, transform.forward), out var hitInfo)) + { + if (hitInfo.collider.transform.GetComponent() != null) + { + ChunkPos = hitInfo.collider.transform.GetComponent().chunkPosition; + blockPos = math.floor(hitInfo.point - ChunkPos); + if (hitInfo.normal.x != 0) + { + blockPos.x = math.round(blockPos.x); + } + else + { + blockPos.x = math.floor(blockPos.x); + } + if (hitInfo.normal.y != 0) + { + blockPos.y = math.round(blockPos.y); + } + else + { + blockPos.y = math.floor(blockPos.y); + } + if (hitInfo.normal.z != 0) + { + blockPos.z = math.round(blockPos.z); + } + else + { + blockPos.z = math.floor(blockPos.z); + } + + if (ReplaceBlockInPlace) + { + if (hitInfo.normal.x > 0 || hitInfo.normal.y > 0 || hitInfo.normal.z > 0) + blockPos -= hitInfo.normal; + } + else + { + + if (hitInfo.normal.x < 0 || hitInfo.normal.y < 0 || hitInfo.normal.z < 0) + blockPos += hitInfo.normal; + } + return true; + } + } + ChunkPos = Vector3.zero; + blockPos = Vector3.zero; + return false; + } + + public enum ToolMode + { + Single, + Continuous + } + public enum ToolType + { + SingleBlock, + Radius + } +} \ No newline at end of file diff --git a/Assets/VoxelProjectSeries/Scripts/Camera/TerrainInteractor.cs.meta b/Assets/VoxelProjectSeries/Scripts/Camera/TerrainInteractor.cs.meta new file mode 100644 index 0000000..7809ecd --- /dev/null +++ b/Assets/VoxelProjectSeries/Scripts/Camera/TerrainInteractor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa0594ff7769e8f44bb15eb5bf3f67db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VoxelProjectSeries/Scripts/ComputeShaders/HeightMapNoise.compute b/Assets/VoxelProjectSeries/Scripts/ComputeShaders/HeightMapNoise.compute index 3fb06ec..1e3a11b 100644 --- a/Assets/VoxelProjectSeries/Scripts/ComputeShaders/HeightMapNoise.compute +++ b/Assets/VoxelProjectSeries/Scripts/ComputeShaders/HeightMapNoise.compute @@ -7,6 +7,8 @@ struct Voxel { int ID; + float ActiveValue; + int CantUpdateFurther; }; struct NoiseLayer { @@ -121,10 +123,19 @@ void FillArray(uint3 id : SV_DispatchThreadID) Voxel vox; vox.ID = 0; + vox.ActiveValue = 0; + vox.CantUpdateFurther = 1; if (id.y > terrainHeight) { vox.ID = 0; + + if (vox.ID == 0 && id.y <= 2) + { + vox.ID = 240; + InterlockedAdd(count[0], 1); + } + voxelArray[flattenCoord(id)] = vox; return; } @@ -189,5 +200,7 @@ void ClearArray(uint3 id : SV_DispatchThreadID) { Voxel emptyVoxel; emptyVoxel.ID = 0; + emptyVoxel.ActiveValue = 0; + emptyVoxel.CantUpdateFurther = 1; voxelArray[flattenCoord(id)] = emptyVoxel; } \ No newline at end of file diff --git a/Assets/VoxelProjectSeries/Scripts/ComputeShaders/VoxelCompute.compute b/Assets/VoxelProjectSeries/Scripts/ComputeShaders/VoxelCompute.compute index 098c09a..958cab3 100644 --- a/Assets/VoxelProjectSeries/Scripts/ComputeShaders/VoxelCompute.compute +++ b/Assets/VoxelProjectSeries/Scripts/ComputeShaders/VoxelCompute.compute @@ -11,6 +11,8 @@ struct VoxelDetails struct Voxel { int ID; + float ActiveValue; + int CantUpdateFurther; }; struct sharedVert @@ -25,6 +27,7 @@ RWStructuredBuffer vertexBuffer; RWStructuredBuffer normalBuffer; RWStructuredBuffer colorBuffer; RWStructuredBuffer indexBuffer; +RWStructuredBuffer transparentIndexBuffer; RWStructuredBuffer counter; float3 chunkPosition; @@ -63,6 +66,11 @@ bool VoxelIsSolid(uint3 pos) return voxelArray[flattenCoord(pos)].ID != 0; } +bool VoxelIsTransparent(uint3 pos) +{ + return voxelArray[flattenCoord(pos)].ID == 240; +} + static uint3 getCellCenterForIDX(int idx, int axis, int corner) { uint3 cellCenter = CellCentersByAxis[axis][corner]; @@ -85,6 +93,8 @@ void calculateContour(uint3 blockCoord, out float3 position, out float3 normal, float3 adjacentCellPos; float3 adjacentCellRoot; float3 liveCellPos; + int adjacentRootCellId; + int adjacentCellId; uint3 vWorldPos = blockCoord + vertexPos; //take local block coord, add the cubed position int counter = 0; currentCell = voxelArray[flattenCoord(blockCoord)]; @@ -99,16 +109,28 @@ void calculateContour(uint3 blockCoord, out float3 position, out float3 normal, adjacentRootCell = voxelArray[flattenCoord(adjacentCellRoot)]; adjacentCell = voxelArray[flattenCoord(adjacentCellPos)]; + + adjacentRootCellId = adjacentRootCell.ID; + adjacentCellId = adjacentCell.ID; + if (adjacentRootCell.ID == 240 && currentCell.ID != 240) + adjacentRootCellId = 0; + if (adjacentCell.ID == 240 && currentCell.ID != 240) + adjacentCellId = 0; - adjacentRootCellDensity = adjacentRootCell.ID != 0 ? 1 : 0; - adjacentCellDensitiy = adjacentCell.ID != 0 ? 1 : 0; + if (currentCell.ID == 240 && adjacentRootCell.ID != 240) + adjacentRootCellId = 0; + if (currentCell.ID == 240 && adjacentCell.ID != 240) + adjacentCellId = 0; + + adjacentRootCellDensity = adjacentRootCellId != 0 ? 1 : 0; + adjacentCellDensitiy = adjacentCellId != 0 ? 1 : 0; normal += (adjacentCellDensitiy - adjacentRootCellDensity) * -axis[idx][ax]; if (adjacentRootCellDensity != adjacentCellDensitiy) { - liveCellPos = adjacentCell.ID != 0 ? adjacentCellPos : adjacentCellRoot; - adjacentCellPos = adjacentCell.ID == 0 ? adjacentCellPos : adjacentCellRoot; + liveCellPos = adjacentCellId != 0 ? adjacentCellPos : adjacentCellRoot; + adjacentCellPos = adjacentCellId == 0 ? adjacentCellPos : adjacentCellRoot; position += adjacentCellPos + ((liveCellPos - adjacentCellPos) * getCellCenterForIDX(idx, ax, corner)) / 2; //lerp(adjacentCellRoot + ((float3) (adjacentCellPos - adjacentCellRoot) * ((0 - adjacentRootCellDensity) / (adjacentCellDensitiy - adjacentRootCellDensity))), vWorldPos, 0); //change 0 to byte value counter++; @@ -140,8 +162,9 @@ void CSMain(uint3 id : SV_DispatchThreadID) float3 faceVertices[4]; float3 faceNorms[4]; - float4 color = float4(useTextures && voxelColors[block.ID - 1].color == -1 ? ((float)block.ID - 1) : voxelColors[block.ID - 1].color, - packFloats(voxelColors[block.ID - 1].metallic, voxelColors[block.ID - 1].smoothness), 0, 0); + float4 color = float4(block.ID == 240 ? 240 : + (useTextures && voxelColors[block.ID - 1].color == -1 ? ((float) block.ID - 1) : voxelColors[block.ID - 1].color), + packFloats(voxelColors[block.ID - 1].metallic, voxelColors[block.ID - 1].smoothness), 0, 0); uint vertCount = 0; uint triCount = 0; @@ -155,7 +178,10 @@ void CSMain(uint3 id : SV_DispatchThreadID) { //Check if there's a solid block against this face - if (VoxelIsSolid(id + voxelFaceChecks[i])) + if (VoxelIsSolid(id + voxelFaceChecks[i]) && !VoxelIsTransparent(id + voxelFaceChecks[i])) + continue; + + if (block.ID == 240 && VoxelIsTransparent(id + voxelFaceChecks[i])) continue; //Draw this face @@ -163,7 +189,10 @@ void CSMain(uint3 id : SV_DispatchThreadID) if (!sharedVertices) { InterlockedAdd(counter[0], 6, vertCount); - InterlockedAdd(counter[1], 6, triCount); + if (block.ID != 240) + InterlockedAdd(counter[1], 6, triCount); + else + InterlockedAdd(counter[2], 6, triCount); for (int j = 0; j < 4; j++) { @@ -177,12 +206,18 @@ void CSMain(uint3 id : SV_DispatchThreadID) color.b = voxelUVs[voxelTris[i][k]].x; color.a = voxelUVs[voxelTris[i][k]].y; colorBuffer[vertCount + k] = color; - indexBuffer[triCount + k] = vertCount + k; + if (block.ID != 240) + indexBuffer[triCount + k] = vertCount + k; + else + transparentIndexBuffer[triCount + k] = vertCount + k; } } else { - InterlockedAdd(counter[1], 6, triCount); + if (block.ID != 240) + InterlockedAdd(counter[1], 6, triCount); + else + InterlockedAdd(counter[2], 6, triCount); for (int k = 0; k < 6; k++) { int idx = voxelTrisMapped[i][k]; @@ -204,7 +239,10 @@ void CSMain(uint3 id : SV_DispatchThreadID) colorBuffer[vertCount] = color; } - indexBuffer[triCount + k] = sharedVerts[idx].index; + if (block.ID != 240) + indexBuffer[triCount + k] = sharedVerts[idx].index; + else + transparentIndexBuffer[triCount + k] = sharedVerts[idx].index; } } diff --git a/Assets/VoxelProjectSeries/Scripts/Data/Chunk.cs b/Assets/VoxelProjectSeries/Scripts/Data/Chunk.cs index 85bd0c1..1e056f0 100644 --- a/Assets/VoxelProjectSeries/Scripts/Data/Chunk.cs +++ b/Assets/VoxelProjectSeries/Scripts/Data/Chunk.cs @@ -20,10 +20,13 @@ public class Chunk : MonoBehaviour public ChunkState chunkState = ChunkState.Idle; public GeneratingState generationState = GeneratingState.Idle; - public void Initialize(Material mat, Vector3 position) + public bool needProcessBlockTicks = false; + public List blockPosToUpdate = new List(); + + public void Initialize(Material[] mats, Vector3 position) { ConfigureComponents(); - meshRenderer.sharedMaterial = mat; + meshRenderer.sharedMaterials = mats; chunkPosition = position; } @@ -94,6 +97,24 @@ public void ProcessNoiseForStructs(NoiseBuffer noiseBuffer) noiseBuffer.voxelArray[kvp.Key] = kvp.Value; } + if (needProcessBlockTicks) + { + foreach (Vector3 v in blockPosToUpdate) + { + ActiveVoxelManager.UpdateVoxel(chunkPosition, v, WorldManager.Instance.activeVoxels[chunkPosition][v], ref noiseBuffer); + } + blockPosToUpdate.Clear(); + needProcessBlockTicks = false; + } + + if (WorldManager.Instance.activeVoxels.ContainsKey(chunkPosition)) + { + foreach (var kvp in WorldManager.Instance.activeVoxels[chunkPosition]) + { + noiseBuffer.voxelArray[kvp.Key] = kvp.Value; + } + } + //Set our Voxels to the meshBuffer array, and our Generating state to generating so everything knows this chunk is processing it's mesh, and the chunk state back to idle, so we know it needs requeued for other mods chunkState = ChunkState.Idle; generationState = GeneratingState.Generating; @@ -112,7 +133,7 @@ public void UploadMesh(MeshBuffer meshBuffer) ConfigureComponents(); //Get the count of vertices/tris from the shader - int[] faceCount = new int[2] { 0, 0 }; + int[] faceCount = new int[3] { 0, 0, 0 }; meshBuffer.countBuffer.GetData(faceCount); MeshData meshData = WorldManager.Instance.GetMeshData(); @@ -120,10 +141,12 @@ public void UploadMesh(MeshBuffer meshBuffer) meshData.colors = new Color[faceCount[0]]; meshData.norms = new Vector3[faceCount[0]]; meshData.indices = new int[faceCount[1]]; + meshData.transparentIndices = new int[faceCount[2]]; //Get all of the meshData from the buffers to local arrays - meshBuffer.vertexBuffer.GetData(meshData.verts, 0, 0, faceCount[0]); + meshBuffer.vertexBuffer.GetData(meshData.verts, 0, 0, faceCount[0]); meshBuffer.indexBuffer.GetData(meshData.indices, 0, 0, faceCount[1]); + meshBuffer.transparentIndexBuffer.GetData(meshData.transparentIndices, 0, 0, faceCount[2]); meshBuffer.colorBuffer.GetData(meshData.colors, 0, 0, faceCount[0]); if (WorldManager.WorldSettings.sharedVertices) meshBuffer.normalBuffer.GetData(meshData.norms, 0, 0, faceCount[0]); @@ -135,12 +158,16 @@ public void UploadMesh(MeshBuffer meshBuffer) else mesh.Clear(); + mesh.subMeshCount = 2; + mesh.SetVertices(meshData.verts, 0, faceCount[0]); if(WorldManager.WorldSettings.sharedVertices) mesh.SetNormals(meshData.norms, 0, faceCount[0]); - mesh.SetIndices(meshData.indices, 0, faceCount[1], MeshTopology.Triangles, 0); + mesh.SetTriangles(meshData.indices, 0, faceCount[1], 0); + mesh.SetTriangles(meshData.transparentIndices, 0, faceCount[2], 1); + mesh.SetColors(meshData.colors, 0, faceCount[0]); if (!WorldManager.WorldSettings.sharedVertices) @@ -192,20 +219,15 @@ public enum GeneratingState public class MeshData { public int[] indices; + public int[] transparentIndices; public Vector3[] verts; public Vector3[] norms; public Color[] colors; public Mesh mesh; - public int arraySize; - - public void Initialize() - { - int maxTris = WorldManager.WorldSettings.chunkSize * WorldManager.WorldSettings.maxHeight * WorldManager.WorldSettings.chunkSize / 4; - arraySize = maxTris * 3; - } public void ClearArrays() { + transparentIndices = null; indices = null; verts = null; norms = null; diff --git a/Assets/VoxelProjectSeries/Scripts/Data/Voxel.cs b/Assets/VoxelProjectSeries/Scripts/Data/Voxel.cs index 8b2c97b..2384645 100644 --- a/Assets/VoxelProjectSeries/Scripts/Data/Voxel.cs +++ b/Assets/VoxelProjectSeries/Scripts/Data/Voxel.cs @@ -3,7 +3,9 @@ using UnityEngine; public struct Voxel { - public int ID; + public int ID; + public float ActiveValue; + public int CantUpdateFurther; public bool isSolid { diff --git a/Assets/VoxelProjectSeries/Scripts/Managers/ActiveVoxelManager.cs b/Assets/VoxelProjectSeries/Scripts/Managers/ActiveVoxelManager.cs new file mode 100644 index 0000000..27b076a --- /dev/null +++ b/Assets/VoxelProjectSeries/Scripts/Managers/ActiveVoxelManager.cs @@ -0,0 +1,69 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class ActiveVoxelManager +{ + + public static void UpdateVoxel(Vector3 chunkPos, Vector3 voxelPos, Voxel vox, ref NoiseBuffer noiseBuffer) + { + switch (vox.ID) + { + case 240: + UpdateWater(chunkPos, voxelPos, vox, ref noiseBuffer); + break; + } + } + + static void UpdateWater(Vector3 chunkPos, Vector3 voxelPos, Voxel vox, ref NoiseBuffer noiseBuffer) + { + Vector3 down = voxelPos + new Vector3(0, -1, 0); + + if (vox.ActiveValue >= 0.15 && noiseBuffer.voxelArray[down].ID == 0 && !WorldManager.Instance.activeVoxels[chunkPos].ContainsKey(down) && down.y > 0) + { + //Air below, continue to traverse down + vox.CantUpdateFurther = 1; + WorldManager.Instance.SetVoxelAtCoord(chunkPos, voxelPos, vox); + WorldManager.Instance.SetVoxelAtCoord(chunkPos, down, new Voxel() { ID = vox.ID, ActiveValue = 1, CantUpdateFurther = 0 }); + return; + } + //If hitting solid and not water, first hit onto the floor as well, helps prevent rerunning updates + if (vox.ActiveValue >= 0.15 && noiseBuffer.voxelArray[down].ID != 0 && noiseBuffer.voxelArray[down].ID != 240) + { + for (int i = -1; i <= 1; i++) + { + + for (int k = -1; k <= 1; k++) + { + if (i == 0 && k == 0) continue; + Vector3 modPos = voxelPos + new Vector3(i, 0, k); + Voxel v; + if (modPos.x < 0 || modPos.z < 0) + v = new Voxel() { }; + else + v = noiseBuffer.voxelArray[voxelPos + new Vector3(i, 0, k)]; + + if (v.ID == 0) + { + if (WorldManager.Instance.activeVoxels[chunkPos].ContainsKey(down)) + v.ID = 240; + } + + if (v.ID == 0) + { + v.ID = vox.ID; + v.ActiveValue = vox.ActiveValue - 0.15f; + v.CantUpdateFurther = 0; + WorldManager.Instance.SetVoxelAtCoord(chunkPos, modPos, v); + + } + } + + + } + } + + vox.CantUpdateFurther = 1; + WorldManager.Instance.SetVoxelAtCoord(chunkPos, voxelPos, vox); + } +} \ No newline at end of file diff --git a/Assets/VoxelProjectSeries/Scripts/Managers/ActiveVoxelManager.cs.meta b/Assets/VoxelProjectSeries/Scripts/Managers/ActiveVoxelManager.cs.meta new file mode 100644 index 0000000..3b3a4b5 --- /dev/null +++ b/Assets/VoxelProjectSeries/Scripts/Managers/ActiveVoxelManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7764780ed6ba168489f108dd262a422b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VoxelProjectSeries/Scripts/Managers/ComputeManager.cs b/Assets/VoxelProjectSeries/Scripts/Managers/ComputeManager.cs index a5564e9..902f1c2 100644 --- a/Assets/VoxelProjectSeries/Scripts/Managers/ComputeManager.cs +++ b/Assets/VoxelProjectSeries/Scripts/Managers/ComputeManager.cs @@ -96,8 +96,7 @@ public void GenerateVoxelData(Chunk cont, Vector3 pos) public void GenerateVoxelMesh(Vector3 pos, MeshBuffer meshBuffer) { - meshBuffer.countBuffer.SetCounterValue(0); - meshBuffer.countBuffer.SetData(new uint[] { 0, 0 }); + meshBuffer.countBuffer.SetData(new uint[] { 0, 0, 0}); voxelShader.SetVector("chunkPosition", pos); voxelShader.SetBuffer(0, "voxelArray", meshBuffer.modifiedNoiseBuffer); @@ -106,6 +105,7 @@ public void GenerateVoxelMesh(Vector3 pos, MeshBuffer meshBuffer) voxelShader.SetBuffer(0, "normalBuffer", meshBuffer.normalBuffer); voxelShader.SetBuffer(0, "colorBuffer", meshBuffer.colorBuffer); voxelShader.SetBuffer(0, "indexBuffer", meshBuffer.indexBuffer); + voxelShader.SetBuffer(0, "transparentIndexBuffer", meshBuffer.transparentIndexBuffer); voxelShader.Dispatch(0, xThreads, yThreads, xThreads); AsyncGPUReadback.Request(meshBuffer.countBuffer, (callback) => @@ -272,7 +272,7 @@ public void InitializeBuffer() countBuffer.SetData(new uint[] {0, 0}); voxelArray = new IndexedArray(); - noiseBuffer = new ComputeBuffer(WorldManager.WorldSettings.ChunkCount, 4); + noiseBuffer = new ComputeBuffer(WorldManager.WorldSettings.ChunkCount, 12); Initialized = true; } @@ -295,6 +295,7 @@ public class MeshBuffer public ComputeBuffer indexBuffer; public ComputeBuffer countBuffer; public ComputeBuffer modifiedNoiseBuffer; + public ComputeBuffer transparentIndexBuffer; public bool Initialized; public bool Cleared; @@ -305,19 +306,19 @@ public void InitializeBuffer() if (Initialized) return; - countBuffer = new ComputeBuffer(2, 4, ComputeBufferType.Raw); - countBuffer.SetCounterValue(0); - countBuffer.SetData(new uint[] { 0, 0 }); + countBuffer = new ComputeBuffer(3, 4, ComputeBufferType.Raw); + countBuffer.SetData(new uint[] { 0, 0, 0 }); - int maxTris = WorldManager.WorldSettings.chunkSize * WorldManager.WorldSettings.maxHeight * WorldManager.WorldSettings.chunkSize / 6; + int maxTris = WorldManager.WorldSettings.chunkSize * WorldManager.WorldSettings.maxHeight * WorldManager.WorldSettings.chunkSize / 4; //width*height*width*faces*tris int maxVertices = WorldManager.WorldSettings.sharedVertices ? maxTris / 3 : maxTris; int maxNormals = WorldManager.WorldSettings.sharedVertices ? maxVertices * 3 : 1; vertexBuffer ??= new ComputeBuffer(maxVertices*3, 12); colorBuffer ??= new ComputeBuffer(maxVertices*3, 16); normalBuffer ??= new ComputeBuffer(maxNormals, 12); - indexBuffer ??= new ComputeBuffer(maxTris*3, 4); - modifiedNoiseBuffer ??= new ComputeBuffer(WorldManager.WorldSettings.ChunkCount, 4); + indexBuffer ??= new ComputeBuffer(maxTris*3, 4); + modifiedNoiseBuffer = new ComputeBuffer(WorldManager.WorldSettings.ChunkCount, 12); + transparentIndexBuffer ??= new ComputeBuffer(maxTris*3, 4); Initialized = true; } @@ -328,6 +329,7 @@ public void Dispose() normalBuffer?.Dispose(); colorBuffer?.Dispose(); indexBuffer?.Dispose(); + transparentIndexBuffer?.Dispose(); countBuffer?.Dispose(); modifiedNoiseBuffer?.Dispose(); diff --git a/Assets/VoxelProjectSeries/Scripts/Managers/WorldManager.cs b/Assets/VoxelProjectSeries/Scripts/Managers/WorldManager.cs index 5843ecf..0fa19ca 100644 --- a/Assets/VoxelProjectSeries/Scripts/Managers/WorldManager.cs +++ b/Assets/VoxelProjectSeries/Scripts/Managers/WorldManager.cs @@ -10,7 +10,7 @@ public class WorldManager : MonoBehaviour { - public Material worldMaterial; + public Material[] worldMaterials; public Voxels[] voxelDetails; public WorldSettings worldSettings; @@ -20,6 +20,7 @@ public class WorldManager : MonoBehaviour //This will contain all modified voxels, structures, whatnot for all chunks, and will effectively be our saving mechanism public Dictionary> modifiedVoxels = new Dictionary>(); + public ConcurrentDictionary> activeVoxels = new ConcurrentDictionary>(); public ConcurrentDictionary activeChunks; public Queue chunkPool; public Queue meshDataPool; @@ -30,6 +31,7 @@ public class WorldManager : MonoBehaviour public int maxChunksToProcessPerFrame = 6; int mainThreadID; + Thread checkActiveVoxels; Thread checkActiveChunks; bool killThreads = false; bool performedFirstPass = false; @@ -59,7 +61,7 @@ private void InitializeWorld() StructureManager.IntializeRandom(ComputeManager.Instance.seed); - worldMaterial.SetTexture("_TextureArray", GenerateTextureArray()); + worldMaterials[0].SetTexture("_TextureArray", GenerateTextureArray()); activeChunks = new ConcurrentDictionary(); chunkPool = new Queue(); @@ -80,6 +82,10 @@ private void InitializeWorld() checkActiveChunks = new Thread(CheckActiveChunksLoop); checkActiveChunks.Priority = System.Threading.ThreadPriority.BelowNormal; checkActiveChunks.Start(); + + checkActiveVoxels = new Thread(CheckActiveVoxelsLoop); + checkActiveVoxels.Priority = System.Threading.ThreadPriority.BelowNormal; + checkActiveVoxels.Start(); } @@ -103,6 +109,7 @@ private void Update() { Chunk chunk = GetChunk(contToMake); chunk.chunkPosition = contToMake; + chunk.chunkState = Chunk.ChunkState.WaitingToMesh; activeChunks.TryAdd(contToMake, chunk); ComputeManager.Instance.GenerateVoxelData(chunk, contToMake); x++; @@ -175,6 +182,46 @@ void CheckActiveChunksLoop() Profiler.EndThreadProfiling(); } + void CheckActiveVoxelsLoop() + { + while (true && !killThreads) + { + foreach (var kvp in activeVoxels) + { + if (activeChunks.ContainsKey(kvp.Key)) + { + Chunk c = activeChunks[kvp.Key]; + if (!c.needProcessBlockTicks) + { + List toRemove = new List(); + foreach (var activeVoxelKVP in kvp.Value) + { + if (activeVoxelKVP.Value.ActiveValue < 0.15f) + { + toRemove.Add(activeVoxelKVP.Key); + continue; + } + + c.blockPosToUpdate.Add(activeVoxelKVP.Key); + } + if (c.blockPosToUpdate.Count > 0) + { + c.needProcessBlockTicks = true; + if (c.chunkState != Chunk.ChunkState.WaitingToMesh) + { + c.chunkState = Chunk.ChunkState.WaitingToMesh; + chunksNeedRegenerated.Enqueue(c.chunkPosition); + } + } + foreach (Vector3 v in toRemove) + kvp.Value.TryRemove(v, out var voxel); + } + } + } + Thread.Sleep(300); + } + } + #region Chunk Pooling public Chunk GetChunk(Vector3 pos) { @@ -198,7 +245,7 @@ Chunk GenerateChunk(Vector3 position, bool enqueue = true) Chunk chunk = new GameObject().AddComponent(); chunk.transform.parent = transform; chunk.chunkPosition = position; - chunk.Initialize(worldMaterial, position); + chunk.Initialize(worldMaterials, position); if (enqueue) { @@ -244,7 +291,6 @@ MeshData GenerateMeshData(bool enqueue = true) { MeshData meshData = new MeshData(); - meshData.Initialize(); if (enqueue) { @@ -266,6 +312,7 @@ private void OnApplicationQuit() { killThreads = true; checkActiveChunks?.Abort(); + checkActiveVoxels?.Abort(); foreach(var c in activeChunks.Keys) { @@ -403,6 +450,7 @@ public void SetVoxelAtCoord(Vector3 chunkPosition, Vector3 index, Voxel value) canPlaceWithinChunk = false; } + bool isActive = value.ID == 240; if (neighbor > 0) { for (int i = 0; i < neighbor; i++) @@ -415,10 +463,23 @@ public void SetVoxelAtCoord(Vector3 chunkPosition, Vector3 index, Voxel value) { continue; } - if (!modifiedVoxels[neighborPos[i]].ContainsKey(x)) - modifiedVoxels[neighborPos[i]].Add(x, value); + + if (isActive) + { + if (!activeVoxels.ContainsKey(neighborPos[i])) + activeVoxels.TryAdd(neighborPos[i], new ConcurrentDictionary()); + if (!activeVoxels[neighborPos[i]].ContainsKey(x)) + activeVoxels[neighborPos[i]].TryAdd(x, value); + else + activeVoxels[neighborPos[i]][x] = value; + } else - modifiedVoxels[neighborPos[i]][x] = value; + { + if (!modifiedVoxels[neighborPos[i]].ContainsKey(x)) + modifiedVoxels[neighborPos[i]].Add(x, value); + else + modifiedVoxels[neighborPos[i]][x] = value; + } //Make sure this chunk is enqueued to remesh if (activeChunks.ContainsKey(neighborPos[i])) @@ -439,10 +500,24 @@ public void SetVoxelAtCoord(Vector3 chunkPosition, Vector3 index, Voxel value) if (!modifiedVoxels.ContainsKey(chunkPosition)) modifiedVoxels.Add(chunkPosition, new Dictionary()); - if (!modifiedVoxels[chunkPosition].ContainsKey(index)) - modifiedVoxels[chunkPosition].Add(index, value); + if (isActive) + { + if (!activeVoxels.ContainsKey(chunkPosition)) + activeVoxels.TryAdd(chunkPosition, new ConcurrentDictionary()); + if (!activeVoxels[chunkPosition].ContainsKey(index)) + activeVoxels[chunkPosition].TryAdd(index, value); + else + activeVoxels[chunkPosition][index] = value; + } else - modifiedVoxels[chunkPosition][index] = value; + { + if (!modifiedVoxels.ContainsKey(chunkPosition)) + modifiedVoxels.Add(chunkPosition, new Dictionary()); + if (!modifiedVoxels[chunkPosition].ContainsKey(index)) + modifiedVoxels[chunkPosition].Add(index, value); + else + modifiedVoxels[chunkPosition][index] = value; + } } } diff --git a/Assets/VoxelProjectSeries/Shaders/VoxelShaderTransparent.shadergraph b/Assets/VoxelProjectSeries/Shaders/VoxelShaderTransparent.shadergraph new file mode 100644 index 0000000..cf1f922 --- /dev/null +++ b/Assets/VoxelProjectSeries/Shaders/VoxelShaderTransparent.shadergraph @@ -0,0 +1,2713 @@ +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "1b0a381bf4fa4081a20a7ed1f9d1ca72", + "m_Properties": [ + { + "m_Id": "12b72b1be3834a0bbdbd79b0a4b85f1e" + }, + { + "m_Id": "8d8f175671f441d38d9b8e2807f574c2" + }, + { + "m_Id": "82efff6545154e77a6b5049395f3cdde" + }, + { + "m_Id": "30a8fd1bc9f64697afd468b0e182dd79" + }, + { + "m_Id": "d51d2cbdeb1840ba89b9b18b95125d7d" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "810a7815a872476882906d948c2e0606" + }, + { + "m_Id": "303512db22744a60b627d447a6ddc029" + }, + { + "m_Id": "01774734bb984ba98b1c39057d8f9564" + }, + { + "m_Id": "cc77c592a30f45d3a4bb1240d8a9fc3c" + }, + { + "m_Id": "c77967e96bf041ffbcf5427d794bf709" + }, + { + "m_Id": "3ec34c42fef047d4b986adc312717dd4" + }, + { + "m_Id": "a90d7d6eb6c84f62b3da90b48e88fd11" + }, + { + "m_Id": "2b96952f83264bb09bf44262260a635f" + }, + { + "m_Id": "8d49ed4be09d461cb3edcfc29ee7b929" + }, + { + "m_Id": "7e4bc00ffd934b7baccc38dfcaf2bf2c" + }, + { + "m_Id": "e7f06b8a956f47a98bc811ee0b852427" + }, + { + "m_Id": "9c4993905bd4497c8a6a9bc31f16dcbf" + }, + { + "m_Id": "7bbf2c817acd4ad98c6cb9805ef2c335" + }, + { + "m_Id": "20ea0e9701d64dd9a76da3e5ca7daccc" + }, + { + "m_Id": "ca809a0f28e5497ebea0e2370475e0de" + }, + { + "m_Id": "d007ceb5348247938ad72d4ea37015b5" + }, + { + "m_Id": "9adea879d3844d04b5c963233d1ed77c" + }, + { + "m_Id": "979bb911099b4f0f90f987511163b240" + }, + { + "m_Id": "9a96b3a983c949c78111e659ca0b9d17" + }, + { + "m_Id": "48071bb1deaf4ba79ca12bca99902f7b" + }, + { + "m_Id": "1f9214f7c6a84cec8d41b61cbb55f7e6" + }, + { + "m_Id": "83a5ac6e129248ee9f79e88958f81d67" + }, + { + "m_Id": "5c6adc3ced5346879a779d20eb0ad912" + }, + { + "m_Id": "a5750fc28da84430860e5572e5ba5fa8" + }, + { + "m_Id": "606dcec53746459eb65a0348d9ccbb53" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1f9214f7c6a84cec8d41b61cbb55f7e6" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5c6adc3ced5346879a779d20eb0ad912" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "48071bb1deaf4ba79ca12bca99902f7b" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9adea879d3844d04b5c963233d1ed77c" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5c6adc3ced5346879a779d20eb0ad912" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e7f06b8a956f47a98bc811ee0b852427" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "606dcec53746459eb65a0348d9ccbb53" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9adea879d3844d04b5c963233d1ed77c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7e4bc00ffd934b7baccc38dfcaf2bf2c" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e7f06b8a956f47a98bc811ee0b852427" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7e4bc00ffd934b7baccc38dfcaf2bf2c" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9c4993905bd4497c8a6a9bc31f16dcbf" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7e4bc00ffd934b7baccc38dfcaf2bf2c" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ca809a0f28e5497ebea0e2370475e0de" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7e4bc00ffd934b7baccc38dfcaf2bf2c" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ca809a0f28e5497ebea0e2370475e0de" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "83a5ac6e129248ee9f79e88958f81d67" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1f9214f7c6a84cec8d41b61cbb55f7e6" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8d49ed4be09d461cb3edcfc29ee7b929" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7e4bc00ffd934b7baccc38dfcaf2bf2c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "979bb911099b4f0f90f987511163b240" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9adea879d3844d04b5c963233d1ed77c" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9a96b3a983c949c78111e659ca0b9d17" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "979bb911099b4f0f90f987511163b240" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9adea879d3844d04b5c963233d1ed77c" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1f9214f7c6a84cec8d41b61cbb55f7e6" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9c4993905bd4497c8a6a9bc31f16dcbf" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c77967e96bf041ffbcf5427d794bf709" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9c4993905bd4497c8a6a9bc31f16dcbf" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3ec34c42fef047d4b986adc312717dd4" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a5750fc28da84430860e5572e5ba5fa8" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5c6adc3ced5346879a779d20eb0ad912" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ca809a0f28e5497ebea0e2370475e0de" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "606dcec53746459eb65a0348d9ccbb53" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d007ceb5348247938ad72d4ea37015b5" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "979bb911099b4f0f90f987511163b240" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e7f06b8a956f47a98bc811ee0b852427" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cc77c592a30f45d3a4bb1240d8a9fc3c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e7f06b8a956f47a98bc811ee0b852427" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "20ea0e9701d64dd9a76da3e5ca7daccc" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 937.0001220703125, + "y": -96.00001525878906 + }, + "m_Blocks": [ + { + "m_Id": "810a7815a872476882906d948c2e0606" + }, + { + "m_Id": "303512db22744a60b627d447a6ddc029" + }, + { + "m_Id": "01774734bb984ba98b1c39057d8f9564" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 937.0001220703125, + "y": 104.00001525878906 + }, + "m_Blocks": [ + { + "m_Id": "cc77c592a30f45d3a4bb1240d8a9fc3c" + }, + { + "m_Id": "c77967e96bf041ffbcf5427d794bf709" + }, + { + "m_Id": "3ec34c42fef047d4b986adc312717dd4" + }, + { + "m_Id": "a90d7d6eb6c84f62b3da90b48e88fd11" + }, + { + "m_Id": "2b96952f83264bb09bf44262260a635f" + }, + { + "m_Id": "7bbf2c817acd4ad98c6cb9805ef2c335" + }, + { + "m_Id": "20ea0e9701d64dd9a76da3e5ca7daccc" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Shader Graphs", + "m_ConcretePrecision": 0, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "311a7730ba104a3db9b51b2784624093" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "0051843dd4034e19a9993765041bd65c", + "m_Id": 4, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "01774734bb984ba98b1c39057d8f9564", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "3f539d3af8ef44428196b52c62dfd3fb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "05fcb57d12244e4e99c0a3a90fb2de78", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "097d98d361d943ec9871a3a2b7b20cf2", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "10b1ed513b95498a8b6ea7899d25a5d4", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "10c43f8ecbf24cafbea851e524d08046", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "12b72b1be3834a0bbdbd79b0a4b85f1e", + "m_Guid": { + "m_GuidSerialized": "a9218e44-b0f7-47d9-9a4b-29e7e13a6d1f" + }, + "m_Name": "WaterColor", + "m_DefaultReferenceName": "Color_12b72b1be3834a0bbdbd79b0a4b85f1e", + "m_OverrideReferenceName": "WaterColor", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 0.0, + "g": 0.678345263004303, + "b": 0.8584905862808228, + "a": 0.0 + }, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "1530858522984ae2bc4f57d4de6a78f9", + "m_Id": 3, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "16501bbada874ed895f850b56e8035f0", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 0.75, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "1705a2ee41ea4bc39d1e1fc094ed12cb", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1d569be2c8a647a08474bd7862c7b1bd", + "m_Id": 0, + "m_DisplayName": "RippleSpeed", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PowerNode", + "m_ObjectId": "1f9214f7c6a84cec8d41b61cbb55f7e6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Power", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 303.9999694824219, + "y": -497.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "f2f500aee5a64e18be62f1ba81af0ec3" + }, + { + "m_Id": "b55e84de038f4ef7837ff55bc7bd4112" + }, + { + "m_Id": "8d886ef869cb440ca39eb0985f09c7c1" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "20ea0e9701d64dd9a76da3e5ca7daccc", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "16501bbada874ed895f850b56e8035f0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "23c66364b08d4bef82c09f52f9619aac", + "m_Id": 2, + "m_DisplayName": "x", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "x", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "24f8ac9afcab4bb2b1f3b0ef06202ab0", + "m_Id": 0, + "m_DisplayName": "Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "2503fcfb49f14bf8bf78c6b9be17d11c", + "m_Id": 2, + "m_DisplayName": "Strength", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Strength", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "2b96952f83264bb09bf44262260a635f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Occlusion", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "a41ac7ee834644eea3794299cc59d245" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Occlusion" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2fc8ea6bb9a84b0f953c2d1690a98f64", + "m_Id": 3, + "m_DisplayName": "y", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "y", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "303512db22744a60b627d447a6ddc029", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "10b1ed513b95498a8b6ea7899d25a5d4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "30a8fd1bc9f64697afd468b0e182dd79", + "m_Guid": { + "m_GuidSerialized": "34821140-b656-42dd-aaf0-a47187f4cf68" + }, + "m_Name": "RippleScale", + "m_DefaultReferenceName": "Vector1_30a8fd1bc9f64697afd468b0e182dd79", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 7.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "311a7730ba104a3db9b51b2784624093", + "m_ActiveSubTarget": { + "m_Id": "d8ca8037d99d467d96e37fe41dc5b0db" + }, + "m_SurfaceType": 1, + "m_AlphaMode": 0, + "m_TwoSided": false, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "3ec34c42fef047d4b986adc312717dd4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "a0c6d066cb48432e89f8c86600a7db5f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Smoothness" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "3f539d3af8ef44428196b52c62dfd3fb", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4709c5af13b94770ac1dc24a28df4f53", + "m_Id": 1, + "m_DisplayName": "Angle Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "AngleOffset", + "m_StageCapability": 3, + "m_Value": 2.0, + "m_DefaultValue": 2.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "48071bb1deaf4ba79ca12bca99902f7b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -292.00006103515627, + "y": -310.0000305175781, + "width": 137.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "8928af57765a48fea942cbbdef636bd7" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "30a8fd1bc9f64697afd468b0e182dd79" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4de7c2b11515477e886a991102b225f2", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5876ffecaa1147f183cb49e4cbd00251", + "m_Id": 0, + "m_DisplayName": "RippleColor", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "5908e18a213f4076b4e1ab49d56946f2", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5b2ee6305f48477f9ae3b4141291ec71", + "m_Id": 3, + "m_DisplayName": "ripples", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ripples", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "5c6adc3ced5346879a779d20eb0ad912", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 651.9998779296875, + "y": -497.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "7615ea101f7d44af8ffb9705569349be" + }, + { + "m_Id": "7d901d8171db4ed184de8bc302fbb267" + }, + { + "m_Id": "1705a2ee41ea4bc39d1e1fc094ed12cb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5fc16a83d30642038c2764d4c1163a2b", + "m_Id": 1, + "m_DisplayName": "Sine Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Sine Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RadialShearNode", + "m_ObjectId": "606dcec53746459eb65a0348d9ccbb53", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Radial Shear", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -313.00006103515627, + "y": -246.0, + "width": 208.0, + "height": 350.0 + } + }, + "m_Slots": [ + { + "m_Id": "e611d2791f3244a8b22af80c00dcd556" + }, + { + "m_Id": "6a0c5d0b6d3848948f8ea62a5b0e7024" + }, + { + "m_Id": "2503fcfb49f14bf8bf78c6b9be17d11c" + }, + { + "m_Id": "1530858522984ae2bc4f57d4de6a78f9" + }, + { + "m_Id": "0051843dd4034e19a9993765041bd65c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "6a0c5d0b6d3848948f8ea62a5b0e7024", + "m_Id": 1, + "m_DisplayName": "Center", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Center", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6a8eb7e53a794249a8e5b2d6664663ce", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "7615ea101f7d44af8ffb9705569349be", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "78d85943daa94cb489bdff963d444ce8", + "m_Id": 3, + "m_DisplayName": "Delta Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Delta Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7bbf2c817acd4ad98c6cb9805ef2c335", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalTS", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "b7cb11dbfe434cb79649ef0bc2654e82" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalTS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "7d901d8171db4ed184de8bc302fbb267", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "7e4bc00ffd934b7baccc38dfcaf2bf2c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Split", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -748.0, + "y": 140.0, + "width": 120.0, + "height": 149.0 + } + }, + "m_Slots": [ + { + "m_Id": "6a8eb7e53a794249a8e5b2d6664663ce" + }, + { + "m_Id": "097d98d361d943ec9871a3a2b7b20cf2" + }, + { + "m_Id": "98d094a120fe4a0ca1f54a59cbbb2526" + }, + { + "m_Id": "4de7c2b11515477e886a991102b225f2" + }, + { + "m_Id": "c7586efadb7e4848bf076ab658f248c6" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "7ea00439c624427c9fc38899da9a0f9b", + "m_Id": 1, + "m_DisplayName": "c", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "c", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "81068c8cca3b4c90b70d9a0c5f26c140", + "m_Id": 2, + "m_DisplayName": "Cell Density", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "CellDensity", + "m_StageCapability": 3, + "m_Value": 5.0, + "m_DefaultValue": 5.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "810a7815a872476882906d948c2e0606", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "8cea9432d47e42b5ba28d0db631933cf" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "82efff6545154e77a6b5049395f3cdde", + "m_Guid": { + "m_GuidSerialized": "710a3080-2af3-4134-8cd6-af02e3c105c7" + }, + "m_Name": "RippleSpeed", + "m_DefaultReferenceName": "Vector1_82efff6545154e77a6b5049395f3cdde", + "m_OverrideReferenceName": "WaterTransparency", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "83a5ac6e129248ee9f79e88958f81d67", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 147.99990844726563, + "y": -405.0, + "width": 156.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "df6488aa905d4296b43e3890011eee27" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "d51d2cbdeb1840ba89b9b18b95125d7d" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "8928af57765a48fea942cbbdef636bd7", + "m_Id": 0, + "m_DisplayName": "RippleScale", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "8b38983899c44dbd89c0fe57eb158af3", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "8cea9432d47e42b5ba28d0db631933cf", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.VertexColorNode", + "m_ObjectId": "8d49ed4be09d461cb3edcfc29ee7b929", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Vertex Color", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -965.0, + "y": 52.000003814697269, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "db13cbf297704a76a8581420a68f6bc7" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 1, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8d886ef869cb440ca39eb0985f09c7c1", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "8d8f175671f441d38d9b8e2807f574c2", + "m_Guid": { + "m_GuidSerialized": "fae310b5-370f-499b-b356-f190f48366d8" + }, + "m_Name": "RippleColor", + "m_DefaultReferenceName": "Color_8d8f175671f441d38d9b8e2807f574c2", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 0.4660179615020752, + "g": 2.381765127182007, + "b": 2.670156955718994, + "a": 1.0 + }, + "m_ColorMode": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "9167ada0dd73467c869e88cc411f2b9c", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9798aa6a0a5340729cdc664984107467", + "m_Id": 2, + "m_DisplayName": "Y", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Y", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "Y" + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "979bb911099b4f0f90f987511163b240", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -292.00006103515627, + "y": -464.0, + "width": 126.0, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "ff5821966b6a4bca8cdde8353fcbf6c8" + }, + { + "m_Id": "d8552e2d318e4e5ebb56a3d8c8af49c0" + }, + { + "m_Id": "10c43f8ecbf24cafbea851e524d08046" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "98d094a120fe4a0ca1f54a59cbbb2526", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "9a96b3a983c949c78111e659ca0b9d17", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -485.00006103515627, + "y": -323.0, + "width": 142.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "1d569be2c8a647a08474bd7862c7b1bd" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "82efff6545154e77a6b5049395f3cdde" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.VoronoiNode", + "m_ObjectId": "9adea879d3844d04b5c963233d1ed77c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Voronoi", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -60.00007247924805, + "y": -508.0, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "5908e18a213f4076b4e1ab49d56946f2" + }, + { + "m_Id": "4709c5af13b94770ac1dc24a28df4f53" + }, + { + "m_Id": "81068c8cca3b4c90b70d9a0c5f26c140" + }, + { + "m_Id": "05fcb57d12244e4e99c0a3a90fb2de78" + }, + { + "m_Id": "d888b8a1b14f4e15bfda3f278e5ce0e1" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9b457449599e445d980674524d1bce6f", + "m_Id": 2, + "m_DisplayName": "alpha", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "alpha", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "9c4993905bd4497c8a6a9bc31f16dcbf", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UnpackFloats (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -313.0000305175781, + "y": 186.00001525878907, + "width": 230.99998474121095, + "height": 117.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "d76c5955cc1a49ad852595b379275cda" + }, + { + "m_Id": "23c66364b08d4bef82c09f52f9619aac" + }, + { + "m_Id": "2fc8ea6bb9a84b0f953c2d1690a98f64" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "UnpackFloats", + "m_FunctionSource": "", + "m_FunctionBody": "float2 output;\noutput.y = inputs % 100;\noutput.x = floor(inputs / 100);\noutput /= (100 - 1);\nx = output.x;\ny = output.y;" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a0c6d066cb48432e89f8c86600a7db5f", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Smoothness", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a41ac7ee834644eea3794299cc59d245", + "m_Id": 0, + "m_DisplayName": "Ambient Occlusion", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Occlusion", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "a5750fc28da84430860e5572e5ba5fa8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 511.99993896484377, + "y": -422.0, + "width": 140.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "5876ffecaa1147f183cb49e4cbd00251" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "8d8f175671f441d38d9b8e2807f574c2" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a90d7d6eb6c84f62b3da90b48e88fd11", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Emission", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "dbe08f38826e4ca0bb214f278fa53cea" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Emission" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b55e84de038f4ef7837ff55bc7bd4112", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 5.0, + "y": 2.0, + "z": 2.0, + "w": 2.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b5e5caf810b740888349a0025c5da38f", + "m_Id": 2, + "m_DisplayName": "Cosine Time", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Cosine Time", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "b7cb11dbfe434cb79649ef0bc2654e82", + "m_Id": 0, + "m_DisplayName": "Normal (Tangent Space)", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "NormalTS", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c138c50a181843d18399748fce1ee1a3", + "m_Id": 0, + "m_DisplayName": "Metallic", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Metallic", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "c5083ca58565428d8313a071a0915183", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c7586efadb7e4848bf076ab658f248c6", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c77967e96bf041ffbcf5427d794bf709", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Metallic", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "c138c50a181843d18399748fce1ee1a3" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Metallic" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2Node", + "m_ObjectId": "ca809a0f28e5497ebea0e2370475e0de", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Vector 2", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -497.00006103515627, + "y": -64.00003051757813, + "width": 128.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "cbff4085ea7248b5961a363da99d4a32" + }, + { + "m_Id": "9798aa6a0a5340729cdc664984107467" + }, + { + "m_Id": "9167ada0dd73467c869e88cc411f2b9c" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": { + "x": 0.0, + "y": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "cbff4085ea7248b5961a363da99d4a32", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "cc77c592a30f45d3a4bb1240d8a9fc3c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "c5083ca58565428d8313a071a0915183" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TimeNode", + "m_ObjectId": "d007ceb5348247938ad72d4ea37015b5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Time", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -485.00006103515627, + "y": -496.0, + "width": 126.0, + "height": 173.0 + } + }, + "m_Slots": [ + { + "m_Id": "24f8ac9afcab4bb2b1f3b0ef06202ab0" + }, + { + "m_Id": "5fc16a83d30642038c2764d4c1163a2b" + }, + { + "m_Id": "b5e5caf810b740888349a0025c5da38f" + }, + { + "m_Id": "78d85943daa94cb489bdff963d444ce8" + }, + { + "m_Id": "e28aea2040de402da3c483d0d0296256" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "d51d2cbdeb1840ba89b9b18b95125d7d", + "m_Guid": { + "m_GuidSerialized": "85967f0d-0e0d-440f-8b41-7a017a8af551" + }, + "m_Name": "RippleSlimness", + "m_DefaultReferenceName": "Vector1_d51d2cbdeb1840ba89b9b18b95125d7d", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 5.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d76c5955cc1a49ad852595b379275cda", + "m_Id": 0, + "m_DisplayName": "inputs", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "inputs", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "d8552e2d318e4e5ebb56a3d8c8af49c0", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d888b8a1b14f4e15bfda3f278e5ce0e1", + "m_Id": 4, + "m_DisplayName": "Cells", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Cells", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "d8ca8037d99d467d96e37fe41dc5b0db", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "db13cbf297704a76a8581420a68f6bc7", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "dbe08f38826e4ca0bb214f278fa53cea", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.26840129494667055, + "z": 0.40566039085388186 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 1, + "m_DefaultColor": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "df6488aa905d4296b43e3890011eee27", + "m_Id": 0, + "m_DisplayName": "RippleSlimness", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e28aea2040de402da3c483d0d0296256", + "m_Id": 4, + "m_DisplayName": "Smooth Delta", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Smooth Delta", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "e611d2791f3244a8b22af80c00dcd556", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "e7f06b8a956f47a98bc811ee0b852427", + "m_Group": { + "m_Id": "" + }, + "m_Name": "floatToColor (Custom Function)", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 147.99990844726563, + "y": -75.00001525878906, + "width": 223.00001525878907, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "f7499679ad434e25a9f3cef50ab57fd0" + }, + { + "m_Id": "5b2ee6305f48477f9ae3b4141291ec71" + }, + { + "m_Id": "7ea00439c624427c9fc38899da9a0f9b" + }, + { + "m_Id": "9b457449599e445d980674524d1bce6f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "floatToColor", + "m_FunctionSource": "", + "m_FunctionBody": "if(distance(input, 240) < 0.01){\n\tc= WaterColor + ripples;\n\talpha = WaterColor.a;\n}\nelse {\n\tc= float4(1,1,1,1);\n\talpha = 0.1;\n}" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f2f500aee5a64e18be62f1ba81af0ec3", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f7499679ad434e25a9f3cef50ab57fd0", + "m_Id": 0, + "m_DisplayName": "input", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "input", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "ff5821966b6a4bca8cdde8353fcbf6c8", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + diff --git a/Assets/VoxelProjectSeries/Shaders/VoxelShaderTransparent.shadergraph.meta b/Assets/VoxelProjectSeries/Shaders/VoxelShaderTransparent.shadergraph.meta new file mode 100644 index 0000000..2ceff74 --- /dev/null +++ b/Assets/VoxelProjectSeries/Shaders/VoxelShaderTransparent.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b12ecc1984d03934592ec9c8c833329d +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/Assets/VoxelProjectSeries/WorldMaterialTransparent.mat b/Assets/VoxelProjectSeries/WorldMaterialTransparent.mat new file mode 100644 index 0000000..2e41368 --- /dev/null +++ b/Assets/VoxelProjectSeries/WorldMaterialTransparent.mat @@ -0,0 +1,130 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2969696074570983970 +MonoBehaviour: + m_ObjectHideFlags: 11 + 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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 4 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WorldMaterialTransparent + m_Shader: {fileID: -6465566751694194690, guid: b12ecc1984d03934592ec9c8c833329d, + type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - Vector1_30a8fd1bc9f64697afd468b0e182dd79: 15 + - Vector1_d51d2cbdeb1840ba89b9b18b95125d7d: 14 + - WaterTransparency: 1 + - _AlphaClip: 0 + - _Blend: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - Color_8d8f175671f441d38d9b8e2807f574c2: {r: 0.466018, g: 2.381765, b: 2.670157, + a: 1} + - WaterColor: {r: 0, g: 0.6783453, b: 0.8584906, a: 0.33333334} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/VoxelProjectSeries/WorldMaterialTransparent.mat.meta b/Assets/VoxelProjectSeries/WorldMaterialTransparent.mat.meta new file mode 100644 index 0000000..9dc2970 --- /dev/null +++ b/Assets/VoxelProjectSeries/WorldMaterialTransparent.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 313f0b3da4a8a8b4ea348a14fbeb4548 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index fd3ef4a..94368f0 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -21,7 +21,7 @@ EditorUserSettings: value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b98d9884a69ae6d8f0d1cda9e8fbfefaf9f9dea3fdb9ade882f0f7b0e1e380cafbf2c3adc18e9cd285a2908b82ec869c8395949c9483d68a8e97ddbd90bf flags: 0 UnityEditor.ShaderGraph.InspectorWindow: - value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd3c3e302a07a37e0901373ae01e0008f707250d171df81a53a5405d41895ac825e0100ec20313c0d91cddccd3d0c7efcca9bd88908fecb0f9cfddf1eff4e7a1b1eae482f0fcade8e1928b86d888ed929c968797a7cf + value: 18135939215a0a5004000b0e15254b524c1119263f2d6a722016393ce1eb3d36e5d339f9a560393d3511ea7046333e09f7181d02f50a06241708ee0b05bd4a435f95548717f73713d91006c1c309d0effad0d2f9ddffa5828e91f0beb6fdd1cbfceba0b9f0b3bed8e8f5ade2f68c978883d3f59e9a969989eacfcc flags: 0 vcSharedLogLevel: value: 0d5e400f0650