- Home /
Issue with spherical grass shader at x polar coords,Issue with grass shader on spherical surface at x polar coords
I have been following this tutorial to create a grass shader for my spherical planet. https://roystan.net/articles/grass-shader.html
Currently everything is pretty much the same except that I made the grass into cubes instead of triangles (either way it seems this issue persists).
In my game I generate the grass using a geometry shader along a 3D spherical based surface, called a geodesic dome (Basically a sphere made of hexagons). The issue I'm having is that the width and depth of the grass blades are incredibly small, only at the x polar coords. This results in a skinny blade look. Every where else looks completely normal.
Normal surface grass: https://imgur.com/qjzLA8U
X Polar surface grass: https://imgur.com/liqNqPB
Interestingly I have tried generating the grass shader on a normal Unity sphere, and I see absolutely no issues. At this point I've been stuck on this issue for quite some time and need any help I can get. I can't think of any reason why it would generate properly at the x polar coords on a curved surface, but not a flat. If it would help I would be totally willing to share the code.,I've been working on a grass shader based off this tutorial https://roystan.net/articles/grass-shader.html. I've modified the grass to be cubes instead of triangles, but besides that everything is pretty much the same. In my game i'm using a geodesic dome as the surface (a sphere made of hexagons).
When I generate the grass geometry along the surface of the geodesic dome it appears to work perfectly except at the x polar coords (points of greatest and lowest x values). At the x polar coords both the width and depth are incredibly small and unlike the rest of the surface. However when I tried generating the grass shader on a normal Unity sphere it appears correctly.
Image of the x polar coords: https://imgur.com/liqNqPB
Image of the rest of the surface: https://imgur.com/qjzLA8U
I've been working on this issue for quite a while and would be very grateful for any help. I'd be more than willing to share the code if it would help.
Answer by joesobo · Sep 24, 2020 at 08:45 PM
Solved by use ProBuilder to fix the surface's normals and tangents