Game Development Community

Normal Mapped Terrains

by Matt Vitelli · in Torque Game Engine Advanced · 12/08/2006 (3:15 pm) · 58 replies

This is from some work I've done with normal mapping and terrains. Enjoy!

img71.imageshack.us/img71/4274/tsebumpsx5.png


img71.imageshack.us/img71/7395/tsebump2fl2.png
#21
01/12/2007 (7:26 pm)
Man, it's amazing!! =DD
#22
01/12/2007 (9:08 pm)
Well, there's no detail texture support for Legacy either, so it too had to be done through the shader. I might give this a try eventually, but at the moment it's really not an issue.
#23
01/13/2007 (6:22 am)
J.C. Smith, I would be eternally grateful if you could keep us up to date about progress on this.
We are doing a texture vs filesize tradeoff, and as you can see in the following images, the distance looks great, but not close up. Since the project is in early stages and we all learning the ins and outs of the engine, we are not too worried, as we hope later versions will provide us with more options.
Plus, we still get landscape graphical glitches! If anyone can help with that, that would be great.

http://i141.photobucket.com/albums/r75/piratelordx/mushroom4.jpg
http://i141.photobucket.com/albums/r75/piratelordx/Flowers1.jpg
http://i141.photobucket.com/albums/r75/piratelordx/NewTex2.jpg
#24
01/13/2007 (6:38 am)
I implemented Legacy detail texture support a while ago for a client, though I never really looked at dot3 or normals. Do these normals take lights into account or are they just embossed details?
#25
01/13/2007 (11:29 am)
They should take lighting into account. I posted the shader above.
#26
01/22/2007 (9:47 pm)
Wow looks awesome. This posible to implement to TGE?
#27
01/23/2007 (6:33 am)
Of course. I wouldn't recommend it, but using Cg and the shader I posted above, it should be fairly easy to get this working in TGE.
#28
01/23/2007 (7:09 am)
Why wouldnt you recommend it?
#29
01/23/2007 (2:19 pm)
I don't really think Cg integration in Torque is a very good idea. If you're serious about using Cg, use TSE with HLSL. If you want support on more platforms use GLSL.
#30
01/23/2007 (4:30 pm)
Really? why is that? I find the CG water and CG DRL works great with TGE. the CG dot3 on the other hand seems to only work with nvidia cards.
#31
02/25/2007 (1:37 pm)
Hi Guys,

Right, I'm trying to normal map my legacy terrain as above. I've implemented this code and created normal maps etc, but all the terrain has gone really dark, almost black. The textures are displaying, but very, very dark.

I assume to tell the shader what the normal maps are called I have a material.cs in the terrain folder with the textures on it, and the normal map in there as I would for any other object?

If not, can you let us know hoe we specify what textures go where etc? Or how to get around the black terrain problem, if any one else has seen it too...

Cheers All

H.
#32
02/25/2007 (2:53 pm)
The normal maps are rendering though? If you could, would you post a screenshot?

Here's what my material for the terrain looks like:

new CustomMaterial(TerrainMaterial)
{
   shader = TerrShader;
   version = 2.0;
   
   texture[3] = "~/data/terrains/detail1"; // Flat image
   texture[4] = "~/data/terrains/detailbump.dds"; // Actual normal map
   specular = "0.75 0.75 0.75";
   specularPower = 570.0;
   
   dynamicLightingMaterial = TerrainMaterialDynamicLighting;
   dynamicLightingMaskMaterial = TerrainMaterialDynamicLightingMask;
};

Inside client/scripts/shaders.cs
new ShaderData( TerrShader )
{
   DXVertexShaderFile   = "shaders/legacyTerrain/terrainV.hlsl";
   DXPixelShaderFile    = "shaders/legacyTerrain/terrainP.hlsl";
   pixVersion = 2.0;
};
#33
02/26/2007 (6:58 am)
Wow, if we can get this working with Atlas2, then we could actually have the cliff faces we want!
#34
05/03/2008 (1:15 pm)
Does this work for 1.7?
#35
05/03/2008 (1:43 pm)
No, but I'm working on a new implementation for 1.7.
#36
05/06/2008 (9:37 am)
I was wondering if you do request work? What I'm looking for is a flat legacy terrain with this code when you finish it for TGEA 1.7. If you can just email me a price and we can work something out.

keep up the great work and thanks for your time
#37
05/06/2008 (9:46 am)
@Matt

This plus the grass shader added to the terrain in defined areas would be awesome. I'm sure it would be possible but how or what would need to be done to do it?
#38
05/21/2008 (3:25 am)
Age of Conan just shipped, and it shows off what is really possible with normal mapped terrains. It's similar to Vanguard's system. Looks stunning.
#39
05/21/2008 (6:35 am)
@J.C. Smith - I ran it last night on my machine with every video option pumped to full blast. The environment is frikkin' amazing, from the terrain to the sky, and don't get me started on the gorgeous water and foliage system.

Hands down, it's the best looking MMO I've ever seen. Just wish I had time to actually play it : /

It just goes to show that the more tech you put into the environment code, the more immersing your game can be.
#40
05/21/2008 (10:09 am)
Yeah, I agree. After a couple days of Age of Conan, it's got me wanting to get back to working on a normal mapped terrain solution. Often as I'm running someplace i'm just in absolute awe of the scenery.