Saturday, March 17, 2012

Fixing the lighting

 
While trying to find out what's the problem with ambient lighting on objects, which was making them too dark, I discovered that there's another problem with terrain lighting. Parts of the terrain that are subject to horizontal displacement were having incorrectly computed normals. For some reason the displacement effect was not affecting the terrain normal vector fully, resulting in contrast being lower than appropriate. The reason was probably a forgotten coefficient from an earlier debugging session, because when I derived the Jacobian again, there was this value of 0.5 that didn't belong anywhere.

It wasn't the first time when a surgical tool from a year-old operation was found inside our code. On the other hand, maybe one day we'll discover a hidden sleep() call and get unbelievable speedup by removing it :-)

Here are some comparison screens, old one on the left, fixed on the right side.




Another issue that was solved along the way were the artifacts on ATI cards in the shadowed areas. On ATI cards the floating point values that are output from shader may apparently end up slightly modified when written to a floating point render target, because of the blending unit. It does not matter when these values are supposed to be normal floating point values, but if the exact bit representation is important because these values are actually reinterpreted, a floating point render target cannot be used. Fortunately, the fix was easy once the reason for the artifacts was known.


Here's also the updated ambient lighting:

Adjusted ambient lighting on objects. Previously the downfacing surfaces were almost black.
The ambient lighting isn't finished yet, there will be a better one that will reflect the surrounding environment.

Tuesday, March 6, 2012

Road tool

A short article explaining some of the basic functions of the road editor tool in Anteworld game in sandbox mode. This is the first part that will be extended later as the improvements to the road tool will be made.

***

Roads

Roads in Outerra engine can be created by opening the road tool from sandbox menu. The tool allows you to create new roads or to modify the existing ones. New roads are created by placing way points (ctrl+LMB), both the existing and new roads can be modified by selecting road node and adjusting its attributes or position.

Here are the keys that can be used with the road tool (you can find them in the help tab of the road tool as well):
mmove the way point on the terrain, copying the terrain contours
shift+mmove the way point on the terrain, with the height locked to the original value
vadjust height of the way point
qmove to the next way point
shift+qmove to the previous way point
bappend a new way point

After the nodes are placed or adjusted, you can press the make road button to physically create the road or to rebuild it with adjusted parameters.

You can also select the road type and markings. The selection is limited at the moment; the road system will support much more road types, profiles and markings when it's finished.




Road nodes

Selected node is show with a node selector, drawn as three concentric circles. The circles show the widths of three important road node dimensions: yellow for road width, orange for border extension of the road, and finally the red showing width of transitional area on the road sides.


While the meaning of the first two should be immediately obvious, the transitional width needs some explanation. It specifies the width of the area across which the height of the road surface transitions into the surrounding terrain. If you are creating roads that are roughly at the same level with the terrain, its effect is not that visible. As soon as the road is elevated above or below the terrain, or the terrain is sloped, the effect of the transitional value shows.

The following pictures show the effect of the transitional width value on how the road is blended with the terrain. Just the single selected node has its transitional value changed:
8m transitional width
23m transitional width
1m transitional width


 Tangents


Roads are created from the placed way points using Cubic Hermite splines (for the interested, the algorithm has been briefly described in an earlier blog post). The splines allow for arbitrary selection of tangent (= the direction of the road at given point). Engine supports three ways of computing the tangents:
  • By default it's computed to be parallel with the line between two neighboring way points. This is OK in most cases when you are freely drawing the road.
  • Fit to match the direction of previous segment
  • Fit to match the direction of following segment
Use the latter two if you want to keep the incoming/outgoing road straight up until the turn, so that the nodes behind or before the turn don't affect the tangents:

Tangent computed from two neighbor nodes
Tangent set to match the previous road segment

Connecting roads

Until there's a tool that will snap roads together, you can only try to join them manually. Here are a few tricks how to do it.

Initial state

Move the last node a bit back (using 'm'), and place additional node at the end of the connecting road. Enlarge the road width to get rid of the sharp connection, and move the node so that there's no gap.


The road you are connecting to is usually slightly sloped, and you need to adjust slant of the road node with which you are connecting, together with the height of the node. The height can be changed either using the elevation± slider, or by entering vertical-move mode using key 'v'.


At the moment the width of the road is not yet actually spline-interpolated, but you can select between two modes using the width interpolation flag.
Linear width interpolation

Saturday, February 25, 2012

Outerra Tech Demo released!

Outerra Tech Demo

Outerra Engine is a unique 3D engine, a world rendering engine capable to seamlessly render whole planets from space down to the ground level. It can use real world data to render the planets realistically, while it also dynamically refines the data using procedural algorithms to provide high ground-level detail.



The engine provides unlimited visibility obstructed only by the planet's curvature, with details ranging from thousands of kilometers down to centimeters. Real time atmospheric rendering, oceans with shore waves.



It can integrate vector data overlays for roads, and land class modifications. Uses the JSBSim Flight Dynamics Model library for high fidelity simulation of aircraft, and Bullet physics engine for simulation of vehicle physics. Terrain and fractal algorithms maximally utilize the GPU, leaving the CPU resources for simulation.



Finally here comes the Outerra tech demo, coming together with the alpha release of our game Anteworld.

Download

Please check the latest version updates at the forums.

Outerra Anteworld 0.7.13.3478 (Gamefront)
Outerra Anteworld 0.7.13.3478 (My Drive)

Driver issues, graphics glitches Please check the Graphics driver issues topic to resolve the most common issues with the drivers.


Features
This alpha release features:
  • A complete, real scale planet Earth that can be explored
  • Created from real elevation data with resolution 90m where available, 1km resolution for oceans; data are dynamically downloaded as you go
  • Further refined by fractal-based procedural techniques down to centimeter-level details
  • Vector-based road system that integrates with the procedurally generated terrain
  • Ability to place static stock objects and drive provided vehicles

The demo comes with the whole planet Earth that can be explored in a free-camera mode or in a 8-wheeler truck. People who like it and/or want to support us and the development of Outerra engine can buy the alpha release of Anteworld at a discounted price ($15), half the amount for the final release. Doing so will give you access to regularly released alpha/beta updates of the game, together with the final version when it's done. The price will gradually rise with each major release.
You will also become our beta-testers, with ability to influence the priorities of the development.

The full game includes also a plane and a helicopter, and basic sandbox tools that allow you to create roads and runways and place stock objects. A model importer and vehicle configurator that will allow creating custom models and vehicles will be coming soon in an update to the game.

The demo contains a few locations around the world (a couple of them were created by our tester Pico). Data for the default location are already included within the installer, the rest of it will be downloaded automatically on demand as you explore the world (note: proxy servers aren't supported yet for data download). The total size of the data is around 12GB, but normally you'll download just a fraction of the size, unless you traverse the whole planet surface at a low altitude.

Hardware requirements

Outerra engine runs on OpenGL 3.3 and requires recent graphics drivers. It will warn you if your drivers are outdated, or even refuse to run in case you've got old ATI drivers that are known not to work at all.
The minimum requirements are:
  • Nvidia 8800GT or better, ATI 4850 or better
  • 512MB GPU memory
  • a 2-core CPU
Recommended:
  • Nvidia 460GTX or better, ATI 6850 or better
  • 1GB GPU memory

Limitations of current alpha state of the technology

This alpha release comes out to show the potential of the engine, but it still lacks many features commonly found in other engines, and especially the effects are postponed until the major features are implemented.
The demo currently comes with just a single biome - northern type forests. There are no rivers and lakes implemented yet, and no weather yet.
Almost all the areas are work in progress.


Known Issues

There are still some driver issues with ATI cards, the most problematic being the 4xxx line, where there are still some seemingly random crashes.
The alpha state of the engine also means that it's not very optimized yet. It consumes more GPU memory than it should, and spends some time rendering things that is not eventually visible etc.

Driver issues: Please check the Graphics driver issues topic on our forums to resolve the most common issues with the graphics card drivers.


Anteworld game

Anteworld* is a world-building game on a massive true-to-life scale of our planet. Returning aboard an interstellar colonizer ship built in the Golden Age of Mankind, players arrive on the planet earth to discover civilization and humanity vanished. They will have to rebuild the civilization - exploring, fighting, and competing for resources while searching for clues to the disappearance of humanity.

The game will contain several modes, the basic one will be a single-player game but with player-built locations being synchronized and replicated between clients. That means player can settle in a free location of his choice where he can build and play, and when he goes exploring he'll be able to observe and visit other sites where other players are building their world.

There's going to be also a multiplayer mode for gaming in the existing world.
Sim-connect mode should allow to use Anteworld as an image generator for another simulation program.
In fact, Anteworld is meant to create the basis for an Outerra game/sim platform, allowing to create mods and new game modules that would run on the existing backend.

*The name comes from Latin prefix Ante-, with the meaning of prior-to in time. A world that was. There's going to be an accompanying novella written by C.Shawn Smith that should be loosely tied to the game.
Here's a sample, the epilogue: The Outerra Initiative - Epilogue