Search Unity

► Wireframe shader - The Amazing Wireframe shader ◄

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

  1. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,084
    I'm not able to get the mobile unlit (opaque and transparent both don't work) wireframe shader to work on mobile anymore on iOS / ARKit iOS 11

    [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles

    WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.

    WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
     
    Last edited: Jan 1, 2018
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Shaders you have mentioned are not part of the Wireframe shader and I can not help.
    Seems Unity bug.
    Are any VR features enabled in your project? Try turning them off (check Players Settings).



    VacuumShaders - Facebook Twitter YouTube
     
  3. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,084
    Cannot seem to get your shaders to show up on Unity 2017.3.0f3 when built to iOS latest with ARKit (shows up ok in editor though...)
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Problem may be due to Unity built-in shaders you've mentioned.
    Some fixes will be available for 'Hidden/BlitToDepth_MSAA' in future Unity release (973636)

    Did you try free sample shaders? Do they have the same problem?
    Which shader do you use (Unlit, Standard, Geometry...)? Not all shaders are mobile compatible.



    VacuumShaders - Facebook Twitter YouTube
     
  5. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,084
    I'm tryin
    Trying just your Mobile unlit
     
  6. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    We'd like to get the quad topology used by the wireframe rendering because we have plans to do some things with it in our game. We'd also like to add some explicit code for quad-handling (because the basic parameters provided in the popup don't meet our needs.)

    Unfortunately, this isn't possible becuause the code for the barycentric baking is all embedded in a DLL - a fact that I feel assetStore listings should always call attention to when they're not providing full source.

    Is full source available as without it I think we'll have to write our special-quad-aware own barycentric baking anyway.
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    API source code is not available, only shaders.



    VacuumShaders - Facebook Twitter YouTube
     
  8. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
     
  9. StridBR

    StridBR

    Joined:
    May 17, 2016
    Posts:
    2
    Hello, I just tried the free version and would like to know how is the support for non-triangle polygons? I notice that in the first video (quad wireframe & global illumination) that it's possible to have quads rendered without subdividing it in triangles, but I wonder if it's something that would need changes in the mesh, or some kind of a boolean property that detects quads automatically?

    I hope my question makes sense, sorry for my ignorance on 3D.
     
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    There are two methods for quad wireframe rendering:
    1) With baked barycentric coordinates - meshes only with 21,000 triangles can be used.
    2) Render quads with included Geometry Shaders. No data baking is requred, shader will just render quads.

    Note, in the both cases quads rendering is highly dependent on mesh vertex/triangles layout and is not 100% guaranteed.

    I've updated test shaders package with quad wireframe examples.



    VacuumShaders - Facebook Twitter YouTube
     
  11. StridBR

    StridBR

    Joined:
    May 17, 2016
    Posts:
    2
    Thanks for the lightspeed feedback and updated test package! Will check it as soon as I get home!
     
  12. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Hi! Just purchased this asset. Thanks very much. I have 2 questions and pardon me if they've been answered before. I searched this thread and didn't see an answer.

    1. I have over 1000 meshes in my mobile project (Alamo Reality). Do I have to select each and every mesh and select the gear icon in the mat'l and select "Generate Wireframe Mesh?" Ouch. Is there any way to batch process any of this?
    2. What is the easiest way on mobile to fade from wireframe to fully textured object? Do I need 2 different prefabs: A-wireframe and A-textures and use a gradient script of some sort to dissolve one into the other? Is this really heavy for mobile (iPhone 6s and above)?
    3. What exactly are the Temporary meshes? Are they duplicates of the existing meshes and if so am I actually duplicating the number of vertices in my scene if I do the above dissolve?
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    1. Unity main menu Window > VacuumShaders > Wireframe Generator.
    2. No additional prefab or material, wireframe can be easily faded by Color parameter's (alpha value) inside.
    upload_2018-1-26_11-50-27.png

    3. Temporary folder is used by wireframe generator to save mesh asset files. You have to move those meshes to your desired project folder or they can be overwritten by another mesh file. Generated meshes have increased vertex count.



    VacuumShaders - Facebook Twitter YouTube
     
  14. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Thanks! I look forward to trying this out.
     
  15. Thibaud_SERRE

    Thibaud_SERRE

    Joined:
    Jun 15, 2017
    Posts:
    4
    Hi everyone !
    First of all, thank you @Arkhivrag for this amazing asset, my game made a huge step up thanks to your shaders !
    I wanted to know if anyone here know if it is possible for the wireframe to be more "selective".

    The exact effect I wanted to achieve is an emissive edge only on the "hard" edge of the model. For exemple the circle on top of a cylinder but not the triangle inside. Something to choose the angle when the shader start to consider the edge "hard" or not would be perfect.

    I'm trying to modify the Mobile/One Directionnal Light to fit my need but I'm not much of a shader guy.

    The Wireframe (barycentric coordintes) baking seems to offer some option of angle and normals but changing the different value does not seem to change anything on the wireframe of the model, any info on that would be a pleasure.

    Anyway thank you again for this great asset, definitely a must have ! :)
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Mesh wireframe can be rendered only as Triangles or Quads, no hard edges.



    VacuumShaders - Facebook Twitter YouTube
     
  17. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Hi, I'm trying to export as a package to handoff ot our dev to include in final build and when it comes in the final build it shows all purple. The shader is the correct shader. How to I make sure this works? Will this build properly if the package is not "portable?"

    See images below:
    Here is in one Project:




    And here's when imported into a different project:


    Please help :)
     
  18. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    BTW, I did make a video of my workflow for this at:
     
  19. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Shader in the final build and/or target device may not be supported. In this case make sure the Fallback shader is included in the build too.
    Check fallback shader inside .shader file on the last line. Add it to Always Included Shaders of Graphics Settings.



    VacuumShaders - Facebook Twitter YouTube
     
  20. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    I don't really understand. I'll forward this message to the developer with hopes he does understand.

    Why would other shaders work in packages and this one doesn't? Seems like you should mention this on your product page as it creates lots of problems for non-programmers.
     
  21. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    Hi @Arkhivrag, I just bought this, it looks great. I'm hoping you can help me, please excuse my lack of shader knowledge. I'm trying to edit Wireframe_Unlit.cginc to get the wire color to change with facing ratio (fresnel), however if I try to set retColor is does it for the whole mesh not just the wire part. I can't see where _V_WIRE_Color is brought in. Can you tell me what I'm missing?
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Fallback is not Wireframe Shader or "programmers" related thing, but just Unity engine feature you need to know. It is to guarantee that mesh still will be rendered even hardware can not handle prime shader.


    I can not tell what you are missing, but try to change _V_WIRE_Color.rgb value just before DoWire (line 309).



    VacuumShaders - Facebook Twitter YouTube
     
  23. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    I just purchased this on the asset store web site, but got a 404 when trying to download it from the store.
     
  24. Arkhivrag

    Arkhivrag

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

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    Is there any way to bring in a mesh with my own barycentric coordinates? For example if I wrote a per vertex attribute into the fbx from Houdini.
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Barycentric coordinates are encrypted before saving inside UV0 buffer and then decrypted inside shader. It is done for optimization purposes. UV0 buffer is the meshe's main UV buffer but needs to be float4 instead of standard float2.
    You will have to write custom script with the same encryption algorithm for Houdini.



    VacuumShaders - Facebook Twitter YouTube
     
  27. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    And what is that encryption algorithm?
    FYI I'm trying to get a perfect quad wireframe with no triangles.
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    If perfect quad has 4 vertices and 2 triangles.
    X and Y are original texture coordinates. You have to write Z and W coordinate values.
    upload_2018-2-15_15-39-32.png

    If quad has 6 vertices and 2 triangles
    upload_2018-2-15_15-49-12.png



    VacuumShaders - Facebook Twitter YouTube
     
  29. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Hi Arkhivrag,

    A couple weeks ago I purchased your Amazing Wireframe Shader. I'm building a mobile app. We're using the asset builder to create modules which we download from an S3 Cloud server. I'm having much difficult getting the shader to work in a package export which I will need to be able to do to generate the correct asset bundles for this project.

    Here is my prefab:


    I've used the shader:
    Vacuum Shaders/The Amazing Wireframe/Mobile/Unlit/Transparent/Simple/Wire Only
    and these are the settings:



    When I export a package with the models that use the shader:
    I see the wireframe meshes and the shader are included in the export:




    I create a new project and IMPORT PACKAGE:


    This is the exact same list as you can see above. This is the result. There is no wireframe shown.



    Here are the settings for the shader in this project. As you can see they look nothing like the above settings.



    My Developer has told me there is nothing he knows to do to fix this. There is no fallback shader as this needs to be the shader we use for mobile. There are 100's of meshes with this wireframe setting on it. We go to final beta in 48 hours and I need to figure out a fix. I am happy to pay you $$ to help us resolve this issue. Please let me know.
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    You are missing .cginc files. Without them shaders will not compile and Unity will render mesh in magenta color.

    Unity prints errors inside Console window which .cginc files are missing and why shader is not compiled (if there are other errors). Include those .cginc files into package or send them separately.

    Check folder Assets\VacuumShaders\The Amazing Wireframe Shader\Shaders\cginc.

    Mobile/Unlit/Transparent/Simple/Wire Only shader uses Wireframe_Unlit.cginc file.



    VacuumShaders - Facebook Twitter YouTube
     
  31. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Thanks! Turns out I also needed:
    Assets\VacuumShaders\The Amazing Wireframe Shader\Shaders\cginc\Wireframe_Core.cginc

    Works now. Is there a reason Unity doesn't see these files as dependencies of the scene?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    It is Unity's known bug: 685617 and 796891



    VacuumShaders - Facebook Twitter YouTube
     
  33. Substance

    Substance

    Joined:
    Jun 6, 2013
    Posts:
    4
    Hi! I'm a beginner with shaders and was wondering if it's possible to accomplish a certain effect. I'd like the wireframe to be hidden by light instead of illuminated, if that makes sense. So that the wireframe only shows up in darkness. I'm using the "standard" shader and deferred rendering.
     
  34. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Such effect is not implemented. But worth to add in the future updates.



    VacuumShaders - Facebook Twitter YouTube
     
  35. ytrew

    ytrew

    Joined:
    Feb 22, 2013
    Posts:
    20
    :eek:

    So just tried to build standalone for Windows and get several errors (see below). I have not modify or otherwise change any Shader code. I'm running on 2017.3.1f1. any assistance would be greatly appreciated!

    Capture.PNG
     
  36. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    There definitely is no (and shouldn't be) UNITY_sample_TEX2D.
    Did you update project from previous Unity version?
    Completely remove plugins from the project, clear Asset Store catch folder and redownload asset.



    VacuumShaders - Facebook Twitter YouTube
     
  37. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,084
    It seems when rendering screenshots Application.CaptureScreenshot at 4x resolution, the wireframes become blurry? Is there a way to keep them crisp?
     
  38. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Do you use any post processing? Do not think problem is in the wireframe shader.



    VacuumShaders - Facebook Twitter YouTube
     
  39. chanelluu

    chanelluu

    Joined:
    Jan 28, 2018
    Posts:
    1
    Hello! I ran into these errors with Unity 2018.1.0f2. Do you have any idea what the cause might be?

    Screen Shot 2018-05-07 at 10.23.24 PM.png
     
  40. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Fixed. Download new version using Unity 2018.1.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: May 8, 2018
  41. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Vertex colours are interpreted as RGB only and don't support modulating vertex alpha (i.e. you can't set the material colour to opaque white then use vertex colours to completely control RGBA plus how opaque the section of wire is.)

    We're using Unlit/Transparent Simple Wire, so thought that simply changing line 203 of Wireframe_Unlit.cginc from

    - retColor.rgb *= lerp(1, i.vColor.rgb, _V_WIRE_VertexColor);

    to

    + retColor.rgba *= lerp(1, i.vColor.rgba, _V_WIRE_VertexColor);

    would be sufficient, but that didn't seem to work (even accounting for the usual Unity cginc issues madness where you constantly think "am I sure my shader recompiled?")

    Is there any way to get vertex alpha to modulate the material alpha, at least for the case of unlit, untextured wireframe-only?
     
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    In the Wireframe_Unlit.cginc file at the very end just before:
    Code (CSharp):
    1. return retColor;
    add
    Code (CSharp):
    1. retColor.a = i.vColor.a;
    or (for only transparent shaders to be effected)
    Code (CSharp):
    1. #ifdef V_WIRE_TRANSPARENT
    2.     retColor.a = i.vColor.a;
    3. #endif


    VacuumShaders - Facebook Twitter YouTube
     
  43. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    I think you meant *= not = (otherwise you get semitransparent triangles, not wires), but that works great. Thanks.
     
  44. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    Do the geometry shaders work for mobile (ios)?
     
  45. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    UPDATE: The geometry ones do not work on ios, but I accomplished what I needed by using the physical one and just recreating the mesh every few frames. Good example of this in the package under example 5.
     
  46. L-W

    L-W

    Joined:
    Mar 3, 2013
    Posts:
    20
    Hello! I've tried your free shader, and your example scenes/meshes work just fine, but when I try to apply your unlit wireframe shader to any of my meshes, it just colours them, like so: https://gyazo.com/93ada86a983b5620cc403db5052ee18c

    It's the same no matter what mesh I put it on, only the meshes supplied in your free .unitypackage work, is there anything I need to do to ensure your shaders will work on my .blend meshes? Do I need to convert them to .fbx?

    EDIT: Oops! Only just realized that I can't try it out on my own meshes and that I have to purchase it to allow conversion of meshes into wireframe-friendly ones, ignore!
     
    Last edited: Jun 23, 2018
  47. Substance

    Substance

    Joined:
    Jun 6, 2013
    Posts:
    4
    In need of a quick tweak to wireframe generator mesh naming!

    I have gameobjects with identically named meshes, which the generator doesn't take into account and just overwrites the previous mesh file. Since the generator is a dll, I can't fix this myself. This seems like a really easy fix by just adding the gameobject name together with the mesh name.

    I could write some kind of separate name fixer myself but I need the generator to make a lot of meshes in bulk, which makes the overwrites unavoidable. And making all the mesh names different would feel like the wrong way of doing things.
     
  48. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    It there any way to make the quad generation more robust? I've tried to make my quads as square as possible (that seems to affect things) but I'm getting quite a lot of triangles/diagonal quads.
     
  49. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,978
    Unfortunately no.
    You can try importing mesh with flat normals, it may improve quad detection.



    VacuumShaders - Facebook Twitter YouTube
     
  50. Rikrok

    Rikrok

    Joined:
    Apr 11, 2013
    Posts:
    50
    I've found fog isn't working on mobile on the physically based shaders (works ok with the mobile shaders but I want those nice speculars). Can this be fixed?