News Design Artwork Photos Articles
Creative Commons All use of my digital work is covered by this Creative Commons Deed.
Please do not use any of my work for commercial purposes, thank you.
 Creating Terrain (4 of 7) Previous Page Next Page
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.
Prev Page Next Page
Mememe
Articles 
Level Design -
GameDev Advice -
Creating Terrain -
Terrain Blending -
Rockwall Corridors -
Rockwall Detail -
2 Point Clipping -
Phong Shading -
3D Puzzle Scripting -
Triggerable Shaders -
RTCW Scripting -
Scripted Doors -
Basic Lift -
Advanced Lift -
Cooking -
Apple Crumble -
This site has been cobbled together by Simon O'Callaghan
Contact Information: Simon O'Callaghan
All content is Copyright © 2000-2024
Hosted by ApisNetwork