Horde3D

Next-Generation Graphics Engine
It is currently 27.11.2024, 23:39

All times are UTC + 1 hour




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Terrain Shots
PostPosted: 08.04.2008, 20:37 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 08.04.2008, 21:47 
Offline

Joined: 19.03.2008, 01:22
Posts: 79
Sexy.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 09.04.2008, 08:59 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Really nice! I'm still waiting for a nice flight simulator based on Horde3D :-)


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 09.04.2008, 10:49 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 09.04.2008, 18:45 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 09.04.2008, 21:45 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Is this what the terrain sample is supposed to look like?

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 09.04.2008, 22:38 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 10.04.2008, 05:20 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 10.04.2008, 17:32 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
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.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 10.04.2008, 18:04 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 13.04.2008, 02:50 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
Now its all nice and neatly normal-mapped. Just need to add displacement.

Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 13.04.2008, 21:15 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 13.04.2008, 22:28 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
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:


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 14.04.2008, 02:18 
Offline

Joined: 19.03.2008, 01:22
Posts: 79
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 :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shots
PostPosted: 14.04.2008, 20:51 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group