multitexture with alphamaps
Hello,
I can do multitextureing with the ARB extension, but I would like to be able to define alpha values with each vertex for each layer. I've been thinking about writting a shader....but I would rather not. Any ideas?
It's for terrian textureing, basiclly there is a base layer but to breakup the repetition I want to be able to put in more layers but only have it laid on top at certain places (with an alpha map).
Short answer: do a shader.
Long Answer: Break the terrain into several patches and texture/render each part separatly.
I asked the same question a while ago, and I got the answer that it cant be done per vertex using regular multitexturing...
I guess one could use a separate alpha map that covers the entire terrain for each texture, but that's a huge memory loss comparing to using a shader.
Long Answer: Break the terrain into several patches and texture/render each part separatly.
I asked the same question a while ago, and I got the answer that it cant be done per vertex using regular multitexturing...
I guess one could use a separate alpha map that covers the entire terrain for each texture, but that's a huge memory loss comparing to using a shader.
Yeah I was afriad of that.
I`ll post the shader here once I'm done, since I`m willing to bet I'm not the only one with the same problem.
I`ll post the shader here once I'm done, since I`m willing to bet I'm not the only one with the same problem.
Well, as prommised.
I've done it and it works great.
It uses 4 tiled textures and 3 small(very) greyscale images for alpha on each layer. AND it renders in one pass.
I was wondering if terrain rendering like that exisits yet. If not, instead of posting it all here, I'll write an aritcle.
Please tell me if you'd like to hear how I did it, and if it already exisits.
I'd post a screen, but I have no idea how.
I've done it and it works great.
It uses 4 tiled textures and 3 small(very) greyscale images for alpha on each layer. AND it renders in one pass.
I was wondering if terrain rendering like that exisits yet. If not, instead of posting it all here, I'll write an aritcle.
Please tell me if you'd like to hear how I did it, and if it already exisits.
I'd post a screen, but I have no idea how.
I would be interested to see your solution. I did have the same problem, but solved it with a procedural approach. Generate a base terrain texture at initialisation, splat other textures here and there based on various things like slope, height etc, and then finally stretch that texture across the terrain in one pass with a multitexturing detail texture (2 texture units). This is the result. If you dont mind posting up your solution I would be happy to see how it works and learn from it.
F451
[Edited by - Fahrenheit451 on December 3, 2005 12:03:58 PM]
F451
[Edited by - Fahrenheit451 on December 3, 2005 12:03:58 PM]
Very nice indeed. Much more realistic than my attempts without shaders. I think your idea of an article or post on this topic would be great. I would certainly like to read it and see a demo. Nice job.
F451
F451
Not bad. So far I have always been boring. Old approach used 2-4 tiled color detail textures, 1 blend map and a color base map, the second is somewhat less colorful but much more efficient and still good looking and using 1 color base texture, 4 greyscale detail textures (1 per channel) and 1 blendmap.
Formula for the latter is about as simple as it gets:
color = base * dot(detail, blend)
and looks like this
new (shamelessly using the farcry demo map/textures for comparison and severe lack of artistic talent)
The older version was a bit sicker, because I wanted to be able to override the detail mix. So the base map as shifted, scaled, added. Result being that a value of 128 didn't change anything, values between 64 and 172 were giving a nice "tint" while more extreme values started to drown out the detail textures.
old
(an old editor is flying around but only working with nvidia cards for all the proprietary extensions.. not so great with my current ati)
Formula for the latter is about as simple as it gets:
color = base * dot(detail, blend)
and looks like this
new (shamelessly using the farcry demo map/textures for comparison and severe lack of artistic talent)
The older version was a bit sicker, because I wanted to be able to override the detail mix. So the base map as shifted, scaled, added. Result being that a value of 128 didn't change anything, values between 64 and 172 were giving a nice "tint" while more extreme values started to drown out the detail textures.
old
(an old editor is flying around but only working with nvidia cards for all the proprietary extensions.. not so great with my current ati)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement