Nov
28
2016

Wireframe Shader

unity-wireframe-shader

Founded some mesh wireframe shader in the unity 5.5f2 builtin shader folder (builtin_shaders-5.5.0f2\DefaultResourcesExtra\VR\Shaders)..
Changes:
– Added fillcolor, outline color
– Added [x] Discard option (draws only lines)
– Removed stereo rendering keywords
– Removed color by distance thing

Download shader:
https://github.com/UnityCommunity/UnityLibrary/blob/master/Shaders/Effects/WireFrame.shader

 

Tip: You can assign this material shader as a 2nd material to your mesh, to draw original material + wireframe (with [x] discard enabled)

wireframe-overlay


9 Comments + Add Comment

  • thank you! i removed “UNITY_VERTEX_INPUT_INSTANCE_ID” and its usable in Unity 5.4.1f1

    • oh nice, removed it from the source and added fillcolor property also.

  • is it possible to make this transparent color? i mean no textures and fill color. how can i achieve this effect?

  • thanx again! if anyone wants to know how i achieve the transparency effect :

    Tags { “Queue”=”Transparent” “RenderType”=”Transparent” “IgnoreProjector”=”True” }

    ZWrite Off
    Blend SrcAlpha OneMinusSrcAlpha // Traditional transparency

  • Would this work on mobile builds(Android/IOS) ?

    • Not tested, but i think should work. (i’ve read that shader with Discard might have issues/slowdown in some phones..)

      • Apparently it doesn’t work for android as it states that the gpu is not compatible. And, I was so hopeful too!!!

Leave a comment

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.