6
2015
Custom shader Transparency & Batching issues
While updating this billboard shader https://github.com/unitycoder/DoomStyleBillboardTest , had couple strange shader issues:
Problem#1:
Overlapping transparent area clips other object behind it (see issue#6)
This one was solved by adding “ZWrite Off” to the shader, apparently something to do how transparent objects get depth sorted..(?)
http://docs.unity3d.com/Manual/SL-CullAndDepth.html
(image, problem#1)
—
Problem#2:
If there are multiple copies of the same object, rotation/scale/direction is broken, object moves to wrong direction as if they are locked together (see issue#5)
This one was solved by adding DisableBatching”=”True” to the shader tags. So Dynamic Batching was the issue..
Tags {“Queue”=”Transparent” “IgnoreProjector”=”True” “RenderType”=”Transparent” “DisableBatching”=”True”}
Other option was to disable [ ] Dynamic Batching from player settings.. but that would disable it for all objects..
http://docs.unity3d.com/500/Documentation/Manual/SL-SubshaderTags.html
(image, problem#2)
Related Posts
Leave a comment
Recent posts
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on