mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fixed circle instancing buffer + clip pixels
This commit is contained in:
@@ -211,7 +211,7 @@ namespace GlitchyEngine.Renderer
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
s_circleInstanceBuffer = new VertexBuffer(typeof(BatchVertex), 1024, .Dynamic, .Write);
|
s_circleInstanceBuffer = new VertexBuffer(typeof(CircleBatchVertex), 1024, .Dynamic, .Write);
|
||||||
s_circleInstanceBuffer.SetData(0);
|
s_circleInstanceBuffer.SetData(0);
|
||||||
|
|
||||||
VertexElement[] vertexElements = new .(
|
VertexElement[] vertexElements = new .(
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ float4 PS(PS_Input input) : SV_Target0
|
|||||||
float amount = smoothstep(0.0f, f, distance);
|
float amount = smoothstep(0.0f, f, distance);
|
||||||
amount *= smoothstep(input.InnerRadius + f, input.InnerRadius, distance);
|
amount *= smoothstep(input.InnerRadius + f, input.InnerRadius, distance);
|
||||||
|
|
||||||
|
// Discard invisible pixels
|
||||||
|
clip(amount - 0.5f);
|
||||||
|
|
||||||
float4 color = Texture.Sample(Sampler, input.Texcoord) * input.Color;
|
float4 color = Texture.Sample(Sampler, input.Texcoord) * input.Color;
|
||||||
color.a *= amount;
|
color.a *= amount;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user