Landscape texturing

Started by
2 comments, last by zedzeek 19 years, 6 months ago
It's time to texture my landscape and this part makes me a bit confused. I do the landscapes in maya and import them directly, so I won't have a heightmap like landscape where all xz-points only have one y-value for example. Neither will it be a nice symmetric grid when looking from above. I don't want to have different textures depending on height which is also a common method. I want to be able, in maya, to use 3d paint tool. With this tool you paint on the surface and then can export that texture. Say for example that I do a totally flat surface and fill it with green and then paint a nice little "road" through it. This road should be of mud and for a fantasy game, so no tarmac here ;) However, this texture works well but is of course way to stretched. So I apply a detail texture. This works but isn't really that nice since I have the same detail on grass and mud for example. So I was thinkin about this: If I use this big stretched texture to just determine what textures should be where. For example: I fill the texture with green (grass) and then I draw the road with blue (mud) and then I do some mountains and fill their tips with red (rock/mountain). Between these collors there is a smooth "mix" of the colors. So in my code I use grass, mud and rock textures that are fine in detail but needs to be tiled ... say 20x20 times over the landscape. Then I take this stretched texture that says which of these three smaller textures should be shown at different places. So kind of an alpha map but with RGB instead. In my opiniion this would all go in one pass with 4 multitextures. If this is impossible I guess I could do it in three steps: First step: tile grass and blend with grass-alpha-map Second step: tile mud and blend with mud-alpha-map Third step: tile rock and blend with rock-alpha-map The result I want is 3 different textures that all have high detail mapped over one big landscape. The change from grass to mud for example should be smooth (in the example the "RGB-map" would have a mix of green and blue). I was thinkin of texture splatting to do this but then I had to choose which polys/points in maya that should be another texture. When workin in maya it's MUCH more simple to just draw a road then to pick polys/points, and the result is smoother if you can draw.
Advertisement
if im reading u right u wanna do this
tex0 grass
tex1 mud
tex2 rock
tex3 blending amount R=grass,G=mud,B=rock

with a card that has 4 textures + glsl eg (gffx5200) u can do this easily in one pass

vec3 AM = normalize( tex3.rgb );
gl_Fragment_color = vec4( tex0 * AM.r + tex1 * AM.g + tex2 * AM.b, 1.0 )

with lesser cards u will need to do more passses


Well that sounds nice. Thats exactly what I mean if I can tile tex0, tex1 and tex3. I can't use them stretched.

And how does gl_Fragment_Color work? Well I haven't even tried searching on it yet so... But if you could give a more precise example I would be grateful ;)

Since you wrote gffx5200 I guess my gf4mx won't do the trick hehe. Well I'm about to order new stuff any day now. Is it the gl_Fragment_Color that isn't supported by older cards?
>>And how does gl_Fragment_Color work? Well I haven't even tried searching on it yet so... But if you could give a more precise example I would be grateful ;)<<

this example
vec3 AM = normalize( tex3.rgb );
gl_Fragment_color = vec4( tex0 * AM.r + tex1 * AM.g + tex2 * AM.b, 1.0 )
is pretty much the exact code required to make it work, ie its real real simple.

though u need glsl (glshading language) check the opengl website for info about this. unfortunatly the gf4mx doesnt support glsl, not to mention it only has 2 textureunits thus theres no way u can do it one pass (even without glsl).
my advice would be to invest is a cheap shader card eg gffx5200, which maybe a bit slower than a gf4mx but is a lot more powerful

This topic is closed to new replies.

Advertisement