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. | + | '''NOTE''': This document skips all Q3map2 surfaceparms that is not used by Blood Omnicide. |
− | ===General surfaceparms=== | + | === General surfaceparms === |
'''surfaceparm alphashadow''' | '''surfaceparm alphashadow''' | ||
:This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world. | :This keyword applied to a side on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world. | ||
:Used by Q3map2 light phase. | :Used by Q3map2 light phase. | ||
− | : | + | :'''Design Notes''': Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. It is possible to increase the resolution of the lightmap receiving the shadows with a slight the cost of memory. This can be achieved with the '''q3map_lightmapSampleSize''' keyword on the shadow receiving shader or by creating a [[func_group]] of the shadow receiving brushes and adding the '''_ls''' key with a floating-point value for the scale of the lightmap. |
'''surfaceparm detail''' | '''surfaceparm detail''' | ||
Line 22: | Line 22: | ||
:Assigns to the material the game properties set for lava. This affects contents of the brush. | :Assigns to the material the game properties set for lava. This affects contents of the brush. | ||
:Used by engine (BIH collision) and q3map2 (bsp phase). | :Used by engine (BIH collision) and q3map2 (bsp phase). | ||
− | : | + | :'''Design Notes''': This keyword is used on common/ilava material. |
'''surfaceparm lightfilter''' | '''surfaceparm lightfilter''' | ||
Line 35: | Line 35: | ||
:Prevents engine from spawning decals for this surface. | :Prevents engine from spawning decals for this surface. | ||
:Used by engine renderer. | :Used by engine renderer. | ||
− | : | + | :'''Design Notes''':Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks. |
'''surfaceparm nolightmap''' | '''surfaceparm nolightmap''' | ||
: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 Notes''': 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 49: | Line 49: | ||
:Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp. | :Assigns to the material the game properties set for slime. In Blood Omnicide, slime is a swamp. | ||
:Used by engine (BIH collision) and q3map2 (bsp phase). | :Used by engine (BIH collision) and q3map2 (bsp phase). | ||
− | : | + | :'''Design Notes''': This keyword is used on common/islime material. |
'''surfaceparm trans''' | '''surfaceparm trans''' | ||
:Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. | :Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. | ||
:Used by q3map2 BSP phase. | :Used by q3map2 BSP phase. | ||
− | : | + | :'''Design Notes''': Any materials that have blendfunc's should be marked as surfaceparm trans (anything behind them will not get culled). |
'''surfaceparm water''' | '''surfaceparm water''' | ||
:Assigns to the material the game properties set for water. This affects both the surface and the content of a brush. | :Assigns to the material the game properties set for water. This affects both the surface and the content of a brush. | ||
:Used by engine (BIH collision) and q3map2 (bsp phase). | :Used by engine (BIH collision) and q3map2 (bsp phase). | ||
− | : | + | :'''Design Notes''': This keyword is used on '''common/iwater''' material. |
− | ===System surfaceparms=== | + | === System surfaceparms === |
This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials. | This is surfaceparms is only used in [[common materials]]. You dont need to specify them on your new materials. | ||
Line 88: | Line 88: | ||
:Used by q3map2 BSP phase. | :Used by q3map2 BSP phase. | ||
− | ===Custom surfaceparms=== | + | === Custom surfaceparms === |
This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound. | This surface parameters are defined by [[custinfoparms.txt]] and used to assign a game-related properties to material, such as hit effect and step sound. | ||
Line 115: | Line 115: | ||
* plan | * plan | ||
− | + | '''IMPORTANT NOTE''': Blood Omnicide allows only one game-physics surfaceparm per material. | |
− | ==cull none== | + | == cull none == |
Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.). | Every surface of a polygon has two sides, a front and a back. Typically, we only see the front side. For example, a solid block you only show the front side. In some situations we see both (grates, screens etc.). | ||
Line 123: | Line 123: | ||
To "cull" means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible. | To "cull" means to remove. This keyword allows to disable side culling, so both sides of the surfaces would be visible. | ||
− | + | '''NOTE''': Realtime lighting and lightmaps dont work well with twosided surfaces, caused back side to be lit same as front. To avoid that, should create two one-sided surfaces in game. | |
− | + | '''Design Notes''': When making things like grates and screens with [[Brush | brushes]], put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture. | |
− | + | == deformVertexes == | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ==deformVertexes== | + | |
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>=== | + | |
:This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect. | :This deformation affects the normals of a vertex without actually moving it, which will effect later material options like lighting (especially specular) and environment mapping (see stage specific keywords for tcGen environment). If the materialdon't use normals in any of their calculations, there will be no visible effect. | ||
Line 151: | Line 141: | ||
:'''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>=== | + | |
:This keyword is used to make a brush, curve patch or model appear to move together as a unit. The <x> <y> and <z> values are the distance and direction in game units the object appears to move relative to it's point of origin in the map. | :This keyword is used to make a brush, curve patch or model appear to move together as a unit. The <x> <y> and <z> values are the distance and direction in game units the object appears to move relative to it's point of origin in the map. | ||
:The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base. | :The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base. | ||
:It must be noted that an object made with this shader does not actually change position, it only appears to. | :It must be noted that an object made with this shader does not actually change position, it only appears to. | ||
− | : | + | :'''Design Notes''': If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart. |
− | ===deformVertexes autosprite=== | + | === deformVertexes autosprite === |
:This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the "sprite" on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square. | :This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a [[sprite]] without having to make it a separate entity. This means that the "sprite" on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in an .md3 model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square. | ||
− | : | + | :'''Design Notes''': This is best used on objects that would appear the same regardless of viewing angle. An example might be a glowing light flare. |
− | ===deformVertexes autosprite2=== | + | === deformVertexes autosprite2 === |
:Is a slightly modified "sprite" that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room. | :Is a slightly modified "sprite" that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room. | ||
− | ===Specific parameter definitions for deform keywords=== | + | === Specific parameter definitions for deform keywords === |
'''div''' | '''div''' | ||
Line 199: | Line 175: | ||
'''frequency''' | '''frequency''' | ||
− | :See Wave Forms in the introduction for a description of frequency | + | :See Wave Forms in the introduction for a description of frequency/ |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | '''Design Notes''': 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. | |
− | + |