Comments (12)
Tried rolling URP back to 8.2.0 and same issue. Switched back to 9.0.0-preview and the Decal Asset inspector actually worked for bit and then started drawing black again.
from driven-decals.
After some further digging it seems like the issue is related to Source Control. I'm using Plastic SCM and have various file types setup as lockable and the Unity Library Folder is ignored. (Packages are located in the package cache folder in the Library) Thus the Decal Asset Inspector can't access the materials in the "Packages/com.samdriver.driven-decals/Editor/Resources/" folder that it uses uses to draw the decal region in the inspector.
For now I'm just moving the package files into my projects Asset Folder and updating that path in the Decal Asset Inspector script. Given that Unity now owns Plastic SCM Im guessing other users would end up with the same problem eventually.
from driven-decals.
Something is wonky in DecalAssetInspector with the call to:
EditorGUI.DrawPreviewTexture(previewRegion, previewTexture, overlayBoundsMaterial);
Definitely seems buggy/broken in Unity 2020.1.x. I tried updating to the latest version of Unity 2020.1.11f1 and its still not working properly.
If I take the OverlayBoundsMaterial and add it to a mesh in the scene when I select decal assets in the project I can see that the material is updating to show the decal atlas and the selection region properly. But the inspector only draws a black rectangle. If I remove the custom material from the DrawPreviewTexture function call the base texture then shows up in the inspector, but the selected region is obviously not drawn to the preview with out the material parameter.
I setup a fresh project in Unity 2020.1.11 and added Drawn Decals to it. The asset inspector texture view was working, then stopped working and then started working again. My larger Unity project is at least consistently just drawing a black rect.
I tested making my own custom inspector window with a call to EditorGUI.DrawPreviewTexture() using both the OverlayBoundsMaterial and simpler custom unlit shader. Both attempts resulted in a black rectangle. So it seems like there is a bug with custom materials and the use of EditorGUI.DrawPreviewTexture() in Unity 2020.1.x. I'm trying one last effort to figure out if its related to some other asset in my project or purely a bug in Unity, or SRP, or URP, etc.
from driven-decals.
Hello,
Thanks for the detailed report. Just to confirm are you seeing the fault in Unity 2020.1.11 with the standard 8.2.0 URP? I've not managed to reproduce it yet, but still waiting on some downloads to finish so I can properly recreate your situation.
There's a couple of possible causes that I'll look into. I think DecalAssetInspector handles the material incorrectly, causing the material asset itself to be modified. That was always a bit messy, but now Unity might be picking up on that and breaking things. More generally the URP may not be designed for a Unlit master node to be used for rendering a random bit of in-editor UI, so I may need to swap out that for a traditional shader.
Thanks again for the report. I'll hopefully be back soon with a reproduction.
from driven-decals.
Yes, its happening in 2020.1.9, 2020.1.11 and I'm just about to try 2020.1.12. I've tried URP 8.2.0 and URP 9.0.0 preview, same issue. I'm also still trying to make sure that nothing in my project is causing problems. But I've had it happen in a clean project also. Sorry for the multiple posts, just trying to isolate the issue reliably. Another person using my same project over source control sees the same issues so its definitely Unity or Project Asset related.
from driven-decals.
Tested in clean 2020.1.12f1 project, no source control, no other 3rd party assets, URP 8.2.0. Decal asset inspector draws black. Initially it did work but it stopped working and went to drawing only black while I was testing. Tried it both as a package and as local asset. Seems like its probably a bug in Unity with EditorGUI.DrawPreviewTexture() when using a custom material.
from driven-decals.
I can post of video of the issue if that helps at all. Let me know.
from driven-decals.
Sorry for the rather slow "soon."
I've not been able to reproduce the error yet. Unity 2020.1.12f1, URP 8.2.0 in a fresh project with the decals being the only added package. As it's seemingly a rendering problem it may be that it's hardware dependent, although your colleague also having the issue brings that into some doubt. I'm using an AMD R9 290 for what it's worth.
Regardless, I've tried to fix it! On the 0.8.0 branch DecalAssetInspector now works on a copy of the material asset it uses rather than messing with the stored one. It's a bit of a long shot. But you can try installing this branch through the package manager, remove the current Driven Decals package and add https://github.com/Anatta336/driven-decals.git#0.8.0
Edit to add: That branch also moves the sample decals out of the main package, so you'll need to selectively install the "Fasteners" sample if they're being used to test.
from driven-decals.
I will test that out and see how it looks. Hardware wise I'm running it on my RTX 2080. Thanks.
from driven-decals.
Still having the same issue in with the 0.8.0 branch. Trying a few things on my and will report back.
from driven-decals.
Thanks for the update. I'm increasingly thinking that (as you said earlier) it's a problem with EditorGUI.DrawPreviewTexture()
either in general, when using custom shaders, when using custom shaders made with the shader graph editor, and probably with a certain system configuration.
I still haven't managed to reproduce it on my machine, but I have had someone else report seemingly the same issue.
from driven-decals.
Seems to be working fine so far in Unity 2020.2. Doing a bit more testing to confirm that there are no other issues.
Based on that it indeed seems to be a bug in Unity 2020.1 when using custom materials/shaders with EditorGUI.DrawPreviewTexture()
.
from driven-decals.
Related Issues (19)
- Doesn't work with Unity's Terrain HOT 3
- "Auto-Repeat" projection only works if the inspector window is visible.
- Doesn't seem to work? HOT 1
- Changing the decal asset at runtime
- It doesn't support Skinned Mesh Renderers? HOT 1
- Crashes with il2cpp
- error when autoproject with some houdini objects around. HOT 1
- duplication / copy and pasting causes
- Flickr in virtual reality project. HOT 1
- 7.7.1 is surpport? HOT 1
- Decal asset preview is blue (2021.2.11f1) HOT 2
- A NormalMap settings popup appears after adding the package
- No 'git' executable was found HOT 3
- Runtime generation fails on "Batching Static" meshes HOT 2
- sad NullReferenceException :( HOT 1
- Null purple material HOT 1
- Prefabs not working correctly HOT 4
- A way to store the "ghost" mesh created by the decal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from driven-decals.