Search Unity

Enlighten and geoclipmap terrain

Discussion in 'Global Illumination' started by hausmaus, May 29, 2017.

  1. hausmaus

    hausmaus

    Joined:
    Dec 9, 2011
    Posts:
    105
    Is there a hook or a method to get Enlighten to work with a custom terrain like an old-school geoclipmap terrain? I gather that Unity's internal terrain system is doing this but I suspect it is a very tight integration under the hood, and I just wonder if a similar effect can be achieved with a custom terrain.

    At the moment, I'm actually using Unity's internal terrain system with a custom shader and a bunch of tool scripts to make large landscapes easier and that kind of thing. But I've been wanting to do seamless large environments, which I actually did the geoclipmap way long ago, but this time around I would like it to still be able to receive some kind of realtime-friendly GI lighting information from Enlighten (or a comparable system).

    I could write an indirect-only solver and build my own maps for the terrain itself, but then it might not blend well with Enlighten, and anyway there are enough gaps in my understanding of actual realtime GI irradiance maps and not just a lightmap with some hacks to have to respond to directional light changes so I don't know how good that option would be.

    There is the proxy option of baking the height+color maps of the custom terrain out to meshes in the editor, letting them receive Enlighten's maps, then hiding those meshes and looking up that data in worldspace when rendering the custom terrain, which might work but does seem a bit cumbersome. Plus even there I'm not sure how to get the lookup to work because I'm assuming that the irradiance map values can't just be passed into a Standard Surface shader the same way indirect lightmap values could, right?

    It's possible that just more basic terrain management can work well enough for a large-scale world in my game anyway and that the tools I have, while a bit of a chore, are good enough and it's not worth looking into alternatives. But I just wondered if somebody had a brilliant way to get procedural geometry to be renderable at edit time by Enlighten in general.

    Thanks for any insight,
    Adrian