- Home /
Tri-planar shader for planets
Hi, I am currently using the tri-planar shader found at http://www.blog.radiator.debacle.us/2013/02/a-smoother-triplanar-shader-for-unity.html however I am currently trying to apply this to a planet. The centre of the planet will be passed into the material using a property, however, for now, I am just using a hard coded value in the shader file. A similar question was asked on here, http://answers.unity3d.com/questions/754969/how-to-apply-a-tri-planar-shader-to-a-planet.html (I want the textures to work in the same way as well) This provides a method for gaining local normal coords however I am unsure of how to combine the two. They use the world pos directly (IN.worldPos.xy) for the UV coords however this will not work on a sphere as when the face is aligned to the x or y plane the texture will stretch incorrectly. I could really do with a working example along with an explanation of how it works. Thanks in advance for any help!
Your answer
![](https://koobas.hobune.stream/wayback/20220612091107im_/https://answers.unity.com/themes/thub/images/avi.jpg)