Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Smoothing out rough texture edges, in-game terrain

Author
Message
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 31st Oct 2009 21:01
Hi!

I'm working on a terrain in T.Ed and have a couple of different texture layers. I'm exporting it as a .x file with vertex alpha.

In T.Ed, the map looks like this:


As you can see, the textures are smoothed out nicely, blurring between textures properly.

When loaded into the game, there is no level of texture between 100% fill and 0% fill. The bottom layer shows up unless the upper layer is 100% filled, in which case the top layer shows up. The result is this:


The seams are very apparent and very jagged, especially since my terrain is only 256x256 over a large area. I need to smooth it out because places where the textures are distinctly different have a very rough edge, as can be seen here:


Is there any way I could smooth out the transition between textures? The spacing of the vertices on my map means that I can't get the texture placement super precise and I will always end up with these really awful triangular shaped bits of textures being wrong all over my map.

Does anyone have a method to counteract this?

Thanks!
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 3rd Nov 2009 00:48
In Photoshop, take the overlay image(the texture) and blur and/or smear between the textures

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 3rd Nov 2009 03:38 Edited at: 3rd Nov 2009 03:43
The texture you're seeing in the in-game images aren't image files at all. I have the "Grass" texture, the "rocky moss" texture and the "rock" texture in the same folder as the .x terrain file.

When I dbLoadObject map.x, it appears in the game with the textures in the correct locations. It isn't just one massive texture on top of the object. I can't just open the texture in Photoshop, as it doesn't exist as a single image.

I have tried it with one massive texture over the whole terrain but I need 64 (the terrain is an 8x8 block) 2048x2048 textures to make it look even half decent (trust me, 64 1024x1024 textures eat up an additional 300MB of RAM and kill performance, while still not looking any good).

With that size, the system requirements shoot through the roof, as do load times, RAM usage and compatibility. Any less is just horribly-low resolution and not an ideal option at all.

Loading it the way I am just requires 3 little 256x256 textures, but as you can see it's not blurring the lines between them at all and there appears to be no way to do so.

I never imagined just making a terrain with a little bit of variety would be this incomprehensibly complex and unsuccessful, considering how much of a staple it is in the gaming world.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 5th Nov 2009 01:13
If you look at how the textures are used in the terrain example(detail, and texture) you'll see what i meant as far as the one big texture.

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 5th Nov 2009 01:25 Edited at: 5th Nov 2009 01:27
what would be the procedure as applying a detail texture over a texture on a .x file?

is it is as simple as



after texturing the .x file?

Because I tried once with a grayscale detail texture and ended up with a completely textureless object.

I also fear what will happen with the base/detail system when I need to switch detail textures for creating a different kind of terrain. I will only be able to do so at the edge of the object and there will be an obvious seam where this is done.

I guess my question is, if the terrain can blend nicely in an editor, why isn't that possible to do in a game as well?
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 5th Nov 2009 04:45
i think the best way is to generate a height map for your terrain and then use the GDK functions for texturing

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
action 9000
16
Years of Service
User Offline
Joined: 27th May 2008
Location: Alberta, Canada
Posted: 5th Nov 2009 06:13 Edited at: 5th Nov 2009 06:14
I can't use heightmaps alone because they don't let me change the position of vertices. I did that originally and it worked fine, however I'm trying to switch away from the "Terrain" functions of GDK because of their limitations. I'm looking to further develop my game and I need more finalized maps, which I simply can't achieve without being able to model/produce the maps and load them from external, existing .x, .dbo, .etc files.

Login to post a reply

Server time is: 2024-11-20 11:25:10
Your offset time is: 2024-11-20 11:25:10