Wednesday 12 November 2014

Forest Rendering with Terrain Texture Displacement


Last summer I was working on a paper to essentialize the height-map displacement process I am using for the Forest Rendering Project.  Bellow is a break down for the basic rendering process to generate multi-textured terrain displacement that can accurately be merged with both opaque and transparent objects and effects.

 This work led me to realize that I could generate Displacement Data Buffers needed for terrain displacement as well as forest rendering, and merge them to share a single displacement key.

This means that in a single scene once some Height Map Displacement Filtering process is initialized, adding other systems to use this process of displacement could be added with relatively low processing cost to generate the needed data buffers, and then the creation of the displacement key (the process that calculates the displacement value) would not increase at all based on the addition of other systems also using the key.

Again, this is the advantage of this system, in that once implemented, the most costly process (generating the displacement key) does not increase with added complexity of the input data buffers 
as it operates as a 2D filter, and its running time is consistent.

Bellow is a sample of these processes being combined:



 This implementation is by no means perfect-the process relies on using shared data buffers for both forest generation and terrain displacement.  Using shared buffers allows for faster creation of the shared displacement key, but right now where forest exists it overrides any terrain displacement.  This is fine unless there are small holes in the forest (as in the bottom right of the image above) or if the rocks in the terrain texture are higher than the forest.



Currently both the forest and terrain displacement data buffers are generated sequentially on the same target, so they can not sample one another for a smooth merge.  Potentially the forest data could be rendered semi transparent to achieve smooth height transitions and simulating a layer of vegetation over the terrain.  Though as of now I am using all 4 channels of the main data buffer, so simply rendering the forest data over the terrain displacement data would probably destroy the final data embedded in the alpha channel.  Also by using this method there would be little control in how this merging is handled.


Alternatively the displacement data buffers could be split, then merged to handle smooth transitions and desired effects by having the forest become a dynamic vegetation overgrowth layer above the displaced terrain.  This will be explored and tested in the next post.

No comments:

Post a Comment