Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package/Runtime/GaussianSplatRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public bool GatherSplatsForCamera(Camera cam)
var orderA = a.Item1.m_RenderOrder;
var orderB = b.Item1.m_RenderOrder;
if (orderA != orderB)
return orderB.CompareTo(orderA);
return orderA.CompareTo(orderB);
var trA = a.Item1.transform;
var trB = b.Item1.transform;
var posA = camTr.InverseTransformPoint(trA.position);
var posB = camTr.InverseTransformPoint(trB.position);
return posA.z.CompareTo(posB.z);
return posB.z.CompareTo(posA.z);
});

return true;
Expand Down
2 changes: 1 addition & 1 deletion package/Runtime/GpuSorting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public GpuSorting(ComputeShader cs)

cs.EnableKeyword(m_keyUintKeyword);
cs.EnableKeyword(m_payloadUintKeyword);
cs.EnableKeyword(m_ascendKeyword);
cs.DisableKeyword(m_ascendKeyword);
cs.EnableKeyword(m_sortPairKeyword);
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Vulkan)
cs.EnableKeyword(m_vulkanKeyword);
Expand Down
5 changes: 4 additions & 1 deletion package/Shaders/GaussianComposite.shader
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ Texture2D _GaussianSplatRT;
half4 frag (v2f i) : SV_Target
{
half4 col = _GaussianSplatRT.Load(int3(i.vertex.xy, 0));
return float4(GammaToLinearSpace(col.rgb/col.a),col.a);
if(col.a>0)
return float4(GammaToLinearSpace(col.rgb/col.a),col.a);
else
return float4(GammaToLinearSpace(col.rgb),col.a);
}
ENDCG
}
Expand Down
4 changes: 2 additions & 2 deletions package/Shaders/RenderGaussianSplats.shader
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Shader "Gaussian Splatting/Render Splats"

Pass
{
ZWrite Off
Blend OneMinusDstAlpha One
ZWrite On
Blend One OneMinusSrcAlpha
Cull Off

CGPROGRAM
Expand Down