Skip to content

Instantly share code, notes, and snippets.

View moosichu's full-sized avatar
🚀

Tom Read Cutting moosichu

🚀
View GitHub Profile
SplatParticles[(int)_particleContainerSize) / THREAD_GROUPS_X, 1, 1](
horiRes: pointMap.HoriRes, vertRes: pointMap.VertRes,
planeWidth: pointMap.Width, planeHeight: pointMap.Height,
waveParticleBuffer: _waveParticlesBuffer,
splateTexture: _splatTexture)
///
/// Initialise the SplatParticles GPU Compute Kernel to splat the particles to a texture
///
_gpuSplatParticles.SetTexture(kernel_SplatParticles, SPLAT_TEXTURE, _splatTexture);
_gpuSplatParticles.SetBuffer(kernel_SplatParticles, WAVE_PARTICLE_BUFFER, _waveParticlesBuffer);
_gpuSplatParticles.SetInt(HORI_RES, pointMap.HoriRes);
_gpuSplatParticles.SetInt(VERT_RES, pointMap.VertRes);
_gpuSplatParticles.SetFloat(PLANE_WIDTH, pointMap.Width);
_gpuSplatParticles.SetFloat(PLANE_HEIGHT, pointMap.Height);
private const string HORI_RES = "horiRes";
private const string VERT_RES = "vertRes";
private const string PLANE_WIDTH = "planeWidth";
private const string PLANE_HEIGHT = "planeHeight";
private const string WAVE_PARTICLE_BUFFER = "waveParticleBuffer";
private const string SPLAT_TEXTURE = "splatTexture";
private const string SPLAT_PARTICLES = "SplatParticles";
const int horiRes; // The horizontal resolution of the water's surface
const int vertRes; // The vertical resolution of the water's surface
const float planeWidth; // The physical width of the water's surface in the game world
const float planeHeight; // The physical height of the water's surface in the game world
StructuredBuffer<WaveParticle> waveParticleBuffer; // A buffer full of Wave Particle instances!
RWTexture2D<float4> splatTexture; // The texture that we splat the Wave Particles to!
///
/// Splat the Wave Particles frmo wavePaticleBuffer to the splatTexture
///