Darkplaces material system/Special Keywords
(Created page with "{{navigation | Darkplaces material system | p=General Keywords | c=Special Keywords | n=Stages | caption}} === Q3Map2 Specific Keywords === All of q3map2 specific keywords a...") |
Revision as of 11:47, 23 July 2012
Q3Map2 Specific Keywords
All of q3map2 specific keywords are processed during map compile. If this keywords changes, recompiling the map is required for the changes to take effect.
q3map_globalTexture
- This keyword disables texture coordinates optimization for texture projection on brushes (optimization tries to keep texture coordinates closer to 0-1 range), making them to be related to the world center, not brush. This is useful when applying tcMod scale to several adjastent brushes, which can be wrong if not using this parameter.
q3map_tessSize <amount>
- Controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword.
- IMPORTANT NOTE: Abuse of this can create a huge number of triangles.
q3map_backShader <shadername> This allows a brush to use a different shader on the back side of surface. By way of example, this would allow a water brush (or other) surfaces to have a different appearance when seen from the inside. Design Notes: q3map_backShader is a better alternative to cull none because it is consistent with lighting. Drawback are that it produces more geometry data (larger loading times, more memory required), which may be abusing if surface is used many times.
q3map_sun <red> <green> <blue> <intensity> <degrees> <elevation> This keyword in a sky shader will create the illusion of light cast into a map by a single, infinitely distance light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of q3map. <red> <green> <blue> Color is described by three normalized rgb values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use. <intensity> is the brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance. <degrees> is the angle relative to the directions on the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south. <elevation> is the distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon DESIGN NOTE: Sky shaders should probably still have a q3map_surfacelight value. The "sun" gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the "sun" or "moon" will cast stronger, shadows that have a greater degree of contrast. Design Trick: Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Q3Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.
q3map_surfaceLight <light value> The texture gives off light equal to the <light value> set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the qer_lightimage keyword is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture.
q3map_lightimage <texturepath/texturename> The keyword q3map_lightimage generates lighting from the average color of the TGA image specified by the q3map_lightimage. The keyword sequence for generating light on a q3map_surfacelight should be ordered as follows: 1) q3map_lightimage ; (the texture providing the light and the color of the light) 2) qer_editorimage ; (the editor-only image used to select the source map for the texture) 3) the average color of the light emitted from the shader is calculated from the lightimage.)
q3map_lightsubdivide <value> This allows the user to define how large, or small to make the subdivisions (triangles) in a textured surface, particularly aimed at light-emitting textures like skies. It defaults to 120 game units, but can be made larger (256 or 512) for sky boxes or smaller for light surfaces at the bottoms of cracks. This can be a dominant factor in processing time for q3map lighting.
Editor Specific Keywords
These keywords only affect the texture when it is seen and manipulated in the Radiant editor. They should be grouped with the surface parameters but ahead of them in sequence.
qer_editorImage <textureName>
- This keyword makes level editor to display different texture in 3D viewport.
- The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit.
- Later, Q3map2 will use this texture to generate texture coordinates on brushes.
- Conventions: All textures supplied for qer_editorImage should be stored in radiant/ folder (like radiant/textures/town/wall1_1, radiant/models/mapobjects/crypt/statue1 etc.)
- Design Notes: It is useful to always specify qer_editorImage on materials that could be used on brushes. This will separate material's real texture from the editor texture and give ability to replace game real texture with upscaled/downscaled one without re-editing a map.
qer_trans <N.N>
- This keyword defines the percentage of transparency that a surface will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the surface is 20% opaque and nearly invisible.
qer_alphaFunc <func> <N.N>
- If material have alphaFunc, this keyword will make it to be rendered with alpha test in level editor too.
- Functions are:
- greater - greater than
- gequal - greater or equal
- lesser - lesser than
- lequal - lesser or equal
- equal - equal