Search Issue Tracker
Fixed in 5.3.3
[RenderTexture] GetNativeTexturePtr call on Antialiased Depth texture returns IntPtr.Zero
An extra function has been added to the D3D11 Native Rendering interface to allow for the retrieval of the native ID3DTexture type from a Unity RenderBuffer.
In order to replicate the previous functionality you will need to obtain the RenderBuffer for the depth buffer from the render target and pass it in to this function on the D3D Native Interface.
Steps to reproduce:
1. Open attached project
2. Open scene "testScene"
3. Open script "test.cs"
4. Notice that it creates Depth RenderTexture and sets it Antialiasing to 8. The "GetNativeTexturePtr is called on that texture. If IntPtr.Zero is returned then NULL is printed to console
5. Run scene and notice that NULL is printed in console
6. Stop the scene and in test.cs set antiAliasing property to 1
7. Run scene again and notice that NULL is no longer printed
8. Stop the scene and in test.cs set antiAliasing back to 8
9. In RenderTexture constructor (line 11), change RenderTextureFormat.Depth to RenderTextureFormat.Default
10. Run scene again ant notice that NULL isn't printed as well.
Reproduced with: 5.0.4f1, 5.1.4f1, 5.2.3p2, 5.3.0f4, 5.4.0a6
Not reproducible: 5.0.1f1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Aplying changes to root prefab in a nested prefab undo changes made to the child prefab
- Sub Emitter particle's width is twice its height when Separate Axes in the Size over Lifetime module is enabled and set to 1
- Animation does not play correctly when Optimized Game Object functionality is used and a Child GameObject is added to bone
- An object created via "Create Empty Child" of Hierarchy panel in Prefab Mode is always a child of the main prefab
- [VCS] Version Control window could use a search field to filter down contents