I am making a custom grid shader for AR generated meshes (using LiDAR or Lightship ARDK).
These meshes are generated in runtime, but my shader does not work on it.
My color is applied properly to the mesh, but the shader graph grid (and brick) samples do not work for me. I use the output of the grid for alpha clipping, but there is no clipping happening on the procedural meshes.
A guess is that the UVs are not generated with the mesh generation, which is used by the grid node.
How could I get a grid pattern working on these generated materials?
Could you please explain a little bit more about how you fixed this problem? I’m sorry, I’m quite new to Shader coding in Unity. As I follow the tutorial below. for normal mesh, everything is working fine but for generated mesh, I’m facing the same problem as you mentioned.
I use the position node, get 1 axis, add it into a sin wave to loop a value between -1 and 1, then put the alpha at 1 when it’s above 0 (or another value) and 0 when below, then put that into the alpha channel.
The only downside is that it will use the hard XZ positions, so it will not perfectly scale when you have vertical surfaces, so not all models will work perfectly
Thank you very much for your fast reply. It seems that this would be a little difficult to apply to my situation because the generated mesh that I’m working with is from LiDAR sensor so It will have all kinds of shapes and sizes. If you know any method that could be applied in my situation please let me know. Once again thank you very much.
Mine also was made for LiDAR and worked great with it, but I disabled rendering of the shader when the angle was high. You might be able to add a 3rd axis somehow, or maybe use a different node depending on the object?
Let me know if you find a better solution!
So your was also for LiDAR, May I ask if is it okay for you to show a small picture of the result? to be honest, I very much appreciate your reply above but I don’t understand much of it. I will need to do some research to understand it. Right now I am trying different assets such as spatial shader, blender grid material, and more. But haven’t got any luck yet. I will definitely let you know if I found a better solution.
Sorry for the late reply. This is a paid asset but I believe you can find it free somewhere on the internet. The name of the asset is HoloLens Shader Pack.
I also found an alternative free asset that may look and work like the one I mentioned above.
If you can make it work. Please kindly let me know.