Search Unity

Terrain Rotation (arbitrary orientation in ARKit world)

Discussion in 'Shaders' started by ferretnt, Feb 2, 2020.

  1. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    We'd like to place a Unity terrain in an ARKit world, but this means we need to *at least* rotate it around the y-axis. Terrain doesn't currently, officially support rotation in its transform.

    It seems like we could modify the terrain vertex shaders to handle rotation but, err, will this work anyway? Has anyone managed it? Does, for example, Unity generate terrain patches based on what it thinks will be in view with no rotation, in which case this is basically a waste of time?

    Is there any way to add a terrain to an AR world (or any world where the terrain isn't aligned to a fixed axis, but AR is probably the main case.)

    We need instance drawing on the terrain (mostly because the lighting looks terrible without GPU-calculated normal maps.)