Aetheria/Assets/Plugins/GPUTrail/Shaders/GPUTrailVariables.cginc
Reinier Vens bb297bf84c Lightning
Created Lightning Gun effect (Uses LineRenderer, very slow)
Created GPU Lightning renderer (very fast, still needs integration)
2021-02-04 04:37:47 +00:00

25 lines
618 B
HLSL

#ifndef GPUTRAIL_VARIABLES_INCLUDED
#define GPUTRAIL_VARIABLES_INCLUDED
#include "GPUTrailVertex.cginc"
fixed4 _StartColor;
fixed4 _EndColor;
uint _VerticesPerInstance;
StructuredBuffer<uint> _IndexBuffer;
StructuredBuffer<Vertex> _VertexBuffer;
#ifdef GPUTRAIL_TRAIL_INDEX_ON
StructuredBuffer<uint> _TrailIndexBuffer;
#endif
Vertex GetVertex(uint indexBufferIdx, uint trailIdx){
#ifdef GPUTRAIL_TRAIL_INDEX_ON
trailIdx = _TrailIndexBuffer[trailIdx];
#endif
uint idx = _IndexBuffer[indexBufferIdx];
idx += trailIdx * _VerticesPerInstance;
return _VertexBuffer[idx];
}
#endif // GPUTRAIL_VARIABLES_INCLUDED