Search Unity

► Wireframe shader - The Amazing Wireframe shader ◄

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

  1. megapode

    megapode

    Joined:
    May 4, 2021
    Posts:
    10
    so that works as long as I only have 1 plane in the scene. I need to have this effect running on multiple groups but the wipe is at different speeds. The dissolve is working correctly with 2 planes moving at different speeds. However, wireframe wipe only seems to correspond to one of the planes, even though they have been set in the scripts and materials as plane1 and plane2 correctly...

    Which is all part of how shaders work... they are both adjusting the same keyword parameter... I need 2 shaders if I have 2 planes - study and learn...

    back to the drawing board for a bit... :D
     
    Last edited: Nov 8, 2021
  2. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Do not modify included script, changes will affect other scenes and materials. Instead, invert plane mask from ShaderGraph - Plane (Mask) node has invert property, use value of 1 there.



    Amazing Assets - YouTube Facebook Twitter
     
  3. megapode

    megapode

    Joined:
    May 4, 2021
    Posts:
    10
    thanks and this is the difference between knowing how it works and hacking a solution :D
    I will revert the script to what it should be and try and understand the actual shader graph to make it work correctly.
    I will then explore further on the proper way to have more than one plane causing the wipe effect... It is something to do with the variable names, I can see that... Can I create a second instance of the effect and have a different variable name in the shadergraph? I think it is the .cginc script in reality?
     
  4. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    You can create as many materials as you need, each one with its own mask. Just update those masks and materials using separate MaksController scripts.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Nov 9, 2021
  5. megapode

    megapode

    Joined:
    May 4, 2021
    Posts:
    10
    Screenshot 2021-11-09 164525.png thanks for the swift response Arkhivrag, but I think I must be doing something silly then...

    I have 2 different materials and 2 different plane masks. I have 2 different mask controller scripts but because they both have the same line:

    materials.SetVector("_WireframeShaderMaskPlanePosition", maskObject.position);

    then the plane is set the same on both of them even though Plane1 and Plane2 move at different speeds...

    As you can see, the dissolve effect is correctly following the Plane location but the Wireframe is following the right side plane, even though the left wireframe controller is set to plane2 and the right one to plane1

    Do I need to set up the above variable as something like WireframeShaderMaskPlane1Position and then in the other shader/material I would set up a WireframeShaderMaskPlane2Position?

    sorry for the silly questions but also thanks for all the help!
     
    Last edited: Nov 9, 2021
  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    I have just re-checked shaders and it is definitely not possible to update multiple wireframe masks. Only one mask works.
    Something has been changed inside ShaderGraph (or rendering core files) since creating wireframe nodes for it and I need to re-write them.

    [Edit]
    Problem is in SRP, built-in RP works without problems.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Nov 9, 2021
    megapode likes this.
  7. megapode

    megapode

    Joined:
    May 4, 2021
    Posts:
    10
    Once again, thank you for the help. Glad to know that it is not just me doing something wrong :D Think I have a long winter ahead of me trying to understand the whole shader graph stuff!
     
  8. VeryBadPenny

    VeryBadPenny

    Joined:
    Jun 3, 2018
    Posts:
    40
    Hi - I have a very nice wireframe object (thank you Davit for this great set of assets!).

    I am using Standard (Wire Only With GI) shader.

    I would like to vary the Wireframe Thickness at run time in a simple script; is this possible and is there an example maybe? I have a feeling it might not be possible in a simple C# script... but always worth asking...

    Thanks in advance!
     
  9. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Use Material.SetFloat().
    Name of thickness property is _WireframeShader_Thickness



    Amazing Assets - YouTube Facebook Twitter
     
  10. VeryBadPenny

    VeryBadPenny

    Joined:
    Jun 3, 2018
    Posts:
    40
    Still needs some tweaking but very cool, thanks for the simple & fast reply!

    TigerDeployment.gif
     
  11. ashwinoccupiedvr

    ashwinoccupiedvr

    Joined:
    Sep 16, 2021
    Posts:
    5
    Hello, I'm not able to generate a wireframe mesh using the mesh generator window. When I hit the run buttton, I get a prefab with the standard (cutout wire) shader and no matter which settings I change, it does not show up (object on the right in the image attached). Could you please tell me how to fix this?

    Engine: 2020.3.22f1
    HDRP: 10.7
     

    Attached Files:

    • fav.png
      fav.png
      File size:
      221.1 KB
      Views:
      260
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Standard (cutout wire) shader requires diffuse texture with alpha channel to render wireframe in the place of dissolved(cutout) pixels. Assign diffuse texture to the generated material or use other shader.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Nov 25, 2021
  13. ashwinoccupiedvr

    ashwinoccupiedvr

    Joined:
    Sep 16, 2021
    Posts:
    5
    I've tried all shaders in the pack and they only show a base color and no wireframe unfortunately
     
  14. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Is problem with that particular model, or with others too? Are there any errors or warnings in the Console window?



    Amazing Assets - YouTube Facebook Twitter
     
  15. ashwinoccupiedvr

    ashwinoccupiedvr

    Joined:
    Sep 16, 2021
    Posts:
    5
    No warnings or errors. Tried with custom assets and Unity primitives
     
  16. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Do included example scenes work?
    What about 6. Runtime example scene?



    Amazing Assets - YouTube Facebook Twitter
     
  17. ashwinoccupiedvr

    ashwinoccupiedvr

    Joined:
    Sep 16, 2021
    Posts:
    5
    They work fine in the example scenes as long as I don't touch any parameter in the materials. As soon as I change one of those, the wireframe disappears.

    Some shaders have a floating point division by zero error but the ones that do not still suffer from this issue
     
    Last edited: Nov 27, 2021
  18. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    It is very strange behavior.
    Contact me on the support email (support@amazingassets.world) with asset purchase invoice and will continue discussion there.



    Amazing Assets - YouTube Facebook Twitter
     
  19. sachithkp

    sachithkp

    Joined:
    Jun 7, 2021
    Posts:
    12
    I was using the Wireframe Shader in one of our projects. We are using Curvy Worl Asset also.

    When we take the WebGL output after making necessary changes inside Wireframe Shader to make it compatible with Curvy World a pink color is shown up.

    Could you please let us know how to tweak this?
     
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Was wireframe shader working in WebGL before you modified it?



    Amazing Assets - YouTube Facebook Twitter
     
  21. Wintermute-

    Wintermute-

    Joined:
    Sep 5, 2017
    Posts:
    56
    Hello,

    I ran into a problem with Wireframe Shader in HDRP using Unity 2021.2.7f1 in the sample scene the wireframe is not visible. I reimported the shader folders and also tried to save the shader again in shader graph, but it is still not appearing. I am using HDRP 12.1.2

    Could it be because of the HDRP version? I can move the project version back if necessary.
     

    Attached Files:

  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Wireframe shader has not been updated for Unity 2021.2 yet, but it looks like ShaderGraph has lost Dynamic Mask property there after updating. Try, open shader and enable Exposed checkbox:
    upload_2022-1-6_14-35-26.png

    Save shader and inside material editor re-select Dynamic Mask keyword to be None.



    For any additional problems in unsupported Unity versions: Make sure wireframe is visible to a shader, check UV3 channel (here is saved wireframe data)
    upload_2022-1-6_14-42-3.png
    If mesh is rendered as in the image above, it means that mesh generator is working correctly and wireframe data is saved inside mesh.
    Now replace UV node with wireframe node (Create Node -> Amazing Assets -> Wireframe Shader -> Read Wireframe).
    Shader should render wireframe.
    upload_2022-1-6_14-42-45.png



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Jan 6, 2022
    Wintermute- likes this.
  23. sansari64

    sansari64

    Joined:
    Feb 15, 2014
    Posts:
    4
    Hi there @Arkhivrag

    Just using the shader pack in a Unity project and I'd like to programmatically change the color. I've done this using materialpropertyblocks in other shaders but I can't get it to work for The Amazing Wireframe/Mobile/One Directional Light/Addative/Simple/Wire Only

    The inspector looks like this:

    upload_2022-2-7_19-2-19.png

    and I want to change the "Color" which is currently blue to something else. I'm using this code:

    Code (CSharp):
    1.            
    2. props = new MaterialPropertyBlock();
    3. Color newColor = Color.red;
    4. newColor.a = 1;
    5. props.SetColor("Color", newColor);
    6. renderer.SetPropertyBlock(props);
    7.  
    but it doesn't do anything, can you or anyone else suggest a way to do this?

    Cheers
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Wireframe color property name inside shader is _Wireframe_Color
    Material property blocks may not work as they are not implemented. In this case you have to integrate wireframe effect manually inside any hand written shader or Amplify Shader, all info in manual file page 13.



    Amazing Assets - YouTube Facebook Twitter
     
  25. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    hello.
    The store page says
    • Mobile, console and VR ready
    But the documentation says :
    • for the runtime shader you need geometry shaders to be compatible.
    But Metal for iOS doesn't support geometry shaders. So the runtime version doesnot work for iOS ?
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Package includes collection of geometry shaders that calculate and render wireframe directly from shader. Those shaders do not need anything to be baked inside a mesh, but require device with geometry shaders support.
    Those shaders are free addon for built-in RP and are not mentioned on the store page.

    Main shaders do require wireframe to be baked inside a mesh (as written on the store page). Those shaders work on any device, have no any requirements or limitations and can be integrated into ShaderGraph and Amplify Shader Editor.
    So if you are targeting iOS, bake wireframe inside a mesh and use 'non geometry shader'.



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: Apr 5, 2022
  27. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Thank you for the clarification. But I needed it at runtime for ARMeshing. I will find another solution. Thank you.
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
  29. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    Hello, I'm having an issue with Curved 2020 and Amazing Wireframe shader. In essence, separately they both work great, but together I can't bend, twist or turn the wireframes.

    I might be wrong, but a while back this used to be a seamless operation, right? What am I missing?

    As for steps, I'm just changing a shader on the Curved 2020 examples to Amazing Wireframe--> Mobile--> Unlit. After this change, any objects that have it applied will no longer do any of the Curved modifications.

    Can anyone advise on this? Thanks!
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Did you activate Wireframe shaders from Curved World editor window -> Activate?



    Amazing Assets - YouTube Facebook Twitter
     
  31. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    Hello, I'm having an issue wit
    I think so, I used the activate tool targeting the Assets folder (where Wireframe is) and it said a bunch of files where activated. However the shader still didn't work.

    So, is it supposed to work out-of-the-box, correct?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    And which Unity version are you using?

    Do you have enabled proper Bend Type and Bend ID inside material editor of that wireframe shader?



    Amazing Assets - YouTube Facebook Twitter
     
    Last edited: May 4, 2022
  33. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    Hello, I'm having an issue wit
    I'm using Unity 2021.3 and I don't recall having the Bend Type and Bend ID options on the wireframe shaders, but I'll check again.
     
  34. Digimaster

    Digimaster

    Joined:
    Aug 8, 2017
    Posts:
    7
    But unfortunately it has limitations: "Those shaders require device with Shader Model 5.0 and GeometryShaders support. Currently dynamic wireframe rendering is supported only by Built-in render pipeline." (Manual of the wireframe shader package)
     
  35. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Run-time generated and baked wireframe does not need SM5 and has no limitations. It works on any device.
     
    Last edited: Aug 6, 2022
  36. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    Does this wireframe plugin work on webgl1? What about webgl2? Does it work on Safari(iOS) and Chrome(android) without issues?
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    All devices are supported.
    WebGL example: https://arkhivrag.itch.io/wireframe-shader
     
  38. ChrisHandzlik

    ChrisHandzlik

    Joined:
    Dec 2, 2016
    Posts:
    205
    Hi,

    Were there any performance tests done in Quest 2 to determine max supported triangle count for 72 FPS?

    I've got a fairly simple model with 5-10k triangles and want to use the shader there but it needs to run on Quest 2 and leave space for other shader effects as well. With data being baked in to mesh I can imagine it's quite speedy and shouldn't pose much of a problem with those parameters in mind?

    Also are there any gotchas specifically for quest/mobile rendering?

    Thanks,
    Chris
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    No problems on mobiles since 2014 (link)
     
  40. ChrisHandzlik

    ChrisHandzlik

    Joined:
    Dec 2, 2016
    Posts:
    205
    Works great, thanks
     
  41. Digimaster

    Digimaster

    Joined:
    Aug 8, 2017
    Posts:
    7
    So you are saying that the statement from the Wireframe Shader manual is incorrect? The manual version I have is from 2021, I guess it is still the latest. Did you improve the dynamic wireframe shader? So would it work with URP on a mobile Android device? How fast is the dynamic wireframe shader on mobile devices compared to WebGL? Can you give me performance benchmarks based on the example you upload before:

    https://arkhivrag.itch.io/wireframe-shader
     
  42. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Manual is correct.
    If you generate wireframe and bake it inside a mesh, then you use common shaders that work on any device without limitations.

    However, if you are using built-in render pipeline and target device with GeometryShaders support, then you can use Dynamic shaders, that do not need wireframe generating and baking it inside a mesh.
     
  43. avonamal658

    avonamal658

    Joined:
    Aug 3, 2018
    Posts:
    9
    Hello Arkhivrag,
    It is me again, I got your wonderful shader two years ago and have already written to you. Now I have a problem with the WebGL again. Tessellation doesn't work. I attach the link as it turns out in WebGL build: https://nla658.itch.io/shaman
    Whereas in the Windows version it builds like this:

    Help me solve the problem, please.
     
  44. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Does WebGL support tessellation?
     
  45. iiidsoul

    iiidsoul

    Joined:
    Oct 25, 2022
    Posts:
    3
    Does this shader support Alembic files? I mean an Alembic file that has deformation animation. It seems that the wireframe disappears when playing the animation of the alembic file.
     
    Last edited: Jan 29, 2023
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    I have never heard of such format before. After checking docs, it "streams the animation in Unity directly from the file".
    Need to check how (and if) it is possible to modify those files from Unity to bake barycentric coordinates there, that is required by the wireframe shader.
     
    iiidsoul likes this.
  47. mchangxe

    mchangxe

    Joined:
    Jun 16, 2019
    Posts:
    69
    hello boss, thrid year of using amazing assets, and as always, amazing! I got one question for this asset, is there a way to display a less populated version of the wireframe? Say that my object has alot of verticies, but i only want to show a simplified wireframe, is there a way to do this?
     
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    I understand what you are asking for, but - no, it is not possible.
     
  49. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    Hi! is it possible to lit only Edges or maybe even vertices function maybe in the future? for instance 3d object that is without polygonal mesh Screenshot 2023-10-27 180602.jpg
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    No edge or vertex rendering. Only triangle (and in some case Quad) edges that mesh consists of.