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
    Pink color means that shader is not complied.
    To check why it is not compiled -> select shader from material editor and in shaders Inspector window will be written all problems.
    Untitled-1.png
    Untitled-6.png

    Select error warning and inside Console window will be displayed full info about it.



    VacuumShaders - Facebook Twitter YouTube
     
  2. Hardwires

    Hardwires

    Joined:
    Jun 27, 2014
    Posts:
    4
    Here we go:



    I guess the reason it can't include it is because it doesn't seem to have been imported:



    And that would be because it isn't even in the package itself:



    This is really annoying.

    EDIT: Is Wire_Functions.cginc the same as Wireframe_Core.cginc? The package I have seems to appear different from the one listed on the asset store.

    EDIT 2: Oh, pressing RESET after renaming the file seems to have fixed it. Thanks!
     
    Last edited: Mar 8, 2016
  3. Hardwires

    Hardwires

    Joined:
    Jun 27, 2014
    Posts:
    4
    Damn it. Now I have another issue. The 2-sided transparent shader is definitely not transparent:



    As you can see the background is not being shone through object. Why is this happening?

    EDIT: The Issue is actually only with the UI, it seems.



    Yep, the geometry seems to intersect with the UI.
     
    Last edited: Mar 8, 2016
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Unity did not import Wireframe_Core.cginc file. It is inside package (you can check it on asset store also).
    Untitled-1.png

    Before downloading and importing package:
    1. Delete previous version from project. (Wire_Functions.cginc is from previous version)
    2. Cleaning asset store cache:
    PC - C:\Users\[Your Profile Name]\AppData\Roaming\Unity\Asset Store
    MAC - "~/Library/Unity/Asset\ Store".



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Mar 8, 2016
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    It may be transparent shaders rendering order issue.
    1. Select shader and double-click to open it.
    2. Find line with "Queue"="Transparent"
    3. Change it to "Queue"="Transparent+1" (means that current shader will be rendered after all transparent shaders)
    4. Save file.
    5. Unity may not change shader render queue automatically. Just assign new shader and then revert (do not use CTRL + Z).



    VacuumShaders - Facebook Twitter YouTube
     
  6. Hardwires

    Hardwires

    Joined:
    Jun 27, 2014
    Posts:
    4
    Thank you so much! Everything is working now.
    There are still however some issues where when moving the camera from inside a wire object to outside the object causes other objects to disappear until the camera re-enters the object.
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    That's the global problem of all transparent shaders that's why I've added 3 types of transparent shaders.
    If you are using black wire color then better use Multiple shaders, they have no problem rendering order.



    VacuumShaders - Facebook Twitter YouTube
     
  8. vngthowhing

    vngthowhing

    Joined:
    Jan 28, 2015
    Posts:
    3
    My original mesh has less than 65K vertices (about 50K), but after calling Generate, it creates a mesh with 70K vertices and breaks because it exceeds the 65K limit. Any ideas how to prevent this?
    Victor.
     
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    It is written inside ReadMe file, Doc folder - During generating barycentric coordinates mesh vertex count may increase and if it is more then 65.000 conversion will fail.
    While generator does its best to minimize addition vertex count, sometimes it can not be done because of mesh vertex/triangle structure. In this case the only solution is slit the mesh manually.



    VacuumShaders - Facebook Twitter YouTube
     
  10. vngthowhing

    vngthowhing

    Joined:
    Jan 28, 2015
    Posts:
    3
    Thanks - that's what I ended up doing, and the solution works for me.
    Victor
     
  11. Superrodan

    Superrodan

    Joined:
    Nov 10, 2013
    Posts:
    10
    I just updated to 2.0 and am getting this error:
    Assets/VacuumShaders/The Amazing Wireframe Shader/Scripts/TheAmazingWireframeGenerator.cs(36,26): error CS0246: The type or namespace name `WIRE_INSIDE' could not be found. Are you missing a using directive or an assembly reference?​

    If there is something simple I can do to fix this, please let me know. If you need me to troubleshoot, then I apologize but I won't be able to until tomorrow. I really like the shader so far and understand that with big updates come brand new problems so I can't blame you. Thank you for all your hard work!

    EDIT: I fixed this by completely uninstalling and reinstalling.
     
    Last edited: Mar 9, 2016
  12. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455


    Hello, first of all congratulations for the release of version 2, that seems to improve and be even better.

    As put on the quote above, on february 2015 I already bought your great and well done shader, but have been waiting all this time until maybe you could add the option in version 2 to be able to remove the internal wireframe, I mean that the wireframe does not show the internal triangles, only the edges of the polygons?

    Now finally you have finished version 2, so wanted to know if this may be possible, or it could be possible in a possible future update. I think that this would be really great and useful if it could be done and a boost for your shader that could be used in much more places if you can avoid showing all the triangles.

    thanks for any help and I send you maybes wishes for this new version and that you can sell a lot
     
    Last edited: Mar 9, 2016
    Cascho01 likes this.
  13. KeithT

    KeithT

    Joined:
    Nov 23, 2011
    Posts:
    83
    Thanks for the update but......

    We are working with large meshes generated from point clouds which are split up by the Unity importer into several meshes. Mesh generation fails every time with the new version :eek:(

    Editing these meshes by hand is a non starter.
     
  14. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Yes, you should have completely uninstalled previous version. It is written in Release Notes. Glad you could fix it.


    Wireframe is rendered only as triangles :oops: no edge detection.


    With previous version it also will fail.
    Barycentric are generated per-vertex and all three vertices of triangle must have unique coordinates. If it is impossible generator splits vertex and increase vertex count.
    While generator does its best to minimize addition vertex count, sometimes it can not be done because of mesh vertex/triangle structure (how good generator handles optimization you can check in run-time example scene).
    If you can not split it by hand, may be use some editor script?



    VacuumShaders - Facebook Twitter YouTube
     
  15. Cipic01

    Cipic01

    Joined:
    Mar 15, 2016
    Posts:
    2
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Cipic01 likes this.
  17. Cipic01

    Cipic01

    Joined:
    Mar 15, 2016
    Posts:
    2
    Thank you !
     
  18. NFB_VM

    NFB_VM

    Joined:
    Sep 4, 2013
    Posts:
    5
    Updated to Wireframe Shader 2.01 with Unity 5.4.0b10 and am now getting the following errors:

    Assets/VacuumShaders/The Amazing Wireframe Shader/Scripts/TheAmazingWireframeGenerator.cs(19,12): error CS0246: The type or namespace name `WIRE_INSIDE' could not be found. Are you missing a using directive or an assembly reference?

    Shader error in 'VacuumShaders/The Amazing Wireframe/Projector': Can't find include file ../cginc/Wireframe_Core.cginc at line 54 (on )
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Delete previous version before updating. Check release notes.
    No support for Unity beta versions.



    VacuumShaders - Facebook Twitter YouTube
     
  20. Cross22

    Cross22

    Joined:
    Sep 26, 2014
    Posts:
    22
    Pass the normal from vertex shader to the fragment shader. Then use ddx/ddy(i.normal) to check if the tangent vectors along x/y exceeds a given threshold. If so you've got an edge :)
     
    Hormic likes this.
  21. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    564
    Hi,

    I tried applying the free shader to other objects like my own meshes, and it does not work.

    From reading the forums here, it sounds like the full version builds some kind of special mesh for this, based on my existing meshes, is that correct?

    -Chilton
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Check ReadMe file inside free shader package.



    VacuumShaders - Facebook Twitter YouTube
     
  23. evr

    evr

    Joined:
    Apr 17, 2016
    Posts:
    1
    Hi Davit,

    I followed your steps to implement the shader but can't get it to work in my project. I've attached a pdf with the details. Just wondering for any help or advice.
     

    Attached Files:

  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    There are only two steps:
    1. Generate barycentric coordinates for mesh
    2. Use wireframe shader on mesh with barycentric coordinates

    What exactly does not work?



    VacuumShaders - Facebook Twitter YouTube
     
  25. gaiomed

    gaiomed

    Joined:
    May 5, 2013
    Posts:
    48
    Hi,

    I just bought your plugin and was wondering how I could use it in a multi pass rendering, so I have a displacement and tessellation before and then would like to apply your shader.
    I tried to combine the shaders in one file but it renders my test object twice once with displacement and tessellation and another with your solid wireframe...
    Any ideas how I could achive what I am looking for? How to pass along the displaced vertices?
    For Tessellation I use PBS Tessellation Pro Plugin.
    best,
    Robert
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Unfortunately tessellation shaders currently are not supported by Wireframe shader and I can not even give you any advice, need some research.



    VacuumShaders - Facebook Twitter YouTube
     
  27. davegirdy1

    davegirdy1

    Joined:
    Jun 13, 2015
    Posts:
    6
    I purchased the shader and immediatly ran into the "During generating barycentric coordinates mesh vertex count may increase and if it is more then 65.000 – conversion will fail." problem. Is there any workarounds for this? Thanks.
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Barycentric are generated per-vertex and all three vertices of triangle must have unique coordinates, if it is impossible generator splits vertex and increase vertex count.
    While generator does its best to minimize additional vertex count, sometimes it can not be done because of mesh vertex/triangle structure (how good generator handles optimization you can check in run-time example scene).
    Solution is mesh split, using custom editor script or some 3D application.



    VacuumShaders - Facebook Twitter YouTube
     
  29. davegirdy1

    davegirdy1

    Joined:
    Jun 13, 2015
    Posts:
    6
    Thanks for the response. I will split my mesh into smaller chunks before going Barycentric.
     
  30. davegirdy1

    davegirdy1

    Joined:
    Jun 13, 2015
    Posts:
    6
    Hi, is it possible to use the original vertex colors of the mesh when showing the wireframe? I attached a screen shot where the left side is original mesh, and right side is wireframed mesh... but the wireframe is using colors of the original mesh. So far I have only been able to get one color out when using Amazing Wireframe Shader. Thanks.
     

    Attached Files:

    • mesh.png
      mesh.png
      File size:
      630.5 KB
      Views:
      884
  31. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Wireframe is always one solid color and it can't use mesh vertex color.



    VacuumShaders - Facebook Twitter YouTube
     
  32. D-Coy

    D-Coy

    Joined:
    Jun 2, 2013
    Posts:
    16
    Hey Arkhivrag,
    Returned to my wireframe project to test V2 of your shader and just wanted to say that youve done a great job, very versatile and a worthy update.
    Cheers,

    Ed
     
    Arkhivrag likes this.
  33. heff

    heff

    Joined:
    Jan 3, 2014
    Posts:
    5
    downloaded the test version, but can't seem to get wireframes to appear on transparent meshes. I will need to fade in the wireframe by itself, then fade in the mesh as the wireframe disappears. Is this possible with the full version?
     
  34. Arkhivrag

    Arkhivrag

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



    VacuumShaders - Facebook Twitter YouTube
     
  35. KenGamesDevelopment

    KenGamesDevelopment

    Joined:
    Mar 15, 2016
    Posts:
    3
    Hi there, I have a bit of a problem... errr question. So, I currently have an app ready to roll-out, and I'm testing in on my local device (being a Windows Phone 8.1). On desktop, the wireframe renders just fine, however on my mobile device it renders a solid purplish (null?) color. Any tips on how I could fix this, or is my device just not supported? Thanks!
     
  36. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    First of all download and try free sample shader on your device, if it works then we will continue finding solution.



    VacuumShaders - Facebook Twitter YouTube
     
  37. KenGamesDevelopment

    KenGamesDevelopment

    Joined:
    Mar 15, 2016
    Posts:
    3
    Thanks, I just tested that sample shader, the troll example, and deployed it to my WindowsPhone. The model showed up completely solid purple, just like from my full version that I've been using to develop my app.
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    If free sample shader does not rendered on your device means that it does not support features required by shader.
    Same will do shaders from the full version.



    VacuumShaders - Facebook Twitter YouTube
     
  39. BizDevelopment

    BizDevelopment

    Joined:
    Jan 8, 2016
    Posts:
    2
    Hey, any way I can use this shader in a terrain? I have a interactive art project that needs this function =)
     
  40. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Thanks, will this Wireframe be sometime in the future be updated to be able to have edge detection and be able to hide internal triangles? It would be a really great and awesome thing if it would be possible because as far as I know there is no other asset that is able to make this.

    thanks
     
    kenshin likes this.
  41. AlterHaudegen

    AlterHaudegen

    Joined:
    Jul 8, 2013
    Posts:
    28
    Amazing asset! Quick question: How can I achieve a gradient effect with a dynamic mask?

    What I want:
    Screen Shot 2016-08-11 at 09.40.46.png

    What I get:
    Screen Shot 2016-08-11 at 09.41.08.png

    Or is this not done via dynamic mask? If not, texture alpha?
    Thanks for any advice.
     
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    No terrain, only meshes.
    May be convert terrain into mesh?



    VacuumShaders - Facebook Twitter YouTube
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Check Example_2 (Mask - Plane) BattleBus scene.



    VacuumShaders - Facebook Twitter YouTube
     
  44. AlterHaudegen

    AlterHaudegen

    Joined:
    Jul 8, 2013
    Posts:
    28
    Thank you for your reply. Looking at that scene and experimenting with it a lot, reading some of the shader code (I'm decidedly not a shader expert), I could not find a way to make the cutoff by the dynamic mask smooth (as in using a falloff/gradient). How was that achieved in the old bus demo?
     
  45. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Smooth gradient has been removed from v2.0
    It had some limitations, it was obstacle for Dynamic masking.


    VacuumShaders - Facebook Twitter YouTube
     
  46. AlterHaudegen

    AlterHaudegen

    Joined:
    Jul 8, 2013
    Posts:
    28
    I see. Is there a way to put them back in or add them to a future release? The hard cutoff just does not make for very compelling animations...

    Would it be possible to gain access to the old code as well?
     
  47. jamesbdh

    jamesbdh

    Joined:
    Sep 22, 2015
    Posts:
    7
    Hey, really liking the shaders so far, I'm looking to use something similar to the projector example but with the effect inversed so the projection reveals the texture on a wireframe environment. I know this is a bit more complicated, but any help would be great.
    Thanks.

    *Edit*

    I've managed to invert the effect by creating a new mask, is it possible to get the projector shader to show wireframe only?
     
    Last edited: Aug 15, 2016
  48. AlterHaudegen

    AlterHaudegen

    Joined:
    Jul 8, 2013
    Posts:
    28
    Another question if I may: Does anybody have any experience using this shader with HoloLens? Whenever I want to display the wireframe the whole mesh simply takes that color.
     
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    There is no old code, just what's in the Asset Store. Code (shader) is self is open and can be modified.

    Not tested on HoloLens, it's unclear what problem may be the there.



    VacuumShaders - Facebook Twitter YouTube
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Yes, it is possible.
    Wireframe is projected on existed mesh, which can be hidden by simple transparent or cutout shader.

    Note,
    If shader has tag "IgnoreProjector"="True" it will not receive projector's shader, remove that tag (built-in transparent and cutout shaders have that tag).

    Code (CSharp):
    1. Shader "Simple Transparent"
    2. {
    3.     SubShader
    4.     {
    5.         Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" }
    6.         LOD 100
    7.  
    8.         ZWrite Off ColorMask RGB
    9.  
    10.         Pass
    11.         {
    12.             Blend Zero One
    13.  
    14.             CGPROGRAM
    15.             #pragma vertex vert
    16.             #pragma fragment frag
    17.  
    18.             float4 vert(float4 vertex : POSITION) : SV_POSITION
    19.             {
    20.                 return mul(UNITY_MATRIX_MVP, vertex);
    21.             }
    22.  
    23.             fixed4 frag() : SV_Target
    24.             {
    25.                 return 0;
    26.             }
    27.  
    28.             ENDCG
    29.         }
    30.     }
    31. }

    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Aug 15, 2016