Skip to content

Commit

Permalink
Rename (CrawlerSwarm -> CrawlingSwarm)
Browse files Browse the repository at this point in the history
  • Loading branch information
keijiro committed May 31, 2017
1 parent e3d43be commit 583b687
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 24 deletions.
14 changes: 7 additions & 7 deletions Assets/Swarm/CrawlerSwarm.cs → Assets/Swarm/CrawlingSwarm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

using UnityEngine;
Expand All @@ -8,7 +8,7 @@
namespace Swarm
{
// Distance-field constrained swarm
public sealed class CrawlerSwarm : MonoBehaviour
public sealed class CrawlingSwarm : MonoBehaviour
{
#region Basic settings

Expand Down Expand Up @@ -139,7 +139,7 @@ void Start()
_normalBuffer = new ComputeBuffer(HistoryLength * InstanceCount, 16);

// Initialize the position buffer.
var kernel = _compute.FindKernel("CrawlerInit");
var kernel = _compute.FindKernel("CrawlingInit");
_compute.SetBuffer(kernel, "PositionBuffer", _positionBuffer);
_compute.SetBuffer(kernel, "TangentBuffer", _tangentBuffer);
_compute.SetBuffer(kernel, "NormalBuffer", _normalBuffer);
Expand All @@ -149,12 +149,12 @@ void Start()
_compute.Dispatch(kernel, ThreadGroupCount, 1, 1);

// Initialize the update kernel.
kernel = _compute.FindKernel("CrawlerUpdate");
kernel = _compute.FindKernel("CrawlingUpdate");
_compute.SetBuffer(kernel, "PositionBuffer", _positionBuffer);
_compute.SetTexture(kernel, "DFVolume", _volume.texture);

// Initialize the reconstruction kernel.
kernel = _compute.FindKernel("CrawlerReconstruct");
kernel = _compute.FindKernel("CrawlingReconstruct");
_compute.SetBuffer(kernel, "PositionBufferRO", _positionBuffer);
_compute.SetBuffer(kernel, "TangentBuffer", _tangentBuffer);
_compute.SetBuffer(kernel, "NormalBuffer", _normalBuffer);
Expand Down Expand Up @@ -200,11 +200,11 @@ void Update()
_compute.SetFloat("NoiseOffset", Time.time * _noiseMotion);

// Update the position buffer.
var kernel = _compute.FindKernel("CrawlerUpdate");
var kernel = _compute.FindKernel("CrawlingUpdate");
_compute.Dispatch(kernel, ThreadGroupCount, 1, 1);

// Reconstruct tangent/normal vectors.
kernel = _compute.FindKernel("CrawlerReconstruct");
kernel = _compute.FindKernel("CrawlingReconstruct");
_compute.Dispatch(kernel, ThreadGroupCount, 1, 1);
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

using UnityEngine;
using UnityEditor;

namespace Swarm
{
// Custom inspector for CrawlerSwarm
[CustomEditor(typeof(CrawlerSwarm)), CanEditMultipleObjects]
public class CrawlerSwarmEditor : Editor
// Custom inspector for CrawlingSwarm
[CustomEditor(typeof(CrawlingSwarm)), CanEditMultipleObjects]
public class CrawlingSwarmEditor : Editor
{
SerializedProperty _instanceCount;

Expand Down
2 changes: 1 addition & 1 deletion Assets/Swarm/Editor/SwirlingSwarmEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

using UnityEngine;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Swarm/Editor/TubeTemplateEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

using UnityEngine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

#pragma kernel CrawlerInit
#pragma kernel CrawlerUpdate
#pragma kernel CrawlerReconstruct
#pragma kernel CrawlingInit
#pragma kernel CrawlingUpdate
#pragma kernel CrawlingReconstruct

#include "UnityCG.cginc"
#include "SimplexNoise3D.cginc"
Expand Down Expand Up @@ -51,7 +51,7 @@ float4 SampleVolume(float3 p)
}

[numthreads(64, 1, 1)]
void CrawlerInit(uint id : SV_DispatchThreadID)
void CrawlingInit(uint id : SV_DispatchThreadID)
{
// Pick two random points and use closer one.
float3 p1 = RandomPoint(id + 0.0) / 3;
Expand All @@ -71,7 +71,7 @@ void CrawlerInit(uint id : SV_DispatchThreadID)
}

[numthreads(64, 1, 1)]
void CrawlerUpdate(uint id : SV_DispatchThreadID)
void CrawlingUpdate(uint id : SV_DispatchThreadID)
{
// Retrieve the previous position.
float3 p = PositionBuffer[IndexOffset1 + id].xyz;
Expand All @@ -95,7 +95,7 @@ void CrawlerUpdate(uint id : SV_DispatchThreadID)
}

[numthreads(64, 1, 1)]
void CrawlerReconstruct(uint id : SV_DispatchThreadID)
void CrawlingReconstruct(uint id : SV_DispatchThreadID)
{
// Retrieve the history.
float3 p0 = PositionBufferRO[IndexOffset0 + id].xyz; // Two frames ago
Expand Down
2 changes: 1 addition & 1 deletion Assets/Swarm/Shader/SwirlingSwarm.compute
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

#pragma kernel SwirlingUpdate
Expand Down
4 changes: 3 additions & 1 deletion Assets/Swarm/Shader/Tube.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Shader "Swarm/Tube"
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm
Shader "Swarm/Tube"
{
Properties
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Swarm/SwirlingSwarm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

using UnityEngine;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Swarm/TubeTemplate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Swarm - Special renderer that draws a swarm of wobbling/crawling tubes.
// Swarm - Special renderer that draws a swarm of swirling/crawling lines.
// https://github.com/keijiro/Swarm

using UnityEngine;
Expand Down

0 comments on commit 583b687

Please sign in to comment.