Dot Product blending One sided


(DAbell) #1

Well i have been doing a bit of playin with the dotporduct 2 business i can get some nice results but if you look at the pics in the link below.

you will see that i either get blending on one side or the other.

the images 1 & 2 show the result of using

q3map_alphaMod dotproduct2 ( 1 -0.75 0.5 )

then image 3 shows what happens if i use

q3map_alphaMod dotproduct2 ( -1 -0.75 0.5 )

Has anyone else suffered with this problem is there an easy solution or do i just have to use 2 different shaders for the different sides of the outcrop.

Thanks

<DJ>


(obsidian) #2

The way dotproduct works is that you specify one vector from which the blending falloff occurs. If trying to have it work from two different vectors (directions) as in your case, it won’t do what you’re looking for. I ran into this similar problem when I was experimenting with dotproduct terrain when the feature was first introduced.

One difficult workaround is to create separate shaders for each different side of the outcrop as you mentioned. This however, is not a pretty way of implementing this.

If you’re looking for more control over your terrain blending, dotproduct terrain does not allow this. It’s mainly used for simplicity (as opposed to old-school alphamapped terrain) and to provide some basic default terrain blending. For more control, we use the q3map_alphaMod volume technique. You can specify the exact amount and location of where the alpha blend occurs. You are free to use dotproduct terrain in conjunction with volume to provide the most natural terrain blending while maintaining total control. This is by far the better and easier solution.

A few alphaMod volume tutorials have been written by other people on this forum so just search for them and they’ll prove useful.

As well, this is probably the most thorough tutorial that I’ve come across as yet:
http://www.planetquake.com/simland/pages/articles/terrain1_1.htm


(ratty redemption) #3

agreed, the best way to build terrain now is definitely dp2 + alpha volume blending, it`s such a powerful system to work with.

and I highly recommend starting with socks tutorial there since it`s very well written, plus mine on this forum is out of date, since it was written before sock and ydnar made the latest developments to terrain blending.

Im still working on some et and ja sample maps, which Ill release on this forum when their ready, but Ive recently replaced all the various blending methods Ive worked with in those maps, with just dp2 + alpha volume since they give the best control over what we`re working with.

and after reading socks tutorial, Im even finding the terrain mapping more fun now, since I adopted a few of his construction methods, mainly the clearly defined editor image approach and his alpha volume ‘fence poles’ which are quicker to work with then the sheered alpha brushes I was using.


(DAbell) #4

Thats great at least it will stop the constant shader tweaking and recompiling that i have been doing trying to rectify the problem. So to summarise your comments (stop me if i get this completely wrong) i should allow the dotproduct to do its blends where it can and in areas where i need it force the blend using the alpha mod brushes.

Well thank you so much.

Also i know this is not the place to ask but do you know how to create a ET config file that will start the game with /g_gametype 2 and /sv_pure 0 and all that, cos i’m really getting bored of typing that in all the time.

Thanks for all your help.

<DJ>


(D-Mode) #5

This should do it?

  1. Create new shortcut to ET.
  2. Right-click on the new shortcut and select Properties from the popup menu
  3. In the Target edit box, add the following parameters (separated by spaces) after the text currently in the edit box.
    +sv_pure 0
    +g_gametype 2

Example:

“C:\Program Files\Wolfenstein - Enemy Territory\ET.exe” +sv_pure 0 +g_gametype 2


(ratty redemption) #6

i should allow the dotproduct to do its blends where it can and in areas where i need it force the blend using the alpha mod brushes.

yep, although this new method will still need some tweaking to get the desired blending, but usually just by testing which alpha volume shader to use in the map.

also if you can`t get the stock ones to work, eg 0%, 25%, 50%, 75%, then you can copy one of those shaders and change the q3map_alphamod line, here are a couple of volume shaders I use a lot if I want just a slight bias towards the primary or secondary tex in the dp2.

textures/_ratty_terrain/alpha_47
{
	qer_editorimage textures/_ratty_terrain/qer_alpha_arb.tga
	q3map_alphamod volume
	q3map_alphamod set 0.47
	surfaceparm nonsolid
	surfaceparm nodraw
	surfaceparm trans
}

textures/_ratty_terrain/alpha_53
{
	qer_editorimage textures/_ratty_terrain/qer_alpha_arb.tga
	q3map_alphamod volume
	q3map_alphamod set 0.53
	surfaceparm nonsolid
	surfaceparm nodraw
	surfaceparm trans
}

the editor image is just a generic place holder I use as I havent yet got round to making the new ones yet, but you can make your own by copying socks example and just changing the value used in a paint program, also your probably want to change the paths to suit your own shaders.