Editing Darkplaces material system/General Keywords
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | {{navigation title| | + | {{navigation title|Darkplaces material system|General Keywords|Special Keywords}} |
==surfaceparm== | ==surfaceparm== | ||
This is, by the fact, most widely used and most tricky material keyword. | This is, by the fact, most widely used and most tricky material keyword. | ||
− | All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader. | + | All surfaceparm keywords are preceded by the word ''surfaceparm'' as follows: ''surfaceparm nonsolid'' or ''surfaceparm trans''. Each surfaceparm have corresponding q3map_''surfaceparmname'' keyword ('''q3map_nonsolid''', '''q3map_trans''' etc.) which is only acquired by Q3map2. Surfaceparm keywords change the physical nature of the materials and the brushes that are marked with them. Changing any of these values will likely require the map to be re-compiled. These are global and affect the entire shader. |
This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide. | This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide. | ||
Line 40: | Line 40: | ||
:This surface will have no lightmap generated. This will save some memory and make map compilation faster. | :This surface will have no lightmap generated. This will save some memory and make map compilation faster. | ||
:Used by Q3map2 light phase. | :Used by Q3map2 light phase. | ||
− | :{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword. | + | :{{design|This keyword have no effect at vertex-based lighting (lighting calculated for vertices and being saved to their rgba attributes). Surface with no lightmap will be rendered with vertex-based lighting. To disable vertex lignting calculation, use '''q3map_noVertexLight''' keyword.{{ |
'''surfaceparm nonsolid''' | '''surfaceparm nonsolid''' | ||
Line 138: | Line 138: | ||
This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance. | This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the material. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance. | ||
− | ===deformVertexes <nowiki>wave <div> <func> <base> <amplitude> <phase> <freq></nowiki> === | + | ===deformVertexes <nowiki><wave> <div> <func> <base> <amplitude> <phase> <freq></nowiki> === |
:Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]]. | :Designed for water surfaces, modifying the values differently at each point. It accepts the standard [[Darkplaces material system/Key Concepts#Waveform_Functions | waveform functions]]. | ||
:The "div" parameter is used to control the wave "spread" - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world). | :The "div" parameter is used to control the wave "spread" - a value equal to the tesselation distance (see q3map_tessSize, a subdivision size, in game units, used for the material when seen in the game world). | ||
− | |||
− | |||
− | |||
===deformVertexes normal <nowiki><div> <func> <base> <amplitude ~0.1-~0.5> <frequency ~1.0-~4.0></nowiki>=== | ===deformVertexes normal <nowiki><div> <func> <base> <amplitude ~0.1-~0.5> <frequency ~1.0-~4.0></nowiki>=== | ||
Line 150: | Line 147: | ||
:'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up. | :'''IMPORTANT NOTE''': In Darkplaces, offset mapping uses vertex normals for the calculations. deformVertexes normal most likely will mess it up. | ||
:'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results. | :'''Design Notes''': Putting values of 0.1 t o 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
===deformVertexes bulge <nowiki><bulgeWidth> <bulgeHeight> <bulgeSpeed></nowiki>=== | ===deformVertexes bulge <nowiki><bulgeWidth> <bulgeHeight> <bulgeSpeed></nowiki>=== | ||
:This forces a bulge to move along the given S and T directions. Designed for use on curved pipes. | :This forces a bulge to move along the given S and T directions. Designed for use on curved pipes. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===deformVertexes move <nowiki><x> <y> <z> <func> <base> <amplitude> <phase> <freq></nowiki>=== | ===deformVertexes move <nowiki><x> <y> <z> <func> <base> <amplitude> <phase> <freq></nowiki>=== | ||
Line 203: | Line 186: | ||
{{tip|The <nowiki><div></nowiki> and <nowiki><amplitude></nowiki> parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}} | {{tip|The <nowiki><div></nowiki> and <nowiki><amplitude></nowiki> parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.}} | ||
− | == | + | ==dpMeshCollisions== |
− | This | + | Use surface's draw geometry for collision detection instead of generated BSP geometry (some models have no one). This works only if [[BIH]] is enabled. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ==dpPolygonOffset <factor> <offset>== | |
− | Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant | + | Allows arbitrary offsets of a surface's depth during rendering. Material with this keyword are able to stack over rest of geometry with no [[Radiant Glossary | z-fighting]]. Useful for decals. |
Both parameters are optional, if not used, a default factor of 0 and offset -2 is used. | Both parameters are optional, if not used, a default factor of 0 and offset -2 is used. | ||
Line 222: | Line 196: | ||
{{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}} | {{tip|mod_q3shader_default_polygonfactor and mod_q3shader_default_polygonoffset controls default values.}} | ||
− | + | ==dpTransparentSort <nowiki><sort></nowiki>== | |
Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects. | Rendering of blended materials requires software sorting to keep the depth order of geometry. This keyword changes default distance sorting to allow for special effects. | ||
− | * | + | * distance - default distance-based sorting |
− | * | + | * hud - this surface will always be ontop of all another blended materials |
− | * | + | * sky - opposite to hud, this surface will always ve vehing all other blender materials. |
==Per-Pixel Lightning== | ==Per-Pixel Lightning== | ||
Line 245: | Line 219: | ||
===dpGlossExponentMod <nowiki><value></nowiki>=== | ===dpGlossExponentMod <nowiki><value></nowiki>=== | ||
− | Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1). | + | Scales gloss exponent for a surface. Gloss exponent controls how sharp gloss effect is. Low values will make surface matte, higher values will make it look like a covered by a plastic film. Just like intensity mod, this is a multiplier to a value in texture's _gloss alpha (if there is no alpha - base gloss exponent is forced to be 1). |
Typical values are 0.25 (wood), 2.0 (glass). | Typical values are 0.25 (wood), 2.0 (glass). | ||
Line 257: | Line 231: | ||
===dpReflect <nowiki><distortion> <r> <g> <b> <a></nowiki>=== | ===dpReflect <nowiki><distortion> <r> <g> <b> <a></nowiki>=== | ||
Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface. | Make this material reflective. The reflection is alpha blended on the texture with the given alpha, and modulated by the given color. Distort is used in conjunction with the normalmap to simulate a nonplanar water surface. | ||
− | {{ | + | {{design|This is a 'hard' shader that requires much computation time. Each materisl with reflection sets additional render pass, dont allow situation where eye can see 2 or more reflective surfaces at a time.}} |
===dpRefract <nowiki><distortion> <r> <g> <b></nowiki>=== | ===dpRefract <nowiki><distortion> <r> <g> <b></nowiki>=== | ||
Line 276: | Line 250: | ||
===dpReflectCube <nowiki><cubemap></nowiki>=== | ===dpReflectCube <nowiki><cubemap></nowiki>=== | ||
− | Sets static [[cubemap]] texture for reflections. | + | Sets static [[cubemap]] texture for reflections. A _reflect [[skinframe]] texture sets local intensity of reflections and should be presented in order effect to work. Cubemapped reflections alot faster than realtime ones. |
− | + | ||
− | + | ||
Typical usage: | Typical usage: | ||
Line 300: | Line 272: | ||
===dpNoShaderKillIfCvar <nowiki><cvar> <operator> <value></nowiki>=== | ===dpNoShaderKillIfCvar <nowiki><cvar> <operator> <value></nowiki>=== | ||
− | Prevents material from being killed. Have | + | Prevents material from being killed. Have greater proirity over dpshaderkillifcvar. |
===dpShaderKillIfCvarZero <nowiki><cvar></nowiki>=== | ===dpShaderKillIfCvarZero <nowiki><cvar></nowiki>=== | ||
Line 307: | Line 279: | ||
===dpNoShaderKillIfCvarZero <nowiki><cvar></nowiki>=== | ===dpNoShaderKillIfCvarZero <nowiki><cvar></nowiki>=== | ||
Opposite to above. | Opposite to above. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |