- Home /
Rendertype for Unity's non-legacy Image UI
Hello,
I'm using a script that uses a shader containing many replacement subshaders to render the contents of the scene. Shaders with a certain tag, for example "Enemy" are rendered in red. Shaders that are not listed in the script are not rendered at all. This is all well for a minimap, which I am working on, but say that I want to render a texture on top of the minimap, for example, a frame around the minimap. Using Unity's new UI system, I set up a separate canvas, and configure it so that it uses the minimap camera, and that it contains an image.
When I set the camera's clearing flags to "Depth Only" the minimap works perfecty well with the image. But the minimap doesn't contain a background.. so I set the appropriate clearing flag.. and.. the image disappears. The replacement shader is still doing it's work, but the image is not available. I did some research on this, and found the following page:
http://docs.unity3d.com/Manual/SL-ShaderReplacement.html
The replacement shader tags are all listed there. Those are used by the script to determine what get's rendered a certain way. The strange thing is that there is no rendertype tag for objects using Unity's new 'image' component. Instead, there is an "Overlay" tag, which ideally would be used, but it's set to work with the legacy 'GUITexture' and other features.
Is there a different way I could work around the problem? All I really need is to render an image with the background clearing flag setting. Along with having gameobjects in the scene appear a certain color and be distinguishable from other objects.
Hopefully the Unity team will be aware that an important replacement shader tag is still tied to a legacy feature.
Thanks.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Trying to reset image settings on main camera smoothly 1 Answer
No Camera Rendering when switching between cameras developing for Android 0 Answers
Checking if GameObject is rendered by specific camera 1 Answer
Camera stops rendering objects whenever this smooth follow 2D Script is applied 2 Answers