Tuesday 23 April 2013

Displacement - Basic Process



To render distant forests, it is common to have some kind of bump map to simulate a forest- Though of course this approach would actually render a flat forest, where edges such as mountain ridges or tree lines would be simply cut off.

A simple image of a cut block shows the problem quite nicely:


Cut Block near Hazelton B.C.
Notice the edges around the cut block.  You can see pointed tree tops along the bottom edge and trunks along the top edge.  This image is about the distance that this approach would likely be appropriate for.


Per-Pixel Displacement Volume Rendering


A solution to this problem is to render a forest height map texture to the terrain contours to a separate render target, and then use that image as a key for a 2d displacement filter on the scene image.


Forest Map Layer - Tree Height, dot(ViewVector, UpVector), and Depth rendered to terrain

The Forest Map contains the necessary data from a 3D vertex shader to "smear" a 2D image
  • red channel - tree height (also defines shape of tree)
  • green channel - dot product of view vector and up.  (Pixels to be dilated range between full displacement when viewing from the side and to no displacement when looking down)
  • blue channel - distance from camera.  Pixels to be displaced is dependent on distance.
Basic displacement filter - using terrain color

This displacement filter is a for loop that checks a small number of pixels bellow to determine if the current pixel should be recolored.  The loop starts with the bottom sample first, as it would be closer to the camera, and calculates the approximate height of the sample from the Forest Map:

pixelHeight = depth * height * viewUpDot * maxPixelHeight;

If this value is greater than the current for loop counter, the pixel is recolored with the color of the base image.  Effectively displacing the base color up according to the height in the Forest Map.

Repeated displacement Filter


Running this filter more than once by offsetting by the maximum shader amount produces some ugly artifacts, but already begins to represent a forest.


Though there are a few fundamental problems with this approach:
-For efficiency only a singular direction displacement filter is used, restricting the camera to no roll, and no upside down views
-Any forest bearing ground not seen by the camera (occluded by other terrain etc.. ) will not be rendered.




Though as a start, this process produces some interesting results.  Here is a video showing a bit of the basic process:



What has already been done


From what I have seen most forest rendering in computer graphics is based off of rendering many point sprite trees either in order, or with some kind of alpha cut to eliminate z-buffer artifiacts.



 Simple Point Sprite Forests

 http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Billboarding_renderstates.php


























Cylindrical Point sprites only look good from ground level
 http://vision.mas.ecp.fr/Personnel/teboul/files/pma06_teboul.pdf

"We would like to show that it is feasible to use three cross
billboards to realize a fast and realistic rendering of a big
forest in our software ForestRoam: Forest Rendering and
Simulation with Image models."




Certainly rendering a large forest scene would have to include a point sprite for every tree- for realistic scenes this would require an astronomical number of sprites- many thousands for a single frame...


Project Overview

As a Computer Graphics, Visual Art, and Environmental Studies student, I have been lucky enough to receive an NSERC USRA grant from the Canadian Government to work on a research project to render Virtual Forest Environments.


I am interested in exploring new methods of forest rendering that are fast enough for real time use in games and interactive simulations.  As well as developing aesthetically pleasing scenes, I also want to be able to create animations modeling ecological processes such as growth and succession. 

Helena National Forest, Montana

Beyond natural processes, I also would like to develop systems to model interactions with industrial elements that threaten forest environments, including logging, agriculture, mining, tar sands and fracking operations.

Northern British Columbia Cut Block


The focus of this project is to model forests artistically, not to develop photo realistic environments. 
The intent of these solutions to look good, while being able to support real time interaction and modification animations.  I may explore a variety of approaches, and will try to combine appropriate elements to create dynamic and interactive forests.

Thursday 11 April 2013

Project Background


I have had the privilege to grow up in one of the most fertile and temperate forested areas in Montana, a lot of my child hood was spent absorbing the beauty, nourishment and darkness of the forest.  As I ahve gotten more interested in computer science, my interest in spending time on the land within the forest has only intensified.  Especially within these last few years, I feel that my experiences in nature have inspired me to communicate and relate the severity of the change that threatens the worlds forests. 


In 2007 the rocky mountain pine beetle epidemic swept through Motnana, destroying most of the Ponderosa and Lodge pole pine stands in large areas across the mountains. 

Beetle kill forest - 6 years after initial infestation

 Interested in the epidemic, I learned from various biologists and restoration specialists that this outbreak was about 20 times larger than previous outbreaks, and that it was magnified through various mechanisms by climate change. 







After moving to Canada for University, I gradually became more interested in development issues relating to climate change.  Especially after experiencing the forest industry of Canada through tree planting, I became rapidly convinced that our economic practices were leading to large scale social and environmental degradation, and that severely impacted the worlds climate.


Cut block in Northern British Columbia



Continuing to study climate related issues through Environmental Studies and through political activism, I have how serious of an issue climate change will be over my life time, and for the rest of humanity.  

Throughout this process of informational accumulation, I have become interested in public awareness, sharing information through visual methods with visual art and computer mediums.  Through various independent computer graphics projects, I have built tools for rendering industrial systems and pollution processes through Industrial Abstraction.  Now I wish to augment these virtual environments with a forest system that can handle real time interaction and modification, to show abstract relationships through animation and interactive simulations. 

As large scale development and climate related issues are extremely large scale and abstract, I beleive virtual environments may help relate the consequences humanity faces from our lack of appreciation of the complex forces of nature.