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,978
    Confirm in Unity 2018. Working on fix.



    VacuumShaders - Facebook Twitter YouTube
     
  2. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    Thanks, might you have an ETA?
     
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Update will be available next week.



    VacuumShaders - Facebook Twitter YouTube
     
  4. unity_QX6KJ3XmfDXG1A

    unity_QX6KJ3XmfDXG1A

    Joined:
    Aug 30, 2018
    Posts:
    7
    Hello.
    I just started using this shader, and have question. I have mesh object which has more than one material (every material has it own shader). During application execution I am changing current material. Until I added material which has your shader it worked, but now I can't change material but always mesh is drawed by your shader. Is posible to apply on the mesh more than one material among which one will be with your shader?

    Update:
    I solved this, it works well now.
     
    Last edited: Sep 2, 2018
  5. visualjoy

    visualjoy

    Joined:
    Aug 23, 2016
    Posts:
    38
    Is there a way to generate this in realtime, or via a backendserver script?
    I need to make this workflow automatic.

    is there a solution?
     
  6. apate

    apate

    Joined:
    Oct 17, 2013
    Posts:
    9
    Hi, is it possible to give (and alter during runtime) the wireframe mesh different colors at all nodes?
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    • If targeting device with GeometryShaders support just apply Wireframe shader to a mesh and everything will work.
    • If target device does not support GeometryShaders, then you will have to bake barycentric coordinates inside mesh with included tool in editor or run-time.
    WebGL example with procedural mesh generating and wireframe data baking: https://arkhivrag.itch.io/wireframe-shader


    Everything inside shader can be modified dynamically, including wire color.



    VacuumShaders - Facebook Twitter YouTube
     
  8. apate

    apate

    Joined:
    Oct 17, 2013
    Posts:
    9
    So let's say I have a sphere and I could make the left side of it have a wireframe color of blue, and the right side green and the wireframe in between gradually changing from blue to green?
     
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Gradient color of the wireframe can be achieved using only textures.



    VacuumShaders - Facebook Twitter YouTube
     
  10. SpiralCircus

    SpiralCircus

    Joined:
    Feb 1, 2014
    Posts:
    34
    Is is possible to draw only certain lines? For example if the mesh was a plane with verts arranged into a regular hexagonal grid, could I draw only the lines that make up the hexagons and not the lines that make up thr triangles inside the hexagons?
     
  11. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Only triangles and quads.



    VacuumShaders - Facebook Twitter YouTube
     
  12. cesarmontero

    cesarmontero

    Joined:
    Sep 10, 2018
    Posts:
    2
    I'm having a problem with the shader. The transition between wireframe and texture has a "gap", and I need for it to be solid wireframe. I'm not sure why this happens. I'm using the "Wireframe Mask Controller" (plane) and example that shows hides the when this one is moved
    example.JPG
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Does example scene and shaders there have the same problem?
    What Unity version do you use?
    What is build target?
    Is the problem with all wireframe shaders or with specific ones?



    VacuumShaders - Facebook Twitter YouTube
     
  14. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi,

    I am having build to IOS ( iPhone 6s ) but wireframe shader is completely dark ( with shape of mesh ), it works on macbook good, but not on iphone, any idea ?
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    You need to bake barycentric coordinates into the mesh.
    Only GeometryShaders do not need any data baking inside mesh, but mobiles do not support those shaders.



    VacuumShaders - Facebook Twitter YouTube
     
  16. craigb-engine

    craigb-engine

    Joined:
    Apr 13, 2018
    Posts:
    4
    Hi, we are using your amazing wireframe shader. This appears to be working fine on a PC but when we use on a Mac Geometry Shader -> Addative is giving us a pink shader. Is there something that we are doing wrong here? Our Unity version is 2018.2.2f1.
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    May be your device just does not support GeometryShaders.
    In this case just use regular shader and bake wireframe data into a mesh.



    VacuumShaders - Facebook Twitter YouTube
     
  18. Santy

    Santy

    Joined:
    Apr 16, 2013
    Posts:
    26
    Hi,

    Is there any way to get this working with HDRP? I've been using the asset in 2018.3 with no problems but I get "maximum number (256) of shader keywords exceeded" error whenever I import it into a project with HDRP enabled.
    Is there any way or workaround to solve this? I would only need to use Geometry Shaders.

    Thank you.
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Scriptable Render Pipeline is not supported by Wireframe shader.
    It is planed to add first LWRP and later HDRP shaders, but will be they included in the current package are sold separately currently can not say.
    It is just a big work to be done and requires all shaders to be completely re-written from the scratch.



    VacuumShaders - Facebook Twitter YouTube
     
    syscrusher likes this.
  20. jestermaximusJr

    jestermaximusJr

    Joined:
    Jan 12, 2013
    Posts:
    14
    Hello, I've bought your great asset and am trying to figure out how to change the DynamicMask feature so the wireframe is only drawn if the pixel is inside a box (like the existing feature, just with a box, not a sphere). The box is defined by a centerpoint (in world space), and a width(along the local x-axis)/depth(along the local z-axis). Problem is I don't know much about shaders or vector math. I'm sure that the change needs to be made in Wireframe_Core.cgnic, in the V_WIRE_DynamicMask(half3 maskPos) function. However I'm not sure what math is needed to make this happen (an alternative would be to convert from world space position to object space position). Any advice you can give, or resources you could point me to would be very helpful. Thank you!
     
    Last edited: Dec 28, 2018
  21. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Thank you for the info! I understand what you are saying about the shaders. I have an asset of my own that also needs a shader rewrite for SRP support, which I'm working on. The LWRP and HDRP API sets, both in C# and the shaders, are still evolving within Unity's team, and the documentation and examples are not yet complete. I was fortunate to get some face-to-face consultation with a member of Unity's team during Unite LA this year, and he said they really are working to stabilize the APIs and finish the documentation. I got some assistance in finding the APIs I need to use within the published source code, so I'm hoping to make some progress soon.

    Point being, I hear what you are saying and will be patient because I'm in a similar position with my own code base. :)
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Currently there is no Box mask type, but will be added in the next update, somewhere after New Year's holidays. Additionally restriction for the shaders to be inside main Assets folder will be removed.



    VacuumShaders - Facebook Twitter YouTube
     
  23. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi,

    I have an iOS project that acts weird. I load a prefab resource and instantiate a clone to scene.
    I have 2 object uses same wireframe shader material

    iPhone 5, works great
    2 of them great wireframes

    iPhone 6s
    1 of them good, 1 of them pitch black, Maybe a metal api issue ? But it is weird one acts good, one acts not good...

    Using Unity 2017.1.3 patch 2
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    May be you are using asset for Unity 5.6.
    Update Unity to 2017.4.10 (it is minimum supported Unity 2017.x version) and re-download asset.



    VacuumShaders - Facebook Twitter YouTube
     
    MoribitoMT likes this.
  25. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi, I solved the problem... My meshes created with wireframe shaders were corrupted somehow, I had to delete them and rebuild new ones..
     
  26. helios

    helios

    Joined:
    Oct 5, 2009
    Posts:
    308
    Hello - does this work with 2018.3? Thanks.
     
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Works.



    VacuumShaders - Facebook Twitter YouTube
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    sjm-tech and syscrusher like this.
  29. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    That's a really cool feature! Now I have to look for an excuse to use it in my project. :)
     
  30. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    Hi, would you be able to add a shader designed for mobile but with specular done per pixel not per vertex? Per vertex specular I find just too ugly, I'm currently using the physically based shader but it's too slow for my needs.

    Ideally it would deal with more than 1 light (in just 1 pass, is that possible?). I don't need anything else, not even diffuse. It would be great to have an uber mobile shader (where you can turn everything apart from what you need off) but with per pixel specular.
     
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Mobile One Directinal Light shaders calculate specular per-pixel using LookUp texture.
    All other lights per-vertex by Unity.



    VacuumShaders - Facebook Twitter YouTube
     
  32. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    Hi, any update in HDRP support? Thanks
     
    Last edited: Jan 31, 2019
  33. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi.

    Developing games for mobile, a question. Docs says, if the wire source option selected as "Texture" instead "Baked", no baked mesh generation required, and it will be running on any device.

    Can it run on OpenGL 2.0 like on iPhone 5, 4S ? Because I saw a comment says it does not work on WebGL from someone, but docs says no bake required if texture is selected.

    I mean I want to use cars original mesh ( no baked from your tool ) and select texture source options, will this work ?
     
    Last edited: Feb 1, 2019
  34. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Currently HDRP is very unstable.



    VacuumShaders - Facebook Twitter YouTube
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Three options for wireframe rendering:
    1) Wireframe can be rendered from texture, but you must provide that wireframe texture yourself. Supports blendshapes and unlimited vertex count. Shader works on any device.

    2) Wireframe can be rendered from mesh that has such data baked inside. Plugin includes such tool for editor and runtime use. Blendshapes are not supported. Max vertex count allowed is 21.000. Shader works on any device.

    3) Wireframe is completely generated inside shader. No texture or mesh baking is necessary. Supports blendshapes and unlimited vertex count. Requires device with GeometryShaders support.


    Shader works on WebGL: https://arkhivrag.itch.io/wireframe-shader



    VacuumShaders - Facebook Twitter YouTube
     
    MoribitoMT likes this.
  36. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Thanks. Textures works like charm.

    I have another question. I have 2 same objects, 1 wire-framed, 1 normal. They have to be in exact same positions. This creates z-fighting from some angles. I want wire-framed to be more obvious. Any idea about this ( I cannot change size objects and move them a little bit further to prevent z fighting ). Maybe some shader setting.. ?
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    You can try changing render order of the materials using Material.renderQueue



    VacuumShaders - Facebook Twitter YouTube
     
  38. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    Can you check this is working? I have a base map with gloss in the alpha, I've tried various textures for the specular lookup map but I get nothing, no change visually. (One time I started seeing the gloss channel as what looked like a strange transparency, on deselecting the object it went away.)
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    If shaders are not to be used in VR try:
    1. Open VacuumShaders\The Amazing Wireframe Shader\Shaders\cginc\Wireframe_ForwardBase.cginc file.
    2. Remove lines from 12 to 21. Save file.
    3. Right click on Shaders\One Directional Light folder and choose Reimport.



    VacuumShaders - Facebook Twitter YouTube
     
  40. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    That worked, thank you
     
  41. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    Hi, I have another problem with the specular part of the one directional light shader. It seems after a certain distance from camera the specular no longer works on Android. Please see the attached image (there's 1 directional light, diffuse is working fine, the plane is 220 units from camera)
     
  42. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    As specular color and value are read from a lookup texture, all texture rendering issues will effect specular effect.
    In your case it may be due to mipmaps.
    specular.gif

    Try disable Mimaps generation for that texture.



    VacuumShaders - Facebook Twitter YouTube
     
  44. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    That didn't work I'm afraid. Do you have any other ideas?

    Here are the texture's settings (though I tried changing several of these options, no difference):
    https://monosnap.com/file/xm4MErAc7h2HeCcwBnofXjDQ7Bydl2
     
  45. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
  46. look001

    look001

    Joined:
    Mar 23, 2017
    Posts:
    111
    Hi, this asset looks interesting. I have a polygonal mesh structure with support for n-gons. This structure is then converted to a triangular unity mesh. Is it possible to pass the polygon structure for the wireframe? In other words can i say that some lines of the wireframe should not be rendered? I want to use it for android

    Thank you!
     
  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    You can't render only edges of a mesh, shader renders triangles and depending on vertex/triangle structure also quads.



    VacuumShaders - Facebook Twitter YouTube
     
    look001 likes this.
  48. chris_schubert

    chris_schubert

    Joined:
    Jan 8, 2019
    Posts:
    28
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
  50. chris_schubert

    chris_schubert

    Joined:
    Jan 8, 2019
    Posts:
    28
    Thanks! Any advice for modifying one of the existing shaders to support this?