Skip to content

Commit 25344b4

Browse files
committed
Cleanups
1 parent 5f8bb78 commit 25344b4

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

package/Runtime/GaussianSplatURPFeature.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer
5252
rtDesc.depthBufferBits = 0;
5353
rtDesc.msaaSamples = 1;
5454
rtDesc.graphicsFormat = GraphicsFormat.R16G16B16A16_SFloat;
55-
Debug.Log($"isStereo: {isStereo}");
56-
Debug.Log($"Dimension: {rtDesc.dimension}");
57-
Debug.Log($"Volume: {rtDesc.volumeDepth}");
58-
Debug.Log($"stereoRenderingMode: {XRSettings.stereoRenderingMode}");
59-
TextureDesc desc = resourceData.activeColorTexture.GetDescriptor(renderGraph);
60-
Debug.Log($"xrReady: {desc.dimension}");
61-
Debug.Log($"rtDesc vrUsage: {rtDesc.vrUsage}");
6255

6356
// Create render texture
6457
var gaussianSplatRT = UniversalRenderer.CreateRenderGraphTexture(renderGraph, rtDesc, GaussianSplatRTName, true);
@@ -110,7 +103,7 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer
110103
}
111104
else
112105
{
113-
// Legacy single-eye rendering for backward compatibility
106+
// Single-eye rendering
114107
commandBuffer.SetGlobalTexture(s_gaussianSplatRT, data.GaussianSplatRT);
115108
CoreUtils.SetRenderTarget(commandBuffer, data.GaussianSplatRT, data.SourceDepth, ClearFlag.Color, Color.clear);
116109
Material matComposite = GaussianSplatRenderSystem.instance.SortAndRenderSplats(data.CameraData.camera, commandBuffer);

package/Shaders/GaussianComposite.shader

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ CGPROGRAM
1616
#pragma require compute
1717
#pragma use_dxc
1818
#pragma require 2darray
19-
#pragma multi_compile_instancing
20-
#pragma require instancing
2119

2220
// Enable proper multi-compile support for all stereo rendering modes
2321
#pragma multi_compile_local _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
@@ -44,8 +42,6 @@ v2f vert (appdata v)
4442

4543
float2 quadPos = float2(vtxID&1, (vtxID>>1)&1) * 4.0 - 1.0;
4644
o.vertex = UnityObjectToClipPos(float4(quadPos, 1, 1));
47-
48-
o.uv = float2(vtxID&1, (vtxID>>1)&1);
4945
return o;
5046
}
5147

@@ -60,24 +56,17 @@ int _CustomStereoEyeIndex;
6056
half4 frag (v2f i) : SV_Target
6157
{
6258
uint eyeIndex = _CustomStereoEyeIndex;
63-
// return float4(eyeIndex == 0 ? 1 : 0, 0, eyeIndex == 1 ? 1 : 0, 1); // Red = left, Blue = right
64-
6559
// Normalize the pixel coordinates to [0,1] range
6660
float2 normalizedUV = float2(i.vertex.x / _ScreenParams.x, i.vertex.y / _ScreenParams.y);
61+
half4 col;
6762

68-
#if 1
69-
half4 col1, col2, col;
70-
71-
// // Check if using separate eye textures
63+
// Check if using separate eye textures
7264
#if defined(UNITY_SINGLE_PASS_STEREO) || defined(STEREO_INSTANCING_ON) || defined(STEREO_MULTIVIEW_ON)
73-
col1 = UNITY_SAMPLE_TEX2DARRAY(_GaussianSplatRT, float3(normalizedUV, 0));
74-
col2 = UNITY_SAMPLE_TEX2DARRAY(_GaussianSplatRT, float3(normalizedUV, 1));
75-
col = col2 * eyeIndex + col1 * (1 - eyeIndex);
65+
col = UNITY_SAMPLE_TEX2DARRAY(_GaussianSplatRT, float3(normalizedUV, eyeIndex));
7666
#else
7767
// Fallback to legacy single-texture approach for backward compatibility
7868
col = _GaussianSplatRT.Load(int3(i.vertex.xy, 0));
7969
#endif
80-
#endif
8170

8271
col.rgb = GammaToLinearSpace(col.rgb);
8372
col.a = saturate(col.a * 1.5);

0 commit comments

Comments
 (0)