Hi all,
I’ve been playing around with PCG lately, and I would really like to “bake” some additional information into the landscape sequentially - outside of edit layers and weight painting for materials.
I’ve found some parts of the puzzle, using Render Target Textures and Post Process materials, but I feel like there might be better ways.
I think the best way I can describe it is by example:
While generating a forest on some landscape, after placing the larger trees, rock formations, and the like, I’d like to sample some amount of points equally distributed throughout the terrain. From these points, a hemisphere of raycasts is done upwards, counting intersections against non-translucent geometry. That way obtaining “sun exposure” values (hitCount/rayCount) for different spots of the terrain - resolution may vary.
Then, back into PCG, I’d use these points to filter a new sampling of the landscape, and place some shrubbery based on sun exposure and non-occupied spots (would require retaining earlier sampled points between steps).
The example is simple, but the approach could be extended to obtain information about clearings, drought-levels (distance from closest point on wetland layer + sun exposure), wind (amount and direction at some point, based on landscape heightmap and prior PCG population), available nutrients … etc.
All of this would be editor-time, i.e. not evaluated at game runtime, and sequential. Preferably, the baked information would be “re-rendered” on changes to prior steps, but that can be a topic for another day. Also, I’ve yet to delve far into C++ (I have a feeling that is the place to go), but it doesn’t seem too bad (famous last words). I have experience in other languages (Java, C#, GoLang), as well as OpenGL and GLSL, but it would be nice if parts of these processes could be exposed to interop with other Blueprints.
Any suggestions are appreciated!