- Home /
Generate mesh from shader for Skybox (withouth the MeshRender workaround)
Hi! Been looking through all the netverse and no answers. I mean there is a workaround by using an object with mesh etc, but I think it's an ugly messy solution.
Thing is. I can make a custom skybox shader, no problem. I can map a single texture to it, and looks fine. Anything color related, I can manage, I think.
However, I haven't been able to find any reference about changing the mesh to something else. The pregenerated mesh used by the skybox shaders is fine for general purposes, especially when you have a predefined up direction and horizon. But what if for any reason I want to use a different mesh?
I know skybox should be able to change its mesh, because the 6 sided cube does it (it says so in the polycount).
Now, I can pinpoint some things from this image. I see there are 5 extra SetPass calls, which is natural since 6-side cube uses 6 textures.
If it's not done from shader, I'd love to know where does it happen, or if anyone knows how to do the same, but just generate my own mesh arbitrarily.
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612223949im_/https://answers.unity.com/themes/thub/images/avi.jpg)