Skip to content

Commit def53ff

Browse files
Default black texture XR should be opaque (alpha = 1) #4253
1 parent 7dfdacf commit def53ff

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public static TextureDimension dimension
9292
/// <returns>The default magenta texture.</returns>
9393
public static RTHandle GetMagentaTexture() { return useTexArray ? m_MagentaTexture2DArrayRTH : m_MagentaTextureRTH; }
9494

95+
static Texture2D m_BlackTexture;
9596
static Texture3D m_BlackTexture3D;
9697
static Texture2DArray m_BlackTexture2DArray;
9798
static RTHandle m_BlackTexture2DArrayRTH;
@@ -161,9 +162,12 @@ public static void Initialize(CommandBuffer cmd, ComputeShader clearR32_UIntShad
161162

162163
// Black
163164
RTHandles.Release(m_BlackTextureRTH);
164-
m_BlackTextureRTH = RTHandles.Alloc(Texture2D.blackTexture);
165+
m_BlackTexture = new Texture2D(1, 1, GraphicsFormat.R8G8B8A8_SRGB, TextureCreationFlags.None) { name = "Black Texture" };
166+
m_BlackTexture.SetPixel(0, 0, Color.black);
167+
m_BlackTexture.Apply();
168+
m_BlackTextureRTH = RTHandles.Alloc(m_BlackTexture);
165169
RTHandles.Release(m_BlackTexture2DArrayRTH);
166-
m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D(Texture2D.blackTexture, "Black Texture2DArray");
170+
m_BlackTexture2DArray = CreateTexture2DArrayFromTexture2D(m_BlackTexture, "Black Texture2DArray");
167171
m_BlackTexture2DArrayRTH = RTHandles.Alloc(m_BlackTexture2DArray);
168172
RTHandles.Release(m_BlackTexture3DRTH);
169173
m_BlackTexture3D = CreateBlackTexture3D("Black Texture3D");

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
203203
- Increased path tracing max samples from 4K to 16K (case 1327729).
204204
- Film grain does not affect the alpha channel.
205205
- Disable TAA sharpening on alpha channel.
206+
- Default black texture XR is now opaque (alpha = 1).
206207

207208
## [10.3.0] - 2020-12-01
208209

0 commit comments

Comments
 (0)