Search Issue Tracker
By Design
Votes
4
Found in
2018.4
2019.4
2020.3
2021.1
2021.1.0b8
2021.2
Issue ID
1319547
Regression
No
SpriteMask data is ignored in Sprite when drawing with CommandBuffer.DrawMesh to a RenderTexture
How to reproduce:
1. Open the user's attached "DrawMask.zip" project
2. Open the "SampleScene" Scene
3. Enter Play Mode
4. Observe the Sprite on the right in the Game view
Expected result: Both left and right Sprites have a cutout area in the center
Actual result: Only the left Sprite has the cutout area
Reproducible with: 2018.4.32f1, 2019.4.22f1, 2020.3.1f1, 2021.1.0f1, 2021.2.0a9
-
Shapely
Mar 08, 2023 22:47
This is an issue I have come across. I am trying to use a render texture to capture a section of a sprite using a sprite mask to set the size and shape of the render texture output. As the render texture output has no sprite mask info the output is nothing. The render texture works fine with sprites not interacting with sprite masks. As stated above this is not a bug but an unsupported feature. I would really like to see this feature supported as it would allow for the use of sprite masks to select from large sprites out of the way of the main camera in the scene, without having overlapping sprite masks messing each other up.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
- [RenderingDebugger][InputSystemPackage] Ctrl+Backspace shortcut doesn't work to open the Rendering Debugger when New Input System is in use
- No option to skip video transcoding when launching a Project
- “ValidateSchema Error2” error is thrown in the Player when using IL2CPP Scripting Backend
Resolution Note:
This isn't a bug and is feature that isn't supported at the moment. The function CommandBuffer.DrawMesh is working as intended as it adds the specified mesh with the material to be drawn. The stencil setup required for sprite mask is handled internally and is not exposed in the scripting api. I've added it to our backlogs as a new feature request.