Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

► 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,972
    New update v1.1 has been released

    • 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.

    Note:
    Remove previous version from project before updating.
    Script "Wireframe" has been renamed to "TheAmazingWireframeGenerator".
     
  2. moproductions

    moproductions

    Joined:
    Sep 28, 2010
    Posts:
    88
    Hello. I just purchased the plugin but things don't seem to be working properly. I'm using 4.5.3, but when I open up the demo scenes there's no wireframes, just giant pink shapes. Which is odd because the texture appears to be attached. Is there something else I need to do? I've attached a screenshot:

     
    Last edited: Aug 15, 2014
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Right click on Shaders folder and choose Reimport, this will force Unity to recompile shaders. Which some how did not happen after importing package.
     
  4. moproductions

    moproductions

    Joined:
    Sep 28, 2010
    Posts:
    88
    OK I've done that twice now and I keep getting the same set of errors compiling the shaders with the models still pink:
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    New update 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


    Before downloading new version remove old one from your project and from Asset Store's folder.
     
    Last edited: Aug 27, 2014
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Last edited: Feb 14, 2015
  8. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,020
    Hi,

    I am still learning game development - basic csharp programming, currently half way through blender tutorials on basic image creation and editing but no texture work or such done yet so a lot of development terms are still a foreign language.

    I have tried using search engines to describe what wireframe shaders are and how they are beneficial but am not seeing anything written for beginners like me.

    With my very limited knowledge I suspect that your product may be useful to me in the future on my project (if it works like I think it does) but am at a bit of a loss as it may not be what I am thinking. I am probably not the only beginner who is in this position. Could you please give a description in more basic terms as too what your product does and what benefits it provides over unity`s standard built in tools.

    thanks
     
  9. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    639
    So, it requires pre-processing. I'd say that makes it a "99% shader effect" at most ;) .

    Still, it's neat :).
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @docsavage
    Wireframe shader visualizes triangles of mesh using GPU. Currently there are some techniques to achieve same effect, but there are very inefficient: using GL.wireframe or generate list of triangles and render them using script with GL.Lines. for dx11 there exist some techniques using geometry shader, but again, there all are very limited and/or slow.

    Package contains many additional effects you can use with wireframe.
    Try web players to see some of them: Troll or BattleBus


    @RC-1290
    It is 100% shader effect. Only shader renders wireframe, nothing more.
    Shader reads barycentric coordinates written inside color buffer of mesh. If your mesh has no such data package contains tool to fix it for you, inside editor or in game mode.
     
    Last edited: Aug 25, 2014
  11. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Hello,

    Is it possible to see the mesh as quads or ngons?
    While on pre-processing, are there any adjustments we can make or is it totally automatic?
    Can we manually prepare the pre-computed data (is it vertex color/alpha?) and not use the supplied tool at all?

    Thanks.
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @gurayg
    Hi
    "Is it possible to see the mesh as quads or ngons?"
    Currently shader renders polygons only as triangles.

    "While on pre-processing, are there any adjustments we can make or is it totally automatic?"
    It is automatic. What adjustments do you mean?

    "Can we manually prepare the pre-computed data (is it vertex color/alpha?) and not use the supplied tool at all?"
    Yes of course. Shader reads barycentric coordinates of vertex written inside color buffer.
     
    Last edited: Aug 25, 2014
  13. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,020
    Thanks for the reply
     
  14. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Thanks for the fast reply.

    As an adjustment I wanted to know, if we can get a quad output while on pre-processing, which you already answered.

    Do you think it is feasible to get a quad rendering someday?
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    "Do you think it is feasible to get a quad rendering someday?"
    May be, I have to make some research.
     
  16. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    639
    Don't worry, I am somewhat familiar with the technique. I was merely commenting on the marketing.
    At runtime lightmapping is also purely a shader effect (either texture lookups with a separate UV set, or using data baked into the vertex colors). But that downplays the importance of the baking tool, to get the necessary data.
     
  17. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    703 errors on import and the scene manager in the troll scene is missing it's script. Please advise, thanks.

    wireframe.png
     
  18. pottering

    pottering

    Joined:
    Aug 13, 2013
    Posts:
    2
    Hello, does it work on animated meshes?
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
  20. pottering

    pottering

    Joined:
    Aug 13, 2013
    Posts:
    2
    Ah thanks, purchased!
     
  21. Databases

    Databases

    Joined:
    Mar 24, 2014
    Posts:
    22
    I liked it and want to purchase it, but i have a question

    what is the real benefit of Wireframe shader?
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @Databases
    If you need to visualize mesh triangles, then there is no way but use wireframe shader.
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    New update v1.21
    • Added shader optimizer
    • Fixed example scenes script warnings


    What is shader optimizer:
    Unity shader may contain large amount of shaders inside one shader file. Depending on the situation appropriate shader is used.
    Instead of writing two shader files, one with wireframe antialiasing ON and another with OFF, I can write just one file with both effects inside. This is achieved using shader "#pragma multi_compile" and you(user) have controller for turning that feature on or off inside material editor.
    For this example two shaders will be compiled inside one shader file: ANTIALIASING_ON and ANTIALIASING_OFF

    As more parameters become optional (and that is good for user to tweak the shader) more "multi_compiles" are necessary.
    For example gradient axis controller has three states: AXIS_X, AXIS_Y and AXIS_Z.
    This forces unity to compile 6 variations of the shader inside one file:
    1. ANTIALIASING_ON AXIS_X
    2. ANTIALIASING_ON AXIS_Y
    3. ANTIALIASING_ON AXIS_Z

    4. ANTIALIASING_OFF AXIS_X
    5. ANTIALIASING_OFF AXIS_Y
    6. ANTIALIASING_OFF AXIS_Z

    Adding one more optional parameter will increase shader variations to 6 * 2.
    Adding even one more to 12 * 2. And so on.

    Using "multi_compile" helps developers very much, instead of writing hundreds and thousands (yes 1000s) of shader files, it is possible to write one file with all possible effects inside.
    But it has downside.
    1. Compilation of the shader needs more time
    2. Compilation of the shader needs more memory (may crash application on mobiles)
    3. Compiled shader file size increase

    And here comes Shader Optimizer.
    It takes all used effects and bakes them inside new shader without using any "multi_compiles". But now you will not have further control over optional effects throughout material editor. They all are backed.
    This dramatically reduces compilation time, memory and shader size.

    If you have material with Antialiasing ON and (for example) Fresnel OFF - with Optimizing they will be backed but you will not be able to modify them - optional parameters will become invisible inside material editor.

    To optimize shader, select material(s) and go to Assets/VacuumShaders/The Amazing Wireframe Shader/
    This will generate new shader file, but original shader of the package remain unattached, so you can use them further.

    Use optimized shaders for final builds and when you do not need material modifications.


    I hope I've explained myself well :D
     
    Last edited: Aug 27, 2014
  24. Dom_Laflamme

    Dom_Laflamme

    Unity Technologies

    Joined:
    Sep 25, 2013
    Posts:
    27
    thanks for this shader. it's very useful.
    question: any chance this can work on terrains?
     
  25. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Thanks
    I have not thought about terrains, need to make some research.
     
  26. Alosh

    Alosh

    Joined:
    Jul 9, 2012
    Posts:
    5
    I'm trying to manipulate the Gradient Offset from within a JS script. (say to change its value when a player hovers over the object)

    How do I do that?
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
  28. Alosh

    Alosh

    Joined:
    Jul 9, 2012
    Posts:
    5
  29. viniciuscury

    viniciuscury

    Joined:
    Dec 10, 2013
    Posts:
    2
    Hi, am i able to keep the mesh color solid?
    With no shadow or light effect. I want to keep that with the same color as background so we only see the wireframe.
    tks
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @viniciuscury
    There is check box inside material editor "Lights and Lightmaps effect Wire", turn it off.
     
  31. eranhaas

    eranhaas

    Joined:
    May 30, 2013
    Posts:
    5
    Is it possible to use this shader on a mesh with blendshape animation?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Can not say, I have never worked with blend shapes, may be no. But works with skeletal animation.
     
  33. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Hello,

    I'm working with your tools and I have a problem with the animation... and the materials...

    Your tool works very fine but I'm using Megafiers for vertices animations (Point Cache Files), It seams deactivate my animation when using "The Amazing Wireframe Generator (Script)".
    Anyway, I didn't find the way to apply a vacuumshader on a mesh from mine without apply this script.
    Even if I use the same material used on the transparent troll of your demo scene. This Troll mesh don't have the wireframe generator script... why?
    I think I messed something in the workflow... ?

    Many thanks.

    J
     
    Last edited: Nov 19, 2014
  34. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
  35. socoman3

    socoman3

    Joined:
    Jan 31, 2014
    Posts:
    19
    Hi there!

    As someone mentioned before, it would be very useful to mesh in quads instead of triangles. I am trying to add vectorial-like shapes to my game, and with triangles I can't get the look that I want.

    I hope you can do some research. I don't see any other shaders asset that do this, so it would be quite a unique feature.

    Thanks!
     
  36. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Many thanks for four reply!
     
  37. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    I wonder, can we mix this effect with an opacity map?
    I'd like to apply this effect on a sphere but i'd like its poles to be transparent...
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    You can it with transparent shaders.

    base_transparency.png



    Vacuum Shaders
     
    Last edited: Feb 14, 2015
  39. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Can the shaders do IBL lighting from Marmoset Skyshop? (The ODL gradient shader specifically)

    Thanks
     
    Last edited: Nov 27, 2014
  40. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    Currently no, but next update will have IBL.



    Vacuum Shaders
     
  41. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Hi Arkhivag,

    Thanks for your reply,

    I tested your suggestion but this what I tried to achieve :



    Here, the base color of the mesh is fully transparent, I've got only the wire, which is self-illum and I'd like to control the opacity of the wire.
    Here, I'd like the poles to fade...
     
  42. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Great, thanks. I already bought this and very nice effect. Really like your Flow asset also.
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @3DJayC
    As I guess you want wire transparency control vie texture

    Wire_Sphere.gif

    Sorry, it is not possible, cos I have not thought about such effect. I will try to add it in the next update.



    Vacuum Shaders
     
    Last edited: Feb 14, 2015
  44. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Yes That's it!

    How did you get this effect?
     
  45. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    It is Photoshopped



    Vacuum Shaders
     
  46. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Oh man, I was hoping :p

    However, I encountered another issue.

    I've got a simple Geosphere, and the wire is transformed in quad on android.



    Sorry, I'm insistent :p
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @3DJayC
    Have never worked with Nexus 5, can you test Troll example scene (it is inside package)



    Vacuum Shaders
     
    Last edited: Nov 27, 2014
  48. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    I just tested it right now, here is the result :



    The wire isn't homogeneous, It's not Full Tri or Full Quad. (see the base under the grass)
     
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,972
    @3DJayC
    Thanks, It seem that Nexus 5 rendering pipeline renders quads and not triangles. Currently I could not found more info about that, just this one, where nexus 5 could not render single triangle.

    edit:
    It seems that all vertex colored shaders will have different results on Nexus 5


    Vacuum Shaders
     
    Last edited: Nov 27, 2014
  50. 3DJayC

    3DJayC

    Joined:
    Jul 29, 2014
    Posts:
    33
    Hi!

    I was wondering if you will add the transparency control via texture for the next update?

    J