Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentException: RenderTextureDesc width must be greater than zero. #104

Closed
plyoung opened this issue Sep 24, 2020 · 6 comments
Closed
Assignees
Labels
bug Something isn't working released on @preview

Comments

@plyoung
Copy link

plyoung commented Sep 24, 2020

This error occurs when I load the project. The sprite does not appear until I click on it, click away, and click back (in hierarchy); or, I can press Play and the error will occur again but the sprite will then start showing and error stops from then on till next time i restart Unity with the project loaded. Unity 2020.2,0b2 though, so not sure if that is at fault here.

ArgumentException: RenderTextureDesc width must be greater than zero.
Parameter name: desc.width
UnityEngine.RenderTexture.ValidateRenderTextureDesc (UnityEngine.RenderTextureDescriptor desc) (at <9584de3444b542abbb1ad4bb43a7137f>:0)
UnityEngine.RenderTexture.GetTemporary (UnityEngine.RenderTextureDescriptor desc) (at <9584de3444b542abbb1ad4bb43a7137f>:0)
UnityEngine.RenderTexture.GetTemporaryImpl (System.Int32 width, System.Int32 height, System.Int32 depthBuffer, UnityEngine.Experimental.Rendering.GraphicsFormat format, System.Int32 antiAliasing, UnityEngine.RenderTextureMemoryless memorylessMode, UnityEngine.VRTextureUsage vrUsage, System.Boolean useDynamicScale) (at <9584de3444b542abbb1ad4bb43a7137f>:0)
UnityEngine.RenderTexture.GetTemporary (System.Int32 width, System.Int32 height, System.Int32 depthBuffer, UnityEngine.RenderTextureFormat format, UnityEngine.RenderTextureReadWrite readWrite, System.Int32 antiAliasing, UnityEngine.RenderTextureMemoryless memorylessMode) (at <9584de3444b542abbb1ad4bb43a7137f>:0)
Coffee.UISoftMask.SoftMask.get_softMaskBuffer () (at Library/PackageCache/[email protected]/Scripts/SoftMask.cs:192)
Coffee.UISoftMask.SoftMaskable.<UnityEngine.UI.IMaterialModifier.GetModifiedMaterial>b__28_0 (UnityEngine.Material mat) (at Library/PackageCache/[email protected]/Scripts/SoftMaskable.cs:135)
Coffee.UISoftMask.MaterialCache.Register (UnityEngine.Material material, UnityEngine.Hash128 hash, System.Action`1[T] onModify) (at Library/PackageCache/[email protected]/Scripts/MaterialCache.cs:60)
Coffee.UISoftMask.SoftMaskable.UnityEngine.UI.IMaterialModifier.GetModifiedMaterial (UnityEngine.Material baseMaterial) (at Library/PackageCache/[email protected]/Scripts/SoftMaskable.cs:129)
UnityEngine.UI.Graphic.get_materialForRendering () (at C:/Apps/Unity/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Graphic.cs:492)
UnityEngine.UI.Graphic.UpdateMaterial () (at C:/Apps/Unity/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Graphic.cs:645)
UnityEngine.UI.Image.UpdateMaterial () (at C:/Apps/Unity/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Image.cs:900)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at C:/Apps/Unity/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Graphic.cs:623)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/Apps/Unity/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:217)
UnityEditor.Undo:Internal_CallWillFlushUndoRecord()
@plyoung plyoung added the bug Something isn't working label Sep 24, 2020
@mob-sakai
Copy link
Owner

@plyoung
Thank you for your reporting!

@mob-sakai
Copy link
Owner

Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?

@plyoung
Copy link
Author

plyoung commented Sep 25, 2020

I did a few more tests and it seems to happen only if Unity is oppened while the Scene view is active (when you exited before with Scene panel active). If you open the project with Game view active then the error will not occur. My Game and Scene panels are on different tabs so not both visible (active) at same time.

TEST.zip

@mob-sakai
Copy link
Owner

Thanks!

@mob-sakai
Copy link
Owner

@plyoung
The issue is reproduced on my environment.

github-actions bot pushed a commit that referenced this issue Sep 27, 2020
# [1.0.0-preview.11](v1.0.0-preview.10...v1.0.0-preview.11) (2020-09-27)

### Bug Fixes

* an exception is thrown when the game view is inactive ([97e5a21](97e5a21)), closes [#104](#104)
* graphic.materialForRendering always returns different material ([3f6acec](3f6acec)), closes [#103](#103)
@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0-preview.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @preview
Projects
None yet
Development

No branches or pull requests

2 participants