News Design Materials Articles
 Creating Terrains - Patchwork Shaders  Page 4 of 7
Patchwork Shaders The Alpha Fade system uses a special set of shaders which are only visible in the editor. These textures are colour coded and have a percentage number which indicates the level of the alpha transparency.

The shader file supplied with the example map for this article has 6 standard defined percentage values of 0,25,50,75,85 and 100. Other values are possible as the alpha range is 0 to 100 percent. (Actual shader values are 0.0 to 1.0)

Certain alpha values work better than others, but ultimately it always depends on the alpha channel of the texture and the DotProduct2 parameters used.

Good additional values to try are 70,80 and 90 as they produce nice fine blends ideal for gradual slopes or borders.
 Alpha Fade Shader explained
01
02
03
04
05
06
07
08
09
textures/terrain_example/alpha_000	// Primary texture ONLY
{
	q3map_alphaMod volume
	q3map_alphaMod set 0
	surfaceparm nodraw
	surfaceparm nonsolid
	surfaceparm trans
	qer_trans 0.75
}
  • Line 1 : the name of the shader is prefixed with an 'alpha_' to help with sorting in the texture window. Remember these shaders can go anywhere you like, but for this example I have included them in the same directory as the rest of the resources.

  • Line 3 : Tells the compiler that this is a special Alpha Fade Shader. A brush must use this shader on all sides otherwise it will not work correctly. This is a volume function similar to water, fog etc.

    All vertex points enclosed within a brush painted with this shader will have their alpha values changed. This process can also be fine tuned by the use of  func_group entities. Meaning that the Alpha Fade function will only try and affect brushes which are included in the same func_group and nothing else.

  • Line 4 : Tells the compiler what value to set the alpha channel fade to. This is a specific value and will discard any previous value found. The possible range of values which can be used is 0.0 to 1.0.

  • Lines 5-8 : Various shader commands to remove this shader surface from the game and set the transparency of the shader in the editor.

    Special note: All Alpha Fade brushwork can be filtered in the editor with ALT+4 (Translucent) when the shader command 'qer_trans' is used.
 Back on the path
Back on the path The terrain shader is setup with the moss as the primary texture (alpha 0) and the mud as secondary. (alpha 100) The Alpha fade editor brushes are clearly marked to help see which is primary and secondary.

The first problem is that the path lacks any kind of definition, so use the Alpha Fade brushes as poles and plot out a route. remember to use the alpha 100 shader as its the secondary texture which is required.

Once the initial path line is in place, then check to see what the terrain looks like in game. Always try to allow the DotProduct2 system to create the blends first and then fine tune the terrain afterwards. Otherwise you will end up with a lot of Alpha Fade Brushes and not much organic looking blending.
Mememe
Articles 
General -
Creating Terrain -
 2  3  4  5  6  7  - Pg  
Blending Terrain -
 2  3  4  5  6  - Pg  
Rockwall Corridors -
 2  3  4  - Pg  
Rockwall Detail -
 2  3  4  - Pg  
2 Point Clipping -
 2  3  4  - Pg  
Phong Shading -
 2  3  - Pg  
RTCW -
Scripted Doors -
Basic Lift -
Advanced Lift -
Links 
Places -
Crytek -
D-Budapest -
FreeSound -
Func_Msgboard -
GTKRadiant -
Indy Developers -
Indy Portal -
..::Lvl Maps -
Q3 World -
Q3map2 -
Raven Software -
Relic Entertainment -
Splashdamage -
Tigsource -
WoLD -
People -
Ken Beyer -
Chad Bordwell -
Matthew Breit -
Andrew Dunn -
Ford Dye -
Mark Fry -
John Fitzgibbons -
Garth Hendy -
Robert Hodri -
Fred Hooper -
Alex Ivanchev -
Mark Kilborn -
Steven Krzanich -
Raphael van Lierop -
Nikolai Mochilchock -
Joel McDonald -
Randy Reddig -
Justin Sanchez -
Jochum Skogland -
Benoit Stordeur -
Tom Waters -
Andrew Weldon -
Pat Williams -
Info -
LinkedIn -
Moby Games -
GiantBomb -
Garage Games -
Newsground -
Game Artisan -
Archive 
2010 - 2009 -
2008 - 2007 -
2006 - 2005 -
2004 - 2003 -
2002 - 2001 -
Firefox 3 Valid HTML 4.01 Transitional
Mememe