hey, im interested on learning the dotproduct 2 method of blending textures, but ive searched all over the place and cant find anything. could someone help me out? thanks!
dotproduct 2 blending
Search for ‘Terrain Alpha Blending’ – I think that is what sock called his topic when he discussed it…
yeah ive read that, but i didnt see any description of the method of how to go about doing it, unless i missed it completely
It’s done with shaders…the compiler ‘blends’ the two terrain textures due to the two surface normals…you can’t do it in radiant (just read your other post)
yeah, im not meaning to do it in radiant, the only thing i gotta do in radiant is just put in the new shader. im just looking for the shader file contents 
yeah i just saw that lol. im going through now trying to get it to work, ill let ya know how successful i am.
so far, i:
- made a texture to recognize in radiant for the blend indication, named “omahablend.tga” its just a red and white checkered texture with “BLEND” written on it
- made a grass texture with an alpha channel at 90% bright named “grass.tga”
- made a darker grass texture with alpha at 90% bright named “grassdark.tga”
now im working with the shader to get it to work. ill let ya know if and when i run into problems
ok ive got my shader looking like this:
textures/omaha/omahablend
{
qer_editorimage textures/common/ter_rock1grass1.tga
q3map_lightImage textures/omaha/grass.tgaq3map_forceMeta
q3map_nonplanar
q3map_shadeAngle 179
q3map_lightmapAxis zq3map_tcGen ivector ( 2048 0 0 ) ( 0 2048 0 )
q3map_tcMod rotate 33
q3map_alphaMod dotproduct2 ( 0.1 0 0.8 )
q3map_lightmapSampleSize 64
q3map_globalTexture{
map textures/omaha/grassdark.tga
tcMod scale 8 8
rgbGen identity
}
{
map textures/omaha/grass.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaFunc GE128
rgbGen identity
alphaGen vertex
tcMod scale 8 8
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/omaha/detail_1.tga
blendFunc GL_DST_COLOR GL_SRC_COLOR
rgbgen identity
tcMod scale 4 4
detail
}
}
but i have ZERO clue as to what that last detail_1.tga is for. any ideas?
Here’s the thread where this technique was introduced to the Q3 world by ydnar. The tutorial portion of the thread starts here:
http://www.quake3world.com/ubb/Forum6/HTML/026889.html#24
This thread explains everything.
That in combination with the texture’s alpha channel. The alpha channel plays a large part in whether or not the blending looks nice.
ok. i may need to find a different method of blending, probably vertex blending (where it blends evenly from one vertex to the other.) call of duty uses this when you paint your alpha channel.
is there a such thing as vertex-vertex blending, or do i need to figure out how to do this on my own?
but i have ZERO clue as to what that last detail_1.tga is for. any ideas?
Its just used to breakup the look of repeating of textures. It adds light/dark variety to the overall look of the texture across a large section of brushwork.
ok. i may need to find a different method of blending, probably vertex blending (where it blends evenly from one vertex to the other.) call of duty uses this when you paint your alpha channel.
is there a such thing as vertex-vertex blending, or do i need to figure out how to do this on my own?
Alpha blending is done via a greyscale image which lines up with the triangle grid vertices. Your traditional vertex blending if you are familiar with modelling packages and stuff. The blending is always from one texture to another. (No gradual blending is supported across multiple vertex points)
Another type of blending is colour vertex blending so you can make the texture at the vertex point light or darker or a different colour. Not currently supported with q3map2 or ET.
In the beginning ID created a TA system you could create terrain from triangle tiles in a fixed sized grid. This needed an alpha map (a 256 greyscale image) to control where the blends could happen. They were limited to 2 blends at anyone time and could have up to 256 terrain textures. The textures were done via a metashader (a special shader type) and could get very long and messy if you have alot of different terrain textues to blend.
The MOH team created a system with patches and had a LOD feature so you could have more detailed terrain but up close. Worked very similar to the ID system and used alpha maps and metashaders.
The DICE team created a system with one large mesh which you could push/pull up or down, paint directly onto the terrain any alpha blends and colour vertex blends. A very nice editor existed for it (BattleEditor) which made creating nice looking terrain a doddle.
I believe the COD team still use patches as before but you can add/subtract patches based on blends. (This what I understand from a tutorial I saw of it) It supports LOD detail as before but gives you the ability to control the degree of blending over a certain amount of vertex points. (Very good idea for creating gradual blends)
The SD team used the ID system and also used lightmaps instead of vertex light. The metashader was made simplier by adding base shaders so you can create templates for stuff.
Ydnar created 2 new terrain blending systems. The first one allows you to have terrain triangles any size but the alpha blending is based on vertex normal. Which you can control via the height of the brushwork. With clever planning you can create the illusion of cool terrain details.
The second version uses a triangle mesh model, an alpha map and height map. The traingle mesh is controlled in the editor via the height map. Its a cool idea but the interface is not easy to use.
Sock
:moo:
yeah, im basically looking to use the alpha blending, say have 100% sand 0% grass at one vertex and 0% sand 100% grass at the next. i talked with ratty redemption last night, and im goin on break for a week, but when i get back im gonna work with him on this. i still have yet to see a decent dedicated tutorial to blending, so, with extreme amounts of his aid, im going to write one.
yeah, I couldnt help dime when he first asked me, as I was in the middle of changing how I combine dotproduct and alphamap blends, and wasnt sure if my new method was going to work.
but now I`m pretty confident this latest rebuild of my test map, is the best way I know of building by hand and blending terrain maps, although I know some of you guys can help me improve this further.
so when dime gets back we`re going to start work on a tutorial, which I personally would like to be an ongoing guide to any blending used in q3 engine terrain maps, including:
-
step by step basics like smooth grass to rock blends using alphamaps and meta shaders.
-
the more advanced dotproduct blends, and how to optimize them so we have as little overdraw as possible.
-
combining them together and covering up any seems that appear between alphamap and or dotproduct surfaces.
-
my soft edge water, eg flowing streams that can split at junctions and smoothly flow in different directions, water falls, water fall mist etc.
-
details like small rocks and boulders, foliage, eg how to make trees, plants etc.
and anything else natural looking.
are there many tutorials on trisouping?
because I`m thinking of starting off our terrain blending tutorials with some on brush work as it would be easier if all the screen shots followed on from each other.
what do you guys think?
are there many tutorials on trisouping?
There is one by megaman44 located here : http://www.alienculture.net/team/megaman/tutorials/trisouping/index.htm
Im also planning on writing one to compiliment the existing rock articles I’ve already put together. Probably have a first draft this weekend. I’ve had alot of requests to write “phong shading”, “brush shearing” and “tri-souping” articles.
Sock
:moo:
you wouldn’t have any good tutorials on how to do the initial planning of a map do you? Like planning gameflow, themes, connectivity, integrating neat things you want to try, etc?
you wouldn’t have any good tutorials on how to do the initial planning of a map do you? Like planning gameflow, themes, connectivity, integrating neat things you want to try, etc?
It really depends on the amount of request from people wanting something like that. Writing any tutorial/article is a nightmare on time and resources and I only have so much of it!
Sock
:moo:
There is one by megaman44 located here : http://www.alienculture.net/team/megaman/tutorials/trisouping/index.htm
Im also planning on writing one to compiliment the existing rock articles I’ve already put together. Probably have a first draft this weekend. I’ve had alot of requests to write “phong shading”, “brush shearing” and “tri-souping” articles.
@sock, thanx and I think that was the one we were looking for which used to be linked from kat`s site but I guess megaman44 moved it.
cool that you planning on a trisouping tutorial… saves me doing one 
but perhaps you could share your map files, so dime and I can use them to make our blending tutorials? …or do you think it would be better if we made our own?
Im guessing from what Ive seen of your tutorials, that there will be some things we do differently… if anything, people might be interested in the editor images I use to paint dotproduct and alpha blends onto my terrain.
@Ifurita, Im actually a sp rtcw mapper, but Ive been recently building a large terrain map for some one who is going to build a castle on it for et… iow, I personally have little idea of what makes a good mp.