Search Unity

[FREE][OPEN-SOURCE] Generic Wireframe Shaders

Discussion in 'Assets and Asset Store' started by chasepettit, Jun 2, 2017.

  1. chasepettit

    chasepettit

    Joined:
    Oct 23, 2012
    Posts:
    42


    GitHub Repo: https://github.com/Chaser324/unity-wireframe

    This is a set of general purpose wireframe shaders adapted from Unity's built-in SpatialMappingWireframe shader. The set currently includes opaque, transparent (no culling) and transparent (backface culling) variations.

    They're nothing too special or elaborate, but they are a free and open-source option if you're looking to try out an aesthetic without having to write your own shaders or spring for a premium asset.

    All code contributions are welcome: bug/feature requests, forks, pull requests, etc.
     
    Last edited: Jun 2, 2017
    Ni2Be, X28, A_Savvidis and 9 others like this.
  2. artfail

    artfail

    Joined:
    Apr 18, 2017
    Posts:
    34
    First, thanks for putting this out there. I love this look. Do you have any plans to extend support to mac or ios?
     
    Last edited: Jun 23, 2017
  3. chasepettit

    chasepettit

    Joined:
    Oct 23, 2012
    Posts:
    42
    In my brief testing with OpenGL platforms (OSX, Linux), it seemed to already be working. Are you having issues with it?

    I haven't tried it out on iOS, but I wouldn't be surprised to hear there are issues. Adapting these shaders to play well with mobile might take some considerable refactoring.
     
  4. artfail

    artfail

    Joined:
    Apr 18, 2017
    Posts:
    34
    Thanks for the reply. I did some tests. So this does work on the mac os x86 build but not x86_64 or Universal. I wasn't building to x86 before. Im pretty happy I know how to make it work on a mac build now.

    When I do an ios build I get this error in xcode:

    WARNING: Shader Unsupported: 'SuperSystems/Wireframe' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'SuperSystems/Wireframe' - Setting to default shader.

    I hope this helps. Id it openGL based? Ive been googling to see if there are some build settings I can change but I am not seeing anything. If you do decide to go mobile with this shader that would be amazing.
     
  5. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Won't work on iOS, because metal and OpenGL ES 3.0 only support rendertarget 3.5 and geometry shaders are introduced with target 4.0.

    Source
     
  6. chasepettit

    chasepettit

    Joined:
    Oct 23, 2012
    Posts:
    42
    Update:
    • Added image effect. Add the "WireframeImageEffect" component to a camera and it will use replacement shaders to display all opaque objects as a wireframe.
    • Added example scenes.
     
  7. dmitriy-untilov

    dmitriy-untilov

    Joined:
    Apr 5, 2016
    Posts:
    3
    Hi, nice work, thanks!
    Does this shader works on WebGL?
     
    Nastomeya likes this.
  8. Kadaj

    Kadaj

    Joined:
    Jul 24, 2014
    Posts:
    19
    First, thanks chasepettit for sharing your shaders! They seems amazing!

    Unfortunately, there seems to be a problem with the compilation of these shaders (my current version of Unity : 5.6.1f1) and they're displayed pink...

    The error in the inspector when I click on one of the shaders: "Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)".

    I trying to build for Android. Any idea?
     
  9. dmitriy-untilov

    dmitriy-untilov

    Joined:
    Apr 5, 2016
    Posts:
    3
    I had the same problem when i was importing shaders to my project.
    Solution: Close project, delete Library folder and open Project. Shaders will be working in editor.

    But when i build project to WebGL they became pink again.
    Also i tried to add shaders to "Always included shaders" in Edit->Project settings window. But it did not work.
     
    Nastomeya likes this.
  10. Kadaj

    Kadaj

    Joined:
    Jul 24, 2014
    Posts:
    19
    Thanks for your answer, but it doesn't work. When I deleted the Library folder, the Project has switched to PC, Mac, Linux platform and on this platform, the shaders works fine. But, when I switch to Android platform, the material is displayed again in pink.
     
  11. chasepettit

    chasepettit

    Joined:
    Oct 23, 2012
    Posts:
    42
    Sorry, but I don't think Android supports the minimum shader model required for this shader to work (which I think is Shader Model 4.0). Unfortunately, I don't think there's a way to easily do a shader like this on a lower Shader Model because you really do need to be able to access geometry data for this to work.

    I'll verify this and make a note in the OP and on GitHub to avoid further confusion.
     
  12. Kadaj

    Kadaj

    Joined:
    Jul 24, 2014
    Posts:
    19
    Finally, I've built the project and, to my surprise... works fine on my two Android devices (Google Pixel C and Samsung S6)!

    But, the shaders continue to appear in pink in the Unity editor. It's strange... I'm afraid it doesn't work on some devices maybe less recent.

    Thanks :)
     
  13. Manuss

    Manuss

    Joined:
    Apr 3, 2018
    Posts:
    1
    I love theses shaders ! Thanks

    Did you succeed to do it work on WebGL ? I still have the pink ..
    Thanks
     
  14. j2013584

    j2013584

    Joined:
    Jan 9, 2016
    Posts:
    3
    These are great, thank you.

    I can't seem to get the flat (nontransparent) ones to work on terrain though :( - you can always see terrain through the gaps. Can we get a version that fills up the faces? (but where the wire is still derived from an image
     
  15. AlanGrant

    AlanGrant

    Joined:
    Aug 27, 2016
    Posts:
    97
    Hi
    Any chance you have some mobile ready version of this shaders?

    Free copy of my Asset GoMap in return XD
    Bye
    Alan
     
  16. TechLevel

    TechLevel

    Joined:
    Aug 20, 2016
    Posts:
    7
    Amazing shader, work easy and perfect on 2018.3
     
  17. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    Hey, love the shader, and I've been using it to great effect in my game, but I've noticed something odd about it- it won't render certain faces (see attached image). At first I thought it was because these faces were quads, but the issue persists even after triangulating them in blender. Any idea why this could be happening? As you can see below, the body of the submarine is missing in the wireframe version. It seems to have some issue either with aspect ratio, or it keeps thinking the faces are quads, even after making them tris.
     
  18. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    Never mind- after being vexed by this issue for months, I found the the problem was I had max tri size set too low, roughly 5 minutes after posting. Wow do I feel like dope.
     
    CheilGermany-FFM likes this.
  19. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Try with Unity 2020.3.26 on iOS (metal) and doesn't work
     
  20. A_Savvidis

    A_Savvidis

    Joined:
    Jul 21, 2016
    Posts:
    98
    @Fangh did you remember to select "No Emulation"? That's what I had to do in 2018.4 to make it work
     
  21. lquenti1

    lquenti1

    Joined:
    Jun 15, 2022
    Posts:
    1
    I am currently trying to get it running on the Quest 2 with single pass instanciation. Did anyone of you manage to do it?