ArticleDirectory
- Description of material script
- Texture layer special properties
From http://blog.csdn.net/w1635610/article/details/5454365
Description of material script
Ambient sets the environmental light reflection attribute of the material.
Format: ambient <red> <green> <blue>
The correct value is between 0.0 and 1.0. It directly affects the environmental light reflection capability of object materials. The default value is white (1.0 1.0 1.0 ).
Diffuse: sets the material's diffuse attributes.
Format: diffuse <red> <green> <blue>
The correct value is between 0.0 and 1.0. It directly affects the reflection attribute of the object material on the diffuse light. The default value is white (1.0 1.0 1.0 ).
Specular sets the mirror reflection attribute of the material.
Format: specular <red> <green> <blue> <shininess>
The correct color parameter is between 0.0 and 1.0. The shininess attribute can be any positive number. It directly affects the mirror reflection attribute of the object material. The default value is no mirror reflection (0.0 0.0 0.0 0.0 ).
Emissive sets the brightness of the material.
Format: emissive <red> <green> <blue>
The correct color parameter must be between 0.0 and 1.0. If an object emits light, it does not need outside lighting. However, it is worth noting that this object will not become a light source: it will only light itself. The default value is black (0.0 0.0 0.0 ).
The combination of scene_blend settings and scenarios has two forms:
Format 1: scene_blend <add | modulate | alpha_blend>
This format is relatively simple and commonly used. The parameter meanings are as follows:
Add |
The rendering result will be added to the scene in addition, which is equivalent to scene_blend one. It has good effects on explosion, flame, light, and ghost. |
Modulate |
The rendering result is multiplied by the scene. It has good effects on smoke, glass, and a single transparent object. It is equivalent to scene_blend src_colour one_minus_src_colour. |
Alpha_blend |
The alpha member in the rendering result will be used as a mask. It is equivalent to scene_blend src_alpha one_minus_src_alpha. |
Format 2: scene_blend <src_factor> <dest_factor>
This format is relatively cumbersome, but relatively complete. The formula for calculating the result is (texture * sourcefactor) + (scene_pixel * destfactor). The sourcefactor and destfactor are as follows:
One |
Constant 1.0 |
Zero |
Constant 0.0 |
Dest_colour |
Current vertex color |
Src_colour |
Color of the point corresponding to the texture |
One_minus_dest_colour |
1-(dest_colour) |
One_minus_src_colour |
1-(src_colour) |
Dest_alpha |
Alpha value of the current vertex |
Src_alpha |
Alpha value of the point corresponding to the texture |
One_minus_dest_alpha |
1-(dest_alpha) |
One_minus_src_alpha |
1-(src_alpha) |
Default Value: scene_blend one zero (not transparent)
Depth_check whether to enable deep Test
Format: depth_check <on | off>
By default, deep cache is enabled. It helps to determine the occlusion relationship between two points and the frontend and backend relationship to reflect the three-dimensional sense.
Whether depth_write allows write operations on an existing deep Cache
Format: depth_write <on | off>
By default, if it is disabled, the closed material will always float before all objects.
Depth_func when the deep cache is enabled, select a comparison function.
Format: depth_func <func>
always_fail |
never compare |
always_pass |
always replace the old one with a new one |
less |
Replace the new one when it is smaller than the old one |
less_equal |
Replace the new one that is less than or equal to the old one |
equal |
equal to |
not_equal |
change if not equal to |
greater_equal |
Replace the new one with a value greater than or equal to the old one |
greater |
change if the new one is larger than the old one |
Default Value: depth_func less_equal.
Cull_hardware: hardware cull Mode
Format: cull_hardware <clockwise | anitclockwise | none>
The default clockwise cull. This is the same as OpenGL's default, but opposite to d3d's default. (Because ogre uses the right hand coordinate system used by OpenGL)
Cull_software sets the software cull Mode
Format: cull_software <back | front | none>
Default back. It is equivalent to the clockwise of the hardware cull mode.
Lighting
Set whether the dynamic illumination is enabled for this material. If this parameter is disabled, all ambient, diffuse, specular, emissive, and shading attributes of the material are invalid and only related to the illumination of the outside world.
Format: Lighting <on | off>
Default Value: lighting on
Shading Mode
Format: shading <flat | Gouraud | Phong>
Flat |
Each surface is filled with only one color. |
Gouraud |
Linear transition surface color |
Phong |
Not all hardware supports this mode to determine the color of each vertex. |
Default Value: shading Gouraud.
Filtering
Format: filtering <none | bilinear | trilinear>
Bilinear)
Texture layer special properties
Texture: Specifies the image name to be used for the texture.
Format: texture <texturename>
No default value. A Texture name must be specified.
Anim_texture animated texture
Specifies the image file name used by the animation texture.
Format 1 (short): anim_texture <base_name> <num_frames> <duration>
Specify an image name with the suffix _ 1, _ 2 until _ num (specified by num_frames), and the duration interval.
Format 2 (long): anim_texture <frame1> <frame2>... <duration>
Specify the image name and the duration interval.