Initial Atlas Terrain Checkin (Pretty Pictures In Here!)
by Kyle Carter · in Torque Game Engine Advanced · 05/27/2005 (6:36 pm) · 249 replies
Hey guys,
I just committed the first public version of the new TSE terrain, codenamed Atlas. This is a fully modern, scalable terrain engine. Check the docs (updated with a whole new chapter :) for details.
This is a private release to our beloved TSE licensees. Congrats, guys, you get first shot at this new toy. :) We'll be rolling out a full launch of Milestone 2 - this was the last piece - next week when we all get back from Memorial Day of Weekend. I'd appreciate it ever so much if you'd keep on the quiet side about this until then!
The toolchain is currently a bit on the basic side. A fuller toolchain will be rolled out as part of MS3.
Please take a moment to give it a try. Feedback is welcome - post it here, in a new thread on this forum, or mail it to me. There's a lot more work to be done, but this represents a basic usable point for people to work from. :)
You can get this release by doing a CVS update, of course.
And finally... A rundown on the features:
Lightweight CPU Usage
Atlas uses less than 10% of CPU time per frame to update and render. Compare this with approximately 30% for legacy terrain.
Massive Landscapes
Supports landscapes of arbitrary size, bounded only by disk space. The current system supports approximately 10 quinquagintillion (or ten thousand quintillion vigintillion for those Brits in the audience, or 10154 chunks on the base level).
Vast View Distances
Can quickly render unlimited view distances, bounded only by the working range of the video card's Z-Buffer. Atlas can achieve 100+ fps on a midrange Radeon, with a view distance of approximately 4,000 meters. The legacy terrain is not even capable of rendering this view distance by default!
Unique Textures
Atlas supports a single massive texture for your entire terrain! Every texel is unique. Support for extremely large textures (in excess of 32,768 by 32,768 pixels) on all hardware. Of course, all this is streamed, so you only pay memory cost for the texture detail near you. A future release will support on-the-fly texture blending like the legacy terrain.
Streaming Data
Data is streamed from the disc as needed, so you can have very large terrains without exceeding your memory. Both geometry and texture data are loaded on the fly.
Accurate Collision
What is rendered is what is collided against, so you get full interaction support for anything Atlas can render - overhangs, gaps, ditches, and so on. As the toolset for this engine matures, it will be possible to actually create such terrains. But the runtime as of now supports this sort of topology.
Compressed Textures
Atlas fully supports industry-standard DXT texture compression. It compresses offline for maximum quality, pregenerates mipmaps for minimal CPU usage at runtime, then streams it directly into GPU memory.
Ok, I'm going to a party. I'll be back online later tonight to check up on things, and will be around during the weekend as well. Thanks for being so patient with me! :)
#222
06/04/2005 (4:26 am)
I thought the lightmaps were multi-textured...?
#223
06/04/2005 (4:27 am)
What i meant is that the lightmapping is burned into the terrain textures themselves in the new TSE terrain, which is very interesting. So essentially its not even lightmapping really, because there is only one texture used for the diffuse map and the light map.
#224
Its definitely doable with a nice shader.
06/04/2005 (4:30 am)
Realtime lighting on the terrain (i.e. self shadowing and the rest) should be relatively easy.Its definitely doable with a nice shader.
#225
06/04/2005 (4:32 am)
Wouldn't it be expensive, Phil? I mean, hardware-wise..
#226
06/04/2005 (4:46 am)
I just said a some fancy code, because you might want to optimize it a little, but hooking into the terrain LOD system. I said a few years from now because it looked like the terrain was handling a reasonable amount of geometry, and shading the whole things with high quality shaders might slow things down. It would definitely work on something like a 6800 GT though (and thank god i have one ;) ).
#227
Anyway, I'm sure that its do-able. In fact I've heard that the dynamic shadows on the terrain in a game called Alan Wake by remedy look pretty nice using shader lighting..
Phil.
06/04/2005 (5:57 am)
Stefan: not really.. most of the lighting would be a dot3 operation to get the slope of the normal versus the angle of the light.. the only other major part would be the occlusion testing.. but that is just a bunch of texture lookups. In fact it might be possible to do all of this using a filter kernel on a render to texture for the terrain lightmap..Anyway, I'm sure that its do-able. In fact I've heard that the dynamic shadows on the terrain in a game called Alan Wake by remedy look pretty nice using shader lighting..
Phil.
#228
06/04/2005 (6:04 am)
Wow, nice. Thanks for the info.
#229
06/04/2005 (6:58 am)
.
#230
06/04/2005 (7:11 am)
No problem with the delay. Ah yeah I misread your post, I think. Of course the demo should be as "perfect" as possible to show the consumor what it can do :) You are correct.
#231
06/04/2005 (7:29 am)
.
#232
06/04/2005 (7:51 am)
Ok, so is the plan for shadows from things like difs on to the terran to be handled by dynamic shadows? just curious..
#233
06/04/2005 (8:02 am)
GG hasn't commented on that yet Kevin, we are just discussing it.
#234
Just for anyone whose curious.. Phil's right ;) ..adding a lightmap to this is dead easy..
I just noticed that the terrain shader is VERY basic (obviously purposely)...
so i did a little hacking..
materials.cs
shaders.cs
atlasSurfaceP.hlsl
Thanx GG and ben for a truely wonderful addition..
edit: added pic
06/04/2005 (10:35 am)
Thanx stefJust for anyone whose curious.. Phil's right ;) ..adding a lightmap to this is dead easy..
I just noticed that the terrain shader is VERY basic (obviously purposely)...
so i did a little hacking..
materials.cs
datablock CustomMaterial(AtlasMaterial)
{
shader = AtlasShader;
texture[4] = "~/shared/textures/kewlLightMap";
//had to bump to 1.4
version = 1.4;
};shaders.cs
datablock ShaderData( AtlasShader )
{
DXVertexShaderFile = "shaders/atlasSurfaceV.hlsl";
DXPixelShaderFile = "shaders/atlasSurfaceP.hlsl";
//had to bump to 1.4
pixVersion = 1.4;
};atlasSurfaceP.hlsl
//~line 27 uniform sampler2D lightMap : register(S4) //~line 34 //scale the lightmap to the terrain texture size float4 lightMapCol = tex2D(lightMap, IN.texCoord); // ~line #40 diffuseColor *= lightMapCol ;
Thanx GG and ben for a truely wonderful addition..
edit: added pic
#235
Now we talking what I been searching for!
Got to update now be back later
06/04/2005 (8:48 pm)
I was away to darn long. :(Now we talking what I been searching for!
Got to update now be back later
#236
Here is what i get from the console.log file:
AtlasActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
AtlasActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
- done.
=== Chunk Statistics ===\
\===== Level Count Avg. Size
0 4096 65.449219
1 1024 221.576172
2 256 103.507813
3 64 145.531250
4 16 14.812500
5 4 12.000000
6 1 12.000000
========================================
chunks: 5461
input verts: 67108864
output verts: 71299
avg verts/chunk: 13
NOTE: verts/chunk is low; for higher poly throughput consider setting the tree depth to 6 and reprocessing.
output bytes: 202085
bytes/input vert: 0.00
bytes/output vert: 2.83
real triangles: 531083
Allocating ~768 kb of JPEG decompression working area...
Generating 64x64 leaf tiles...
The terrain seems to output ok but i have a lot more of the first line i posted. I am getting an error about frame allocation. Any ideas what this is and why it would be doing it.
Here are the two commands i am running in the main.cs
GenerateChunkFileFromRaw16(
"terrain_water_demo/data/terrains/ter2_2_16_8193.raw",
8192, 1.0, 1.0 / 256.0,
"terrain_water_demo/data/terrains/ter2_2big.chu", 10.0, 7);
generateTQT("terrain_water_demo/data/terrains/terrain2_2big.jpg", "terrain_water_demo/data/terrains/ter2_2big.tqt", 7, 64);
Any help would be great thanks!
06/06/2005 (2:15 pm)
Hey guys i am getting an error while trying to generate some terrain.Here is what i get from the console.log file:
AtlasActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
AtlasActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
- done.
=== Chunk Statistics ===\
\===== Level Count Avg. Size
0 4096 65.449219
1 1024 221.576172
2 256 103.507813
3 64 145.531250
4 16 14.812500
5 4 12.000000
6 1 12.000000
========================================
chunks: 5461
input verts: 67108864
output verts: 71299
avg verts/chunk: 13
NOTE: verts/chunk is low; for higher poly throughput consider setting the tree depth to 6 and reprocessing.
output bytes: 202085
bytes/input vert: 0.00
bytes/output vert: 2.83
real triangles: 531083
Allocating ~768 kb of JPEG decompression working area...
Generating 64x64 leaf tiles...
The terrain seems to output ok but i have a lot more of the first line i posted. I am getting an error about frame allocation. Any ideas what this is and why it would be doing it.
Here are the two commands i am running in the main.cs
GenerateChunkFileFromRaw16(
"terrain_water_demo/data/terrains/ter2_2_16_8193.raw",
8192, 1.0, 1.0 / 256.0,
"terrain_water_demo/data/terrains/ter2_2big.chu", 10.0, 7);
generateTQT("terrain_water_demo/data/terrains/terrain2_2big.jpg", "terrain_water_demo/data/terrains/ter2_2big.tqt", 7, 64);
Any help would be great thanks!
#237
(better version bellow)
06/07/2005 (3:29 pm)
My first real terrain. i was pretty pleased with myself until i saw to terrains on here again. Alas i don't have a commercial version of terrigen, so i have to make do with what i can find. At least i got it to work. (better version bellow)
#238
06/07/2005 (3:32 pm)
@Michael-Paul Jakovlevski - they look Awesome!
#239



06/14/2005 (1:19 pm)
Well I didn't agree so i decided to try again. The problem i had with that terrain was that it came out jagged like a hedgehog. and it was too small. so i increased the grid size to 8.0 to smooth out the bumps and increase the size. but that seriously blurred the texture. So I created a new larger terrain. but i ran a gaussian blur function on it first. and I generated a larger texture. Well this is what I got.


#240
Ick, seams. I thought I had squashed all of those problems. I'll spend some time during MS3 and make sure that there is zero seaming.
06/14/2005 (1:43 pm)
That's pretty awesome! Really has the mars look going.Ick, seams. I thought I had squashed all of those problems. I'll spend some time during MS3 and make sure that there is zero seaming.
Torque Owner Stefan Lundmark