Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Issue with spherical grass shader at x polar coords,Issue with grass shader on spherical surface at

Discussion in 'Shaders' started by joesobo, Sep 24, 2020.

  1. joesobo

    joesobo

    Joined:
    Sep 6, 2018
    Posts:
    17
    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.
     
  2. joesobo

    joesobo

    Joined:
    Sep 6, 2018
    Posts:
    17
    Solved by use ProBuilder to fix the surface's normals and tangents