Here comes another video, this time with Apache AH-64 helicopter or two in it.We went to add a helicopter after the support for them has been recently added to JSBSim library. There still seem to be some bugs and our parameters for the model aren't entirely right either, so the behavior might not be absolutely correct.
Still, flying the helicopter is a great fun. I wasn't able to fly helicopter in a simulator before, probably just because I never tried hard enough. But flying it here - over the forests and through the canyons and close to the rocky walls - that gives it a completely different feeling and experience, so even the types of me can get easily lost in time while wandering over the unknown lands here.
In case you are wondering, the camera comes out from the Hydra rocket launcher at the beginning of the video, made possible thanks to the use of logarithmic depth buffer.
In order to make this video we added support for "translucent" shadows so that the shadows from rotor blades look more natural, the hard shadows were quite disturbing.
Since the last blog update a number of things has been worked on - an updated atmospheric rendering code resulting in nicer and faster atmosphere rendering, while being also more consistent in various settings. There should be a separate and more technically oriented post about that for people who are fighting with atmospheric scattering which is quite hard to get right. And of course I need to write something about it so I can find how it works later when it drops off of my brain completely again.
As a part of the atmospheric code also the ambient light has been tweaked so the shaded and shadowed terrain is now looking better; this shows best on the features of rocks - previously it didn't have the right amount of contrast and looked quite bland.
Another batch of work done concentrated on GPU memory consumption optimizations; large terrains are quite demanding in this regard so an effective management of it is essential. We managed to save bits of memory here and there by employing various hacks and different formats, which totaled to hundreds of megabytes in the end. But while someone had to effort and tweak the system to save the megabytes, someone else just had to delete that dummy 80MB buffer that was sitting there :-)
Lastly, here are some screenshots with the helicopters:
Forum topic - Apache helicopter.
Showing posts with label fractal terrain. Show all posts
Showing posts with label fractal terrain. Show all posts
Saturday, October 30, 2010
Friday, February 5, 2010
Cessna Test Flight
Angrypig finally managed to implement collision detection for JSBSim planes along with the joystick support, so we created a short test flight video with Cessna plane.
Here it comes.
Here it comes.
Thursday, November 12, 2009
Horizontal displacement
Recently I've been working on the code that computes fractal data - a bit of reorganization to be able to have more independent fractal channels that are used everywhere in the engine, as I was running short of them already. Previously we had one channel where the terrain elevation fractal was computed, another channel with low-pass filtered terrain slope and 2 independent fractal channels. After the redesign we have 4 independent fractal channels, but additionally the filtered slope is computed independently for u,v terrain directions.
The two-dimensional slope values allow for better horizontal displacement effect on the generated terrain, because now it's possible to make the rock bulge from the hill slope in the right direction. In the previous version only the absolute slope value was known, and the fractals extruded the mesh independently in two orthogonal directions, and of course that did not always look good.
The equation for the displacement was in addition parametrized, to be able to get more effects out of it. Currently it's possible to vary the dominant wavelength, bias and amplitude of the used fractal.
Here is a quick comparison of what the parameters do.
Bias +0.5 (bulging outwards from the slope), wavelength 19m
Wavelength 38m
Wavelength 76m
In the last screenshot the fractal used for the displacement is already only slightly visible and the bulbous shape of purely slope-dependent displacement shows up.
Here's how the displacement looks like when the bias is even larger, i.e. when the sloped parts are pushed even more outwards (bias +1.5):
It's also possible to use a negative bias values, that make the sloped parts carved into the hill (bias -1.0):
On the other hand, amplitude boost can emphasize the effect of the fractal, creating more visible overhangs here and there:
For comparison, here's how the same terrain looks like without any horizontal fractal effect at all:
... and without the vertical fractal, only a bicubic subdivision of original 76m terrain grid:
Next thing to try could be using a texture containing rough shape of specific type of erosion one would like to achieve. Current technique still cannot generate proper cliff and canyon walls, but combining it with the shape map lookup should theoretically do the job.
There's also an interactive comparison
The two-dimensional slope values allow for better horizontal displacement effect on the generated terrain, because now it's possible to make the rock bulge from the hill slope in the right direction. In the previous version only the absolute slope value was known, and the fractals extruded the mesh independently in two orthogonal directions, and of course that did not always look good.
The equation for the displacement was in addition parametrized, to be able to get more effects out of it. Currently it's possible to vary the dominant wavelength, bias and amplitude of the used fractal.
Here is a quick comparison of what the parameters do.
Bias +0.5 (bulging outwards from the slope), wavelength 19m
Wavelength 38m
Wavelength 76m
In the last screenshot the fractal used for the displacement is already only slightly visible and the bulbous shape of purely slope-dependent displacement shows up.
Here's how the displacement looks like when the bias is even larger, i.e. when the sloped parts are pushed even more outwards (bias +1.5):
It's also possible to use a negative bias values, that make the sloped parts carved into the hill (bias -1.0):
On the other hand, amplitude boost can emphasize the effect of the fractal, creating more visible overhangs here and there:
For comparison, here's how the same terrain looks like without any horizontal fractal effect at all:
... and without the vertical fractal, only a bicubic subdivision of original 76m terrain grid:
Next thing to try could be using a texture containing rough shape of specific type of erosion one would like to achieve. Current technique still cannot generate proper cliff and canyon walls, but combining it with the shape map lookup should theoretically do the job.
There's also an interactive comparison
Friday, May 29, 2009
Horizontal displacement
As always I do not keep strictly to the plan, and decided to try one of things I wanted to do someday - horizontal displacement of terrain.
The fractal map computed for quadtree node already contains 3 independent fractal noise channels. The first one computes elevation and is seeded from heightmap data. Other two are used for detail material mixing and other things. There is also a fourth channel containing global slope.
I modified the shader that computes vertex positions to displace also in horizontal directions, using one of the two independent fractal channels. Amount of displacement also varies with global slope - areas in flat regions are shifted minimally, but sloped parts that are also treated as rock are displaced a lot. This makes rocky parts much more interesting. For the record, equation used for displacing point on a sphere in tangent space is this:



There are still some issues but the overall effect is quite nice. Of course, collisions with sloped parts are no longer accurate and I'll have to do something with it later.
Outerra planetary engine
The fractal map computed for quadtree node already contains 3 independent fractal noise channels. The first one computes elevation and is seeded from heightmap data. Other two are used for detail material mixing and other things. There is also a fourth channel containing global slope.
I modified the shader that computes vertex positions to displace also in horizontal directions, using one of the two independent fractal channels. Amount of displacement also varies with global slope - areas in flat regions are shifted minimally, but sloped parts that are also treated as rock are displaced a lot. This makes rocky parts much more interesting. For the record, equation used for displacing point on a sphere in tangent space is this:

Next thing that had to be done was to compute the normals of such deformed surface. Article in GPU Gems about deformers provides nice info about Jacobian matrix that can be used for the job. After some pounding to my math circuits I managed to produce the following Jacobian of the above equation (in tangent space):
Normal is then computed as cross product between the second and third column, since the tangent and binormal are {0,1,0} and {0,0,1} respectively.
Finally, here is the result - left side original with only the vertical displacement, on the right side vertical&horizontal displacement:
There are still some issues but the overall effect is quite nice. Of course, collisions with sloped parts are no longer accurate and I'll have to do something with it later.
Outerra planetary engine
Subscribe to:
Posts (Atom)




