Horde3D
http://horde3d.org/forums/

Terrain Shots
http://horde3d.org/forums/viewtopic.php?f=4&t=273
Page 1 of 2

Author:  AcidFaucet [ 08.04.2008, 20:37 ]
Post subject:  Terrain Shots

Here's a pair of screenshots of the terrain textured.

The method used in the pictures is a 2048^2 colormap, 1024^2 rgba blend map, and an rgba texture containing four detail textures in the channels. Pretty much a straightforward implementation of "Dot-Product for Efficient Detail Texture Mapping" by Renaldas Zioma in ShaderX 4. Four textures total. Golden rule of not allowing compression for the rgba detail image applies. Rainbows just don't compress well.

Image
From way up there.

Image
Close up of a soft detail texture meeting pebbles.

Code:
GLSL code

vec3 colMap = texture2D(tex1, texCoords).rgb;
vec4 blendMap = texture2D(tex2, texCoords).rgba;
vec4 blendTex = texture2D(tex3, texCoords*300).rgba;
float detRes = dot(blendMap, blendTex);
_______ = colMap * detRes;


Oddities are that a 1024^2 colormap actually looks better than a 2048^2, noise issues. Also still having a considerable amount of trouble getting the terrain to actually use my heightmap. In hindsight, a uniform could be used to individually adjust the intensities of the detail textures.

EDIT: Colormap and blendmap made in L3DT.

Author:  Vurlix [ 08.04.2008, 21:47 ]
Post subject:  Re: Terrain Shots

Sexy.

Author:  Volker [ 09.04.2008, 08:59 ]
Post subject:  Re: Terrain Shots

Really nice! I'm still waiting for a nice flight simulator based on Horde3D :-)

Author:  marciano [ 09.04.2008, 10:49 ]
Post subject:  Re: Terrain Shots

This is already great so far!

The next thing I would try out is to use normal or even parallax mapping for the detail maps. At least this looks great in Crysis:

Image

Author:  AcidFaucet [ 09.04.2008, 18:45 ]
Post subject:  Re: Terrain Shots

That's pretty much exactly where I want to go. The texture usage scares the doo-doo out of me though. I think they're using Ulrich style quad-tree textures that they render the different blends of normal, height, and color into to reduce texture usage and only do the blends as needed.

However, I've never seen more than 6 textures in relatively close proximity, at least known that couldn't have been projected decals. Of course, I may not be looking hard enough.

I suppose using a texture atlas for rgb:color, and rgba:normal & height would work well on the texture unit issue but the problem is tiling texture coordinates. Since the atlas' would serve an exclusive purpose and wouldn't contain arbitrary textures such as a tree or a house along with terrain textures there's probably room for creativity in solving the coordinate look-up issue. I think there's stuff around on doing this sort of thing with wang tiles and for faking DX10 texture arrays. Wang tiles are definitely more complicated than straight texture tiling.

3d texture? No tiling issues there. Derive the "w" from the blendmap.

Author:  swiftcoder [ 09.04.2008, 21:45 ]
Post subject:  Re: Terrain Shots

Is this what the terrain sample is supposed to look like?

Author:  AcidFaucet [ 09.04.2008, 22:38 ]
Post subject:  Re: Terrain Shots

Quote:
Is this what the terrain sample is supposed to look like?


My shots are just modifications I've made to the material and shader. The stock terrain sample should look like the white base with that tiling texture over it. The crysis shot is a target objective.

Author:  AcidFaucet [ 10.04.2008, 05:20 ]
Post subject:  Re: Terrain Shots

Now I just need to come up with a good solution for the seams, and the distance biasing. Blendmap, color atlas, bump&height atlas.

The oddities (aside from seams) are due to the RGBA blend map not being remade to work properly with this shader (it sums the channels to determine the appropriate texture). To top it off the blend map is fairly low resolution, so that doesn't really help and neither does the hard edges instead of soft blending.

Image
Bump mapping makes the seams look even worse, so here's a shot without it.

Author:  swiftcoder [ 10.04.2008, 17:32 ]
Post subject:  Re: Terrain Shots

Do you have a good idea as to what is causing the seams? On my last terrain renderer I had similar seams, which turned out to just be caused by not using GL_CLAMP_TO_EDGE for the texture wrapping mode.

Author:  AcidFaucet [ 10.04.2008, 18:04 ]
Post subject:  Re: Terrain Shots

Quote:
Do you have a good idea as to what is causing the seams?


Yeap, it's the texture atlas.

Image

The coordinates are dead on so it's grabbing the edges of the neighboring texture. Really I just need to downsize them a hair, add safety borders to them, and shrink the coordinates accordingly. Should also help with mip issues.

Though I'd rather put some time into trying to get the coordinates to solve the problem instead of requiring special adjustments to the texture.

Author:  AcidFaucet [ 13.04.2008, 02:50 ]
Post subject:  Re: Terrain Shots

Now its all nice and neatly normal-mapped. Just need to add displacement.

Image

Author:  AcidFaucet [ 13.04.2008, 21:15 ]
Post subject:  Re: Terrain Shots

Displacement. Only doing 2 loops instead of 4. The red tinted region isn't really there, it's for visualizing where displacement mapping is replaced with normal mapping at a distance. Should look pretty good with real displacement maps instead of photoshop grayscaled textures.

Image

Author:  Volker [ 13.04.2008, 22:28 ]
Post subject:  Re: Terrain Shots

Nice!

When I saw those screenshots, I had to reminisce about an old game. Maybe some of you might remember the DOS game "Big Red Racing". It was one of the first games I could remember that allowed moving not only on the track but also cross country. Maybe we can build some kind of simple application using bullet's vehicle demo and a terrain to create a funny racing game. It might have a motivating effect for beginners to start developing with Horde3D.

[edit] I must correct myself. The first game I can remember that allows not only driving on the street but even let you build you're own driving fun park was 4D Stunts Driving :lol:

Author:  Vurlix [ 14.04.2008, 02:18 ]
Post subject:  Re: Terrain Shots

Oh yeah, I remember BRR. I had a blast playing it on my 80486 back in the day. I could probably do some modelling/textures :)

Author:  AcidFaucet [ 14.04.2008, 20:51 ]
Post subject:  Re: Terrain Shots

I pretty much just need to make sure it works with different lighting combinations and I'll stick each of the shaders up on the wiki along with a "what & why."

Quote:
Maybe we can build some kind of simple application using bullet's vehicle demo and a terrain to create a funny racing game. It might have a motivating effect for beginners to start developing with Horde3D.


Always willing to contribute where I can.

Page 1 of 2 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/