This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ded:material_syntax [2017-03-19 21:07] – skyjake | ded:material_syntax [2017-03-19 21:13] (current) – skyjake | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | Material { | ||
| + | ID = "" | ||
| + | Width = 0.0 | ||
| + | Height = 0.0 | ||
| + | Flags = flag1 | flag2 | ||
| + | Layer { | ||
| + | Stage { | ||
| + | Texture = "" | ||
| + | Offset { 0 0 } | ||
| + | Tics = 0 | ||
| + | Rnd = 0 | ||
| + | Glow = 0.0 | ||
| + | Glow Rnd = 0.0 | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Light { | ||
| + | Pattern offset { 0 0 } | ||
| + | Pattern skip { 0 0 } | ||
| + | Stage { | ||
| + | Offset { 0 0 } | ||
| + | Distance = 0.0 | ||
| + | Tics = 0 | ||
| + | Rnd = 0.0 | ||
| + | Color { 0 0 0 } | ||
| + | Levels { 0 0 } | ||
| + | Radius = 0.0 | ||
| + | Bottom map = "" | ||
| + | Side map = "" | ||
| + | Top map = "" | ||
| + | Halo radius = 0.0 | ||
| + | Flare map = "" | ||
| + | Flare texture = 0 # deprecated | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== ID ==== | ||
| + | |||
| + | [[:uri]] by which the material will be known. The ID is used when applying the material directly to a world surface (for example, in a [[: | ||
| + | |||
| + | Currently there are **4** recognized [[: | ||
| + | * flats | ||
| + | * sprites | ||
| + | * system | ||
| + | * textures | ||
| + | |||
| + | The [[: | ||
| + | |||
| + | ==== Height/ | ||
| + | |||
| + | The dimensions of the material, in world units. | ||
| + | |||
| + | The material dimensions need not equal those of the texture(s) used by it's [[# | ||
| + | |||
| + | |||
| + | ==== Flags ==== | ||
| + | |||
| + | |||
| + | ^ Name^ Description | | ||
| + | | dontdraw| Surfaces with this material will never be drawn. | | ||
| + | | skymask| Surfaces with this material will cut a " | ||
| + | |||
| + | |||
| + | |||
| + | ==== Layer ==== | ||
| + | |||
| + | Currently only **1** layer is supported in a material. (Support for more layers will be added later). | ||
| + | |||
| + | |||
| + | ; Stage | ||
| + | : Stages are used for animating the properties of a texture layer over time. A layer can have many stages and will cycle through each in the defined order. | ||
| + | ; Texture | ||
| + | : [[:uri]] of the [[: | ||
| + | ; Offset | ||
| + | : Offset to the texture origin in material space. | ||
| + | ; Tics | ||
| + | : Length of the stage in tics. | ||
| + | ; Rnd | ||
| + | : Random value to be applied to tics. | ||
| + | ; Glow | ||
| + | : Strength of the light emitted by this material (self-illumination). | ||
| + | ; Glow Rnd | ||
| + | : Independent glow strength randomization factor. | ||
| + | |||
| + | |||
| + | ==== Light (1.10 →) ==== | ||
| + | |||
| + | {{ file: | ||
| + | |||
| + | For each world surface using the material, Doomsday will automatically project lights into the world relative to the [[http:// | ||
| + | |||
| + | |||
| + | === Pattern offset === | ||
| + | |||
| + | Used with pattern skip to offset the origin of the pattern. For example: | ||
| + | Pattern offset { 1 0 } # shift the origin of the pattern one full horizontal repeat | ||
| + | |||
| + | |||
| + | === Pattern skip === | ||
| + | |||
| + | Normally the light is repeated on a surface as many times as the texture or flat repeats. The pattern skip values allow sparser repeats for horizontal and vertical patterns, respectively. For example: | ||
| + | | ||
| + | Pattern skip { 1 2 } #> light appears on every second horizontal repeat | ||
| + | and every third vertical repeat. <# | ||
| + | |||
| + | |||
| + | |||
| + | === Stage === | ||
| + | |||
| + | Stages are used for animating the properties of a light over time. Each light can have many stages and will cycle through each in the defined order. | ||
| + | |||
| + | Using stages it is possible to animate a wide variety of interesting lighting effects. | ||
| + | |||
| + | |||
| + | ; Tics | ||
| + | : Length of the stage in tics. | ||
| + | ; Rnd | ||
| + | : Random value to be applied to tics. | ||
| + | ; Offset | ||
| + | : Origin of the light in material space coordinates. | ||
| + | ; Distance | ||
| + | : Distance of the light from the surface, in world space units. Doomsday will //project// from the light origin along the surface normal to calculate the 3D position of the light in world space. | ||
| + | ; Color | ||
| + | : RGB color/ | ||
| + | ; Radius | ||
| + | : Radius of the light in world space. | ||
| + | ; Levels | ||
| + | : Two integers (0-255) that mark the sector light levels where the light is at zero and maximum brightness, respectively. The first level can be higher than the second. The behavior is then reversed: the light is at full brightness only below the lower light level. For example:< | ||
| + | Levels { 100 200 } #> Not visible below light level 100 and fades to | ||
| + | full brightness when nearing light level 200. | ||
| + | | ||
| + | </ | ||
| + | ; Bottom/ | ||
| + | : Name of the light map to use when casting light in that direction. The //bottom// map is used for floor planes, the //top// map for ceiling planes and the //side// map for walls. If left blank (the default), the default linear falloff texture for round lights is used. Use '' | ||
| + | ; Halo radius | ||
| + | : Radius of the halo/flare in screen space. Zero means no halo is rendered. < | ||
| + | ; Flare map | ||
| + | : Name of the flare map (i.e., texture) to use for the halo. For example:< | ||
| + | ^ ID^ Description | | ||
| + | | 0| Smart algorithm which selects a built-in flare map dynamically, | ||
| + | | 1| [[http:// | ||
| + | | 2| Inverse diffraction disc. | | ||
| + | | 3| [[http:// | ||
| + | | 4| Burst with cross formation of [[http:// | ||
| + | |||
| + | For example:< | ||
| + | |||
| + | === Flare texture (deprecated) === | ||
| + | |||
| + | Built-in flare map (i.e., texture) ID to use for the halo. | ||