Search Unity

► Wireframe shader - The Amazing Wireframe shader ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, Jun 11, 2014.

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Stall_Large.png
    The most wanted and demanded wireframe shader.



    Compatible with:
    • Mobiles
    • Consoles
    • Desktop (of course)
    • TV
    • WebGL
    • VR

    Advanced Wireframe rendering features:
    • Three methods for wireframe rendering
    1. GeometryShader - just apply shader to any mesh and it will render its wireframe. Requres device with GeometryShaders support.
    2. Barycentric Coordinates - reads baked data from mesh, compatible with any device with SM3 support.
    3. Wireframe from texture - no need to bake anything inside mesh or calculate in shader, just use texture with wireframe data.
    • Quad and Triangle wireframe rendering
    • Built-in Anti-aliasing
    • Wire Size controll (can be Screen Space or Fixed size)
    • Wire Color (HDR support)
    • Wire Texture Color (built-in pan effect and UV Set (UV0 or UV1))
    • Wire Vertex Color rendering
    • Wire can receive lighting and shadows or be overlay (unlit)
    • Wire transparency control from Color and Texture alpha channels
    • Wire visibility control using Fresnel or Distance Fade effects
    • Advanced Dynamic Masking options using Plane, Sphere and Box equations
    • Wireframe Projector Shaders
    • Global illumination support.
    • Tessellation shaders

    Built-in Tools
    • Wireframe Texture Exporter tool.
    • Wireframe Editor and Run-time baker tools.

    Supporting Rendering Modes and Types:
    • Unlit
    • One Directional Light
    • Physically Based Shading
    • Unity Standard Shaders (metallic, specular)
    • Additive
    • Multiple

    • Opaque
    • Transparent (Simple, ZWrite, 2 Sided, Advanced 2 Sided)
    • Cutout (Simple, 2 Sided)
    • Per-face control rendering (Front face only, back face, both sides)



    Shaders are Curved World compatible!

    Try this free shader on your device before purchasing.

    Note!
    *BlendShapes are supported only by GeometryShaders.











    Big.jpg


    v2019.1
    • Added dynamic box mask
    • Updated shaders can be placed anywhere inside project and have no more restriction to be inside main Assets folder.

    v2018.5
    • Updated for Unity 2017.4 and 2018.2

    v2018.4
    Updates for Unity 2018.x
    • Fixed PBR shaders fog on mobiles.
    • Fixed shader compilation issues for PS4.
    • fixed "'_LightCoord' no such field in structure" compilation bug for GLES.

    v2018.3
    • Updated for Unity 2018.1

    v2018.2
    • Updated for Unity 2017.3

    v2018.1
    • Fixed Standard shaders not compiling on gles, gles3 and metal

    v2017.12
    • Improved VR support.
    • Fixed some shader compilation failing in Single-Pass Stereo Rendering mode.
    • Various fixes and stability improvements.

    v2017.11
    • Rewritten all shaders to fully support Curved World

    v2017.10
    • Fixed 'One Directional Light' shaders not compiling for android builds.

    v2017.9
    • Updated for Unity 2017.1

    v2017.8
    • Fixed Tessellation and GeometryShaders not receiving correct shadow coordinates in Unity 5.6

    v2017.7
    • Added Unity 5.6 GPU Instancing
    • Re-written Physically Based shaders for Unity 5.6 now are imported in less than 20sec (previously needed 1 hour)

    v2017.6
    • Unity 5.6 compatible (do not update if using previous Unity version!)

    v2017.5
    • Fixed editor batch converter crashing.

    v2017.4
    • Fixed, editor skipping generating skinned mesh wireframe.

    v2017.3
    • Geometry shaders can render quad wireframe (check option 'Try Quad' inside material editor). It's a very fast method but not as accurate as editor generator script. Works well on meshes with good vertex/triangle structure.

    v2017.2
    Fixed:
    • Geometry and Tessellation shaders not receiving fog in Forward rendering mode.
    • Point and Spot light artifacts in Forward rendering mode with BPS shaders.

    v2017.1
    • Added quad mesh rendering
    • Added tessellation shaders
    • Added Global IlIumination support
    • Added full image effects support
    • Added Unity Standard shaders (some wireframe effects are not supported)
    • Added AO textures support for PBS shaders
    • Added bump strength controller
    • Added Additive and Multiply shaders for GeometryShader group.
    • Plane and Sphere dynamic mask supports smooth transition.
    • PBS 'Wire Only' shaders have Metallic and Smoothness controllers
    • Projectors support Distance Fade
    • Improved wireframe rendering (size of 1 will render pixel-perfect wireframe)
    • Fixed shaders not receiving fog in Forward rendering mode.
    • Various multiple adjustments and improvements.

    v2.31
    •Fixed shadows for cutout Geometry Shaders

    v2.3
    • Unity 5.5 ready
    • Added Wireframe Texture Exporter tool. Can export mesh wireframe into a PNG texture.
    • Added option for rendering wireframe from texture, instead of calculating it inside shader.
    • New improved Emission feature. Now it has separate controller inside material editor and is not attached to the WireColor HDR value.
    • Fixed distance fade effect for Cutout shaders.

    v2.2
    New
    • Wire distance fade effect.
    • Wire size can be fixed or screen space size.
    • Wire color can be controlled by texture and/or vertex color.
    • Geometry Shader - does not need mesh converting (generating barycentric coordinates). Works with all mesh types. Supports all mesh features.

    Change
    • Wire Transparency texture option removed. Use wire Color Texture instead.
    • Wire size now is controlled as float variable (not as slider). After upgrading existing project wire size on models will need to be adjusted.

    Fix
    • 'Too many texture interpolators' errors for D3D9 renderer.


    v 2.1
    • Unity 5.4 compatible.
    • Added shader Culling option (Front, Back, Off) - used for rendering cheap 2 sided or single sided mesh.
    • Material editor supports Undo/Redo
    • Fixed: Fresnel effect did not work with bumped shaders.
    • Fixed: Not all lit shaders had option for wire to receive light.
    • Fixed: PBS shaders Transparent Texture Alpha Offset parameter had no effect.
    • Fixed: PBS 2 sided cutout shaders blend mode was incorrectly.
    • Fixed: PBS cutout shader did not receive Point lights (ForwardAdd pass) in combination with unlit wire.
    • Shader keyword count reduced by 4.
    If 'Vertex Color' lost just recheck option inside material editor.

    v 2.02
    • Fixed wireframe transparency texture not working from uv1 coordinates for PBR shaders.

    v 2.01
    • Added example scene: Example_2 (Mask - Plane) BattleBus

    v2.0
    • Unity 5 ready (5.3.2 and above)
    • Not compatible with previous version. Neither shaders nor wireframed meshes. Delete previous version before updating.
    • SM2 is not supported any more.
    • Wireframe data (barycentric coordinates) now are saved inside mesh UV0 buffer (under uv[2] and uv[3] indexes).
    • Color and tangent buffers are not used any more by shader.
    • Shader baking is not necessary any more. Removed.
    • Added mesh batch converter tool.
    • Added PBR shaders.
    • Added wireframe projector shader.
    • Wireframe color supports HDR.
    • Gradient feature replaced with new Dynamic Mask feature.
    • Added fast run-time (per-frame) wireframe generator.
    • Improved transparent and cutout shader quality.
    • New improved material editors.
    • Shaders are Curved World compatible.

    v1.33
    Fixed shader warnings - variables used without having been completely initialized.

    v1.32
    Improved wireframe generator script API.

    v1.31
    Unity editor wireframe will not disturb any more, it can be hidden from material editor.

    v1.3
    Added:
    • Image Based Lighting
    • Vertex Color shaders
    • Wireframe texture transparency
    • Fresnel reflection
    • Wireframe generator and shader baking editor windows
    • ReadMe file​
    Improved:
    • Gradient is calculated per pixel
    • Gradient color can be solid or interpolated to Base texture
    • Cutout shadows support antialiasing
    • Material editor shows useful info about mesh​
    Changed:
    • Shader variable names have correct semantic (renamed)
    • Shader Optimizer replaced with Shader Baker
    • Removed scripts from assets menu, now they are accessible from material editor.
    v1.21
    • Added shader optimizer
    • Fixed example scenes script warnings

    v1.2
    • Big opengl bug fixed (on some hardware shaders didn't compile)
    • Fixed gradient shader switching from Local to World space and vice versa
    • Fixed lightmapping
    • net Framvework 2.0 support

    v1.1
    • New transparent gradient shaders.
    • Transparent shaders wire can be effected by "BaseTex" alpha.
    • Fixed face overlapping for transparent shaders.
    • Fixed point light rendering.
    • Improved shaders by completely removing if/else statements from them
    • New material editor.
    • Implemented plugin "Update Check". Whenever new version is available you will be automatically informed or you can check for updates manually Menu->Window->VacuumShaders->Check for updates.

    v1.02
    • Gradient wireframe shader supports Local/Global space
    • Generated wire data can be stored inside Tangent buffer.
    • Added shader to display wire stored inside Tangent buffer.

    v1.01
    • Fixed wireframe for procedural meshes
    • Fixed shader semantic
    • Several micro improvements



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jan 11, 2019
    Gozdek and pMynLab like this.
  2. pMynLab

    pMynLab

    Joined:
    Oct 1, 2012
    Posts:
    5
    Amazing, from two days i writing own wireframe shader, existing wire frame shader uses GL.Lines and performance is awful on bigger meshes, other scripts not work with complicated meshes so I decide to write own but I will stop. If it will work similar as an image and will work on mobile I save a lot of time.
     
  3. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    715
    great job man
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Rendering tests on Kindle Fire (android 2.3)
    screenshot-1402660581311.png
    screenshot-1402660530069.png
    screenshot-1402660554113.png
     
    Last edited: Feb 14, 2015
  5. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    676
    Awesome ... added to bookmarks.
     
  6. pleribus77

    pleribus77

    Joined:
    Jul 9, 2013
    Posts:
    30
    We have an immediate need for something like this of an iOS project.

    When do you hope to release?

    Do you need testers?
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Still working on some improvements. Maybe next week.

    I would not refuse the iOS testers
     
    Last edited: Jun 16, 2014
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Rendering wireframe and mesh simultaneously.
    • One mesh
    • One material
    • One render pass
    • One draw call

    Try web player: Battle Bus

    uMG2iS.png
     
    Last edited: Nov 22, 2016
  9. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    676
    Beautiful! added in my shopping list!
     
  10. POLYGAMe

    POLYGAMe

    Joined:
    Jan 20, 2009
    Posts:
    196
    Wow, this looks great! I'm currently working on a vector graphic game... this could come in handy. I'm guessing it renders everything in triangles, though, since Unity converts quads to tris? If so, I won't be able to use it...
     
  11. pleribus77

    pleribus77

    Joined:
    Jul 9, 2013
    Posts:
    30
    Take it that the free package doesn't allow you to create the necessary mesh. When will this be available on asset store?
     
  12. Beugnen

    Beugnen

    Joined:
    Oct 4, 2012
    Posts:
    5

    Why is the FPS lower on transparent compared to say "A0"?
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    It is for you to see how shader works and test performance on wanted devices and mobile.
    I am submitting package for review today.

    Screenshot is taken on Kindle Fire, mobile devices handle transparent shaders badly. "AO" is baked into texture, it's unlit opaque shader and rendering performance has better.
     
  14. pleribus77

    pleribus77

    Joined:
    Jul 9, 2013
    Posts:
    30
    Excellent. Will be testing on our target device first thing.

    Thanks for the update.
     
  15. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    @Arkhivrag: That looks really good!

    I worked on something similar half a year ago:

    Wireframe shading.jpg

    It was meant to support drawing only certain edges of the mesh, but I stopped developing it since there's a few edge-cases where the visual quality breaks down due to thin triangles.

    Besides that, there were some other visual artifacts that are hard to get by:

    Wireframe2.jpg

    Do you have any plans to support exclusion of certain edges in your product, to differentiate it from other barycentric shaders? That would rock! Especially if you found a way around the issues I was having.

    And as you may notice in my image, some edges are a bit inconsistent in their widths.
    I didn't dare to use any derivatives in the shader in order to support all mobile devices, so I used a crude scaling factor pre-computed into the mesh.

    I see in your compiled shader (for GLES) that you use GL_OES_standard_derivatives in the form of dFdX / dFdY.
    Do you know if all Android devices nowadays support that extension?

    Anyway, keep up the good work!
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @Mistale
    Currently I do not have plans to support exclusion of certain edges. Have ideas how can I do it, but have no time.
    About dFdX / dFdY - I can not test shader on all devices, that's why I give Free sample package to try before purchase.
     
  17. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    333
    Hi just for your info the free sample package doesn't appear to work correctly on ps vita at the moment with psm. The wireframes don't appear you simply get a solid transparent object instead.
     
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Damn. I do not have ps vita. Free sample package contains two shaders, which one does not work?
    Thanks for letting me know.
     
    Last edited: Jun 27, 2014
  19. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,646
    Cool. Looking for an effect like this one. Bookmarked :cool:
     
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
  21. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    It looks cool but how would this be used in a game?
     
  22. pMynLab

    pMynLab

    Joined:
    Oct 1, 2012
    Posts:
    5
    Hello, i purchased and effects looks amazing :)
    I had one issue during generate wire frame in runtime mode.
    I created procedural mesh and i attach proper shader from Vacuum hierarchy and then

    Code (CSharp):
    1. this.gameObject.AddComponent<Wireframe>();
    unfortunately i got issue :

    Code (CSharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. Vacuum.Wireframe.WireframeDataGenerator.BuildMesh (UnityEngine.Mesh& _origMesh, System.Collections.Generic.List`1& _trianglesIndices, Boolean _rebuildColors)
    3. Vacuum.Wireframe.WireframeDataGenerator.GenerateAdvancedMetaData (UnityEngine.Mesh _origMesh)
    4. Vacuum.Wireframe.WireframeDataGenerator.GenerateMeshData (UnityEngine.Mesh& _origMesh, GENERATE _dataType)
    5. Vacuum.Wireframe.WireframeDataGenerator.GenerateMeshData (UnityEngine.Mesh& _origMesh)
    6. Vacuum.Wireframe.WireframeManager.GetWire (UnityEngine.Mesh _mesh)
    7. Vacuum.Wireframe.Wireframe.Awake ()
    8. UnityEngine.GameObject:AddComponent()
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @pMynLab
    Can you send me your procedural script (in PM) and I will check what causes the error.
     
    Last edited: Jun 28, 2014
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Last edited: Jul 2, 2014
  25. Creepgin

    Creepgin

    Joined:
    Dec 14, 2010
    Posts:
    236
    Hello, we just recently purchased your Fragmentum Pro asset and may possibly get this wireframe shader. Just a couple questions first if you don't mind.

    Our project uses a custom shader built from Shader Forge. It's a simple VertexColor shader with an Alpha Clip setup. We are seeking to add a wireframe effect to it. After getting your shader, do you think it's possible for us to integrate your shader into ours? How hard/easy would that be?

    Thanks!
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @Creepgin
    Hi,
    Wireframe uses data stored inside color buffer of the mesh, with the new update(next week) users will have ability to store that data inside tangent buffer, so vertex color shaders can be used as well.

    SF integration is up to you. All wireframe shading info is public inside cginc file.
     
  27. pMynLab

    pMynLab

    Joined:
    Oct 1, 2012
    Posts:
    5
    Unfortunately, not work on Windows Phone 8 :(
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @pMynLab
    Can you clarify which shader does not work, from Surface group or Unlit ? Does it work if Antialiasing is turned off ?
     
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Update 1.02
    • Gradient wireframe shader supports Local/Global space
    • Generated wire data can be stored inside Tangent buffer.

    Added one shader, which can render wireframe stored inside Color or Tangent buffers. Shader itself is maximum simplified(without "cginc" 's) for those who want rewrite it using Shader Forge.
     
  30. Danail

    Danail

    Joined:
    Feb 10, 2013
    Posts:
    99
    Hello, I was hoping to try the free version, but it does not seem to work. I can not generate mesh since I don't have any editor menus or scripts. The editor folder is missing.
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @Danail
    You can not generate wire mesh in free version. It is only for shader preview and test.
     
  32. paulStapelberg

    paulStapelberg

    Joined:
    Jun 13, 2010
    Posts:
    30
    EDIT: The issue was my Unity version. Thanks for the great shader pack @Arkhivrag. Highly recommended it to anyone looking for these types of effects.

    Hi, I have a client who is using your shaders and has sent me the project to complete. I am having an issue where my mesh is pink.

    On the Unlit NoTex shader it says there it is having errors at line 26 - Program 'frag', unknown semanitic "SV_Target" specified for "frag" at line 355

    It seems that all the unlit shaders have a similar issue.

    It would be appreciated if you could please respond quickly as the deadline for the project is Friday night.
     
    Last edited: Aug 27, 2014
  33. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
  34. mrotondo

    mrotondo

    Joined:
    May 20, 2014
    Posts:
    3
    Hi, this tool is amazingly helpful, thank you for making it! It works great with GameObjects that I create in the editor, but I'm trying to use the wireframe shaders on runtime-instantiated versions of my prefabs and it seems like that breaks the association with the generated wireframe meshes. Does that sound like something I can work around on my end, or would it require a change to the package?
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @mrotondo
    If your instantiated mesh is asset, generated as wireframe mesh, then it shouldn't be problem.
    If it is "fresh" mesh with just wireframe shader, then it will not work.
    Package contains script Wireframe, assign it to your prefab and after instantiation it will generate wireframed mesh.
     
  36. mrotondo

    mrotondo

    Joined:
    May 20, 2014
    Posts:
    3
    Thanks! That did the trick, and is actually a better tradeoff for me (I can spare a little time at load, but I'm trying to keep binary size down).
     
  37. Ryan Kang

    Ryan Kang

    Joined:
    Mar 3, 2013
    Posts:
    2
    Great shader! Thanx.

    I have a question.
    I'm using surface gradient shader, and when I adjust gradient offset, my object turns half textured and half wired.
    And I want to untextured wired half become transparent.
    I changed gradient color (and also alpha value) and untextured (wired) half changed its color but not transparency.
    Gradient color's alpha value change doesn't applied.

    What should I do if I want to untextured(wired) half transparent?
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @Ryan Kang

    If I correctly understand your question, you want achieve something like this?

    Sorry man, you can't. Because I have not thought about effect like this. But it's very cool and I will try to add it in the next update. (image is photoshopped)
     
  39. Ryan Kang

    Ryan Kang

    Joined:
    Mar 3, 2013
    Posts:
    2

    thanks for your answer.
    That's exactly I wanted lol
    I hope you will make that effect and I'll be waiting!
     
  40. MarcCameron3D

    MarcCameron3D

    Joined:
    May 1, 2013
    Posts:
    1
    Hi,

    When I import the package and select the tutorial set up scenes none of the Shaders compile and i am left with this error log.



    Could you advise please?

    Cheers,

    Marc C
     
  41. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    916
    Very nice work!... bookmarked! :)
     
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
  43. S_Vitaly

    S_Vitaly

    Joined:
    Aug 13, 2014
    Posts:
    2
    Hi,

    I imported model of the roof from 3ds. Model is "closed." Then applied shader Unlit / Transparent / NoTex. As a result, the model having "holes" through which the translucent rear side.

    Sorry for my English ;)

    Model:
    object.png

    Unity scene:
    bugs.png
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @S_Vitaly
    Yesterday I submitted new update (v1.1), with new features and improvements, including fix of that bug.
     
  45. S_Vitaly

    S_Vitaly

    Joined:
    Aug 13, 2014
    Posts:
    2
  46. xiaowu

    xiaowu

    Joined:
    Aug 15, 2014
    Posts:
    3
    Great shader! Thank you very much.
    I have a problem : my model is FBX,is not asset . I want my model is look like this wireframe shader.
    What I can do for this model ? My English is not good,Do you known my mean?
    Thank you very much.
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    @xiaowu
    There are two ways to generate wireframe mesh:
    1. Generate asset in editor. Select mesh and go to Assets/Component/VacuumShaders/The Amazing Wireframe Shader/Store wire inside Color/Generate and replace. Asset file will be created and saved inside "Assets/Wireframed Meshes" folder.
    2. Generate wire at runtime. Assign TheAmazingWireframeGenerator script to the object. Menu/Component/VacuumShaders/The Amazing Wireframe Generator
     
  48. xiaowu

    xiaowu

    Joined:
    Aug 15, 2014
    Posts:
    3
    The Num2 way ,where is "TheAmazingWireframeGenerator "? Is it not free program?
     
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,107
    Free version is for shader preview and testing for your target device. It does not contain wire mesh generator.
     
  50. xiaowu

    xiaowu

    Joined:
    Aug 15, 2014
    Posts:
    3
    OK,I got it.
    Thank you very much for you answer my qusetion.
    You are a good programmer.