Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

"Genshin Impact" Grass Rendering - How?

Discussion in 'General Graphics' started by Samhayne, Oct 7, 2020.

  1. Samhayne

    Samhayne

    Joined:
    Jun 15, 2009
    Posts:
    44
    So how do you think the Genshin Impact devs managed to render this large amount of grass on mobile?
    GPU Instancing + DrawMeshInstancedIndirect?

    I wonder if this is the right direction to investigate...

     
    soleron likes this.
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    My solution would be to use a single mesh that follow the player, wich would be a grid of quad, then in vertex shader ogl es 3+ read the various terrain texture to move the vertices to the right place, each quad would have id data baked into vertex colors to discriminate each quad and vertices for applying billboards, sway and texture, texture is taken from an atlas and the terrain texture dictates which tile if the atlas to read. The plan move along with the player ising hashing position threshold, unused quad get scaled down to zero, get drawn in a single drawcall.


    Bonus
    Distant grass would use the terrain geo, scaled along the normal with an interior shading where walls are grass texture, so we get distant parallax effect for free.
     
    Samhayne likes this.
  3. deferter

    deferter

    Joined:
    Jan 10, 2023
    Posts:
    1
    Look for: Critias Painter
    It renders a huge amount of grass, trees, rock and all you want without losing fps