Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

► Wireframe shader - The Amazing Wireframe shader ◄

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

  1. nigel-moore

    nigel-moore

    Joined:
    Aug 28, 2012
    Posts:
    26
    Hi. Am trying to generate and use a wireframe texture using the Menu tools for an animated character. I have created the texture however I feel I must be having a bit of a 'senior' moment because I cannot for the life of me work out how to use this texture. I have manually put it in the wireframe texture slot but that doesn't work and I am now completely at a loss.

    There doesn't seem to be a supplied example that uses this approach and I am now completely stuck. Any help with this would be very very welcome.

    Thanks in advance.
     
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    It's just a texture.
    You can use it inside shader to avoid wireframe calculations.
    upload_2019-4-18_15-40-35.png

    Using this option you can provide your custom wireframe texture too.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  3. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    Any known issues with VR?

    Tried searching the forum but "VR" is too small of a search term.
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    No problems have been reported.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    maxaud likes this.
  5. hwinter_unity

    hwinter_unity

    Joined:
    Jan 26, 2018
    Posts:
    1
    Hello!

    Wondering why the baked barycentric coordinates rendering option is limited to 21,000. Is that because of the barycentric coordinates calculation? Or is that because of the shader itself? e.g. if I were to magically bake in barycentric coordinates in another fashion, would the shader work on a larger-than-21000 mesh?
     
  6. yassss

    yassss

    Joined:
    Jun 6, 2019
    Posts:
    2
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    It is not a limit or restriction. But mostly a suggestion. As barycentric coordinates are baked per-vertex and 3D models do not always have perfect vertex/triangle structure, sometimes it is necessary to increase vertex array and theoretically can be reached Unity's limit for mesh vertex buffer size.
    In run-time wireframe calculation it is better do not use meshes with more than 21.000
    In editor you can try bake barycentric coordinates into mesh with much more vertex count.

    And here comes Geometry shaders: No limit on vertex count, mesh types, no need to bake anything into mesh, support tessellation.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    You mean Bloom? It's just a post-processing effect.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  9. yassss

    yassss

    Joined:
    Jun 6, 2019
    Posts:
    2
    Sorry, my English is not good. I'm not familiar with shader. Where can I add post-processing effect? using unity's Post Processing Stack?
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    You can use Unity's Post Processing or any third party Bloom image effect.
    Wireframe emission is controlled by Emission Strength parameter.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    syscrusher likes this.
  11. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,030
    @Arkhivrag, I don't know where things stand for you supporting SRP with this superb asset, but I wanted to let you know that as of a couple of days ago I have a wireframe shader using barycentric coordinates working in HDRP.

    Just to reassure you, I have absolutely NO intention to compete with The Amazing Wireframe Shader. Your asset goes way, way beyond what I need from my custom shader; my wireframe shader just part of Magic Markers for visualizing the editor gizmos better. (IOW, I'm not making a "shader product", it just happens that my product includes one purpose-built shader with a wireframe as one of its options.)

    That being said, it was a challenge getting this to work in HDRP. I believe, but haven't yet tested, that my shader would also work in LWRP. If you're finding the SRP documentation to be as impenetrable as I have, drop me a private message and I'll gladly share a code snippet with you from my prototype. My SRP support is not release-ready yet, but the wireframe part is working.

    Thanks again for making TAWFS. My biggest "complaint" (joking here!!!) is that it does so much that every time I use it I lose a couple of hours just fooling around with its settings for fun. :)
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    LWRP was released as 'production ready' (no, it still not ready), just month ago and I've already updated 3 of my asset to support it: Advanced Dissolve, Curved World, Terrain To Mesh.
    Wireframe shader will support it too. Just busy with other assets updates.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    shyamarama, linojon and syscrusher like this.
  13. michelapt

    michelapt

    Joined:
    Apr 1, 2019
    Posts:
    2
    Hi. I'm running into a shader compilation failing when building for the Nintendo Switch:

     
  14. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Hidden/Internal-DepthNormalsTexture shader is used in post processing (image effects) for calculating depth normals for various shaders.
    It contains description of all render styles, including Tessellation shaders. Seems Nintendo Switch does not support tessellation.

    Solution: If you are not using post processing, just delete file from VacuumShaders/The Amazing Wireframe Shader/Shaders/Resources folder or remove tessellation related subshaders from that file (lines: 507-543 and 545-585).



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  15. michelapt

    michelapt

    Joined:
    Apr 1, 2019
    Posts:
    2
    @Arkhivrag

    Thanks for the swift reply. Worked perfectly!
     
  16. Coryatmarsden

    Coryatmarsden

    Joined:
    May 22, 2018
    Posts:
    7
    @Arkhivrag Would you happen to have a timetable for the release of LWRP support? Love your asset!
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    It is In development. Release date is unknown.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    Coryatmarsden likes this.
  18. sharkwithlasers

    sharkwithlasers

    Joined:
    Dec 8, 2012
    Posts:
    7
    Hi there! Loving the shader so far! However, I'm experiencing a screen flicker effect as the camera scrolls across the a wireframe quad mesh grid:



    Would anyone happen to know what causes this? I can provide some additional information if necessary as well.

    (The provided video has temporal antialiasing enabled. without antialiasing the effect is greater)
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Wireframe is rendered as line, yes. Antialiasing does not like lines.
    From shader side I can do nothing :(.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  20. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    326
    Guys, why I got these 2 errors on Android build? It doesn't break the build itself, but anyway...

    Code (CSharp):
    1. Shader error in 'Hidden/VacuumShaders/The Amazing Wireframe/Tessellation/ColorMask0': failed to open source file: '../cginc/CurvedWorld.cginc' at line 29 (on metal)
    2. Compiling Vertex program
    3. Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS
    4. UNITY_NO_CUBEMAP_ARRAY UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_DLDR_ENCODING
    and
    Code (CSharp):
    1. Shader error in 'Hidden/VacuumShaders/The Amazing Wireframe/Tessellation/ColorMask0': failed to open source file: '../cginc/Wireframe_Tessellation.cginc' at line 55 (on metal) Compiling Vertex program Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_DLDR_ENCODING
    I am on Unity 2019.1.8f1 and latest wireframes plugin
     
  21. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Seems tessellation is not supported on your device.
    Try: Delete Tessellation shaders folder (VacuumShaders\The Amazing Wireframe Shader\Shaders\Tessellation).



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  22. halvorss

    halvorss

    Joined:
    Mar 18, 2013
    Posts:
    10
    Question... can the wire Distance Fade be inverted? For positive values it's working fine... as I get closer it gets brighter and as I get further it fades out. However, I need the opposite to happen... I would like it to fade out as you get closer and get brighter as you back away. Thank you, this is a great tool.
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Check attached file. Copy included file it into VacuumShaders\The Amazing Wireframe Shader\Shaders\cginc folder.
    Distance fade effect now will be inverted on all shaders.



    Amazing Assets - YouTube Facebook Twitter
     

    Attached Files:

    Last edited: Mar 2, 2020
  24. halvorss

    halvorss

    Joined:
    Mar 18, 2013
    Posts:
    10
    Thank you! I had to update to the latest version from the Asset Store, but the changed Wireframe_Core file indeed inverted the Fade Distance as needed. I appreciate the quick response and assistance. You make an excellent product.
     
  25. tonywalsh

    tonywalsh

    Joined:
    Jun 4, 2014
    Posts:
    11
    fwiw +1 for LWRP/URP support, thanks!
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    URP - yes.
    LWRP - mostly no.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  27. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    URP is available only in Unity 2019.3, yes? And it is not released yet.
    I have to wait for its final release to know what kind of shader code I'll have to work with.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  28. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    416
    So, according to this if I understand right, there will be probably no support for LWRP but there will be URP support when it is available the official final release of Unity 2019.3?

    Sorry that I have no idea what is needed and how hard and difficult it may be to support and make it compatible with LWRP.

    Thanks
     
  29. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    LWRP is already dead, why waist time on its support.
    After releasing Unity 2019.3 I will add URP support.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    SpaceRay likes this.
  30. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    416
    You are right, Sorry I now know this thanks to you, I have just seen that is true that LWRP is going to be replaced by the URP, I was wrong thinking that URP would be a new format but it will replace the LWRP, so I agree with you that is not needed.

    Happy new year 2020. Wish you the best
     
  31. VirtualDawn

    VirtualDawn

    Joined:
    Sep 15, 2014
    Posts:
    15
    Are wireframe shaders still supposed to be curved world compatible out of the box? I've used these shaders before but now I'm not getting them to work together. I'm using 2018.4.13f1 with standard 3d pipeline.
    Any steps to get wireframe shaders to work with curved world? Or common mistakes that prevent wireframe shader from curving?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Check CurvedWorld.cginc file inside The Amazing Wireframe Shader\Shaders\cginc folder.
    Uncomment lines: 4, 7-9 and provide correct path to the CurvedWorld_Base.cginc file.
    Remove lines 12-15.
    After that re-import Wireframe shaders.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    shyamarama and VirtualDawn like this.
  33. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    416
    Hello, sorry that I am still trying to get this effect that you told me that it was not really a wireframe effect, and it was really edge detection instead, but in all this time I have not been able to find a possible solution to this shown here, and have not found any edge detection shader.

    It seems that there are now available some wireframe shaders that are able to do this BUT only for Direct X 11 and I am using MacOS so I can not use these as there is no Direct X in Mac

    Please, do you know any possible way that could be done this effect?

    Thanks very much for any possible help

    Best wishes

    Wireframe Shader diagonals.jpg
     
  34. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    416
    I have another thing, now I have Installed your wireframe asset in Unity 2019.3.0f6 and I get all these warning shown here and I do not know if this is because I am using MacOS Sierra 10.12.6 and the shader may be using Direct X

    For example

    Shader warning in 'Hidden/VacuumShaders/The Amazing Wireframe/Tessellation/Addative/ZWrite/Wire Only': Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

    Thanks for any possible help

    Best wishes Screen Shot 2020-02-10 at 10.26.18.png
     
  35. halvorss

    halvorss

    Joined:
    Mar 18, 2013
    Posts:
    10
    You can get sort of close to what you want with the "Try Quad" checkbox. It is limited to quad polygons so you will have at least a center dividing line on the < of the K, but it gets rid of all the other internal edges (assuming that they are internal/non-hardened edges on your original mesh and if exporting to FBX you have not checked the "triangulate" option). K.jpg
     
    syscrusher likes this.
  36. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Those shaders are using Tessellation and Geometry Shaders, if device does not support those them they will not compile. Warning inform you about that.
    Solution: Delete those shaders. They are in separate folder inside project.

    Those shaders are for high-end device and calculate wireframe directly inside shader.
    For mobile device, just bake wireframe data inside mesh and use other shaders, all of them have the same controllers and effects.

    As for edge detection effect, I have no ready solution for it yet.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    syscrusher likes this.
  37. francex2000

    francex2000

    Joined:
    Jun 17, 2016
    Posts:
    1
    Hi,
    i have a body object exported by CC3 in fbx format, with "BlendShapes" because i want animate the face.

    But when i generated the Wireframe with "GeometryShaders" and i used the new Mesh, the BlendShapes disappear. Why?

    Thank for the help.
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    If using Geometry or Tessellation shaders, nothing need to bake. Just use those shaders on original mesh.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
  39. VRising

    VRising

    Joined:
    Apr 15, 2016
    Posts:
    21
    Hi any updates on URP support? Would like to grab this asset when it's ready.
     
  40. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Currently updating Curved World and Advanced Dissolve assets. Then comes Wireframe shader.
    Update will include URP/HDRP shaders and integration into Unity Shader Graph and Amplify Shader Editor.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Mar 2, 2020
    VirtualDawn and Bartolomeus755 like this.
  41. VRising

    VRising

    Joined:
    Apr 15, 2016
    Posts:
    21
    Awesome thanks a lot!
     
  42. VRising

    VRising

    Joined:
    Apr 15, 2016
    Posts:
    21
    Also it seems like you are actively supporting your product so I may just get it early and start playing around with it. Do you have a rough timetable as to when the URP wireframe feature will be ready? If not no worries. Thanks again.
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Can not say exact day, but definitely do not expect update in March.



    Amazing Assets - YouTube Facebook Twitter
     
  44. LittleDreamerGames

    LittleDreamerGames

    Joined:
    Apr 9, 2017
    Posts:
    24
    Great asset! I bought this a few years ago when someone asked me if it was possible to render wire frames with Unity in-game. Fast forward to now and I might be using it in my game.

    I went through the barycentric process and created the mesh, but I'm not liking where it stores the mesh. Would it be possible to instead store it relative to the model it came from? For example:

    Assets\Models\Watermellon\Watermellon.fbx
    Assets\Models\Watermellon\Meshes\Watermellon.asset

    Or

    Assets\Models\Watermellon.fbx
    Assets\Models\Watermellon.assets\Watermellon.asset

    With this setup you can name the mesh whatever it's called inside the model. Right now you allow the user to name the mesh whatever they want -- I assume to avoid possible naming collisions should there be two models with the same name in the same project. But if you store meshes relative to the model in a sub folder, you can just save the mesh with the same name used in the model, and there would never be a naming collision.

    It's not a deal breaker or anything, but I think it's a better solution all around. Like mentioned, you'd avoid naming collisions, mesh(s) would live adjacent to the model it came from making it easier to package if need be, and overall it's cleaner.

    Thanks in advance!
     
    Arkhivrag likes this.
  45. VRising

    VRising

    Joined:
    Apr 15, 2016
    Posts:
    21
    It was me that asked haha. Thanks for your help so far. Your app will help our rhythm game!
     
    LittleDreamerGames likes this.
  46. unity_zOM_q2kqy8rZtQ

    unity_zOM_q2kqy8rZtQ

    Joined:
    Oct 30, 2017
    Posts:
    1
    Hi

    I've just purchased your asset:

    I'm trying to use for procedural meshes build in the magic leap (lumin os).

    I opened your doc , 'quick start', setup a new material with standard material adding the asset shaders (vacuumshader/theamazingwireframe/... ), without a render pipeline.

    The results are either a red or wireframe un-editable material.
    And when testing in magicleap hub / on device, the results below (blue).

    Thanks in advance
     

    Attached Files:

  47. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    What Unity version do you use? Just tested with 2019.3 and at my side no problems with material editor.

    Note: If target device supports Geometry and Tessellation shaders, there is no need to bake wireframe mesh. Just assign shader to a material and it will render wireframe.
    Mesh baking described in ReadMe file is necessary only for 'Mobile' device.

    Geometry and Tessellation shaders will mostly work in all editors, but when you build project for a device it may not have such support and wireframe will not be rendered. In this case bake wireframe mesh and use 'Mobile' shaders.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Apr 1, 2020
  48. studioaboveandbelow

    studioaboveandbelow

    Joined:
    Feb 19, 2020
    Posts:
    2
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,348
    Just tested with Unity 2019.3.6 and no problems or errors with Material editor at my side.
    Can you try Wireframe package in complete new/empty project. May be you have some scripts in project that conflict and cause problems with Material editor.

    upload_2020-4-2_21-30-43.png


    As for tessellation not working correctly on Lumin platform. Unfortunately I can not help here. Both Unity and your target device should support tessellation. Otherwise just use 'Mobile' shaders and bake wireframe mesh in run-time.



    Amazing Assets - YouTube Facebook Twitter
     
  50. studioaboveandbelow

    studioaboveandbelow

    Joined:
    Feb 19, 2020
    Posts:
    2
    Thanks

    Sweet, yes the Wireframe package shaders will work in a new lumin project.
    Just not in my current working project.

    Do you have recommendations for where/how scripts would conflict with the package?

    Best
     
unityunity