Ogre engine particle system

Source: Internet
Author: User

Entity)

An object is a specific instance of a movable object in a scenario. The only assumption is that it does not have a fixed position in the world space.

.
An object must be connected to a node to become part of the scenario.
When an object is loaded, a series of predefined materials are also loaded.
A grid may not only use one material. Different materials can be used for different parts of the mesh.
A grid object actually contains several subgrid objects (based on the number of materials it contains ). If a grid has only one material

Only one subgrid object is available. You can use entity: getsubentity () to obtain the subgrid reference. However

Call setmaterialname () to change the material.

Material (material)
The default material type of ogre is:
Reflection on ambient light color: colourvalue: White (full); All reflection
Reflection on diffuse light: colourvalue: White (full)
Colourvalue: Black (none); no mirror reflection
Shininess: 0
No texture layer.
Mixed parameters: sourceblendfactor = sbf_one, destblendfactor = sbf_zero
The deep test is enabled.
Enable deep buffer write.
Comparison function of deep test: cmpf_less_equal
Elimination mode: cull_clockwise clockwise
Global Environment light: colourvalue (0.5, 0.5, 0.5)
Dynamic illumination computing: Enabled
Gaussian coloring mode.
Bilinear texture filtering.

Technique)
The compiler checks the following items:
1. The number of texture units in each pass. Note that if the number of texture units exceeds the maximum number supported by the video card chip

Technique can still be used until a vertex shader is used. In this case, the ogre will discard that has too many

Passes entries pass, and then convert multi-texture (multitexture) into multi-pass (multipass) for processing.
2. Whether the texture technology is enabled. If enabled, which language is used.
3. Other effects such as cube ing and dot3 mixing.
Note: In a material script, the order of technique must be written in order of priority.

Technique has a higher priority than technique. This means that the highest level is usually the most challenging for graphics cards.

Put technique at the beginning, and put some technique with lower requirements on the video card at the back.
Technique has only one attribute belonging to them, that is, the level of the dashboard. By default, technique has a level of 0 (the highest level ).

You can specify multiple technique to use the same level, and ogre will automatically select the best technique (usually based on which Technique

In general, you can determine the order of technique in this way: first by the level

The specific level of SLDs used is determined indirectly by the lod_distance of the material.

The object must be the same as the number of distances specified by material. For example, lod_distance specifies the minimum distance of 100,100 0 and 3000,

There should also be a corresponding level of 0, 1, and 2.
For example:
Lod_distance 500 1000 1400
In this way, lod_index 0 corresponds to 0 ~ 500, lod_index 1 corresponds to 500 ~ 1000, lod_index 2 corresponds to 1000 ~ 1500
A technique can have 0 ~ 16 pass.

Channel (PASS ):
The following attributes can be specified in a channel:
Ambient;
Diffuse;
Specular;
Emissive;
Scene blend; // mixed operation
Depth check;
Depth write;
Depth func;
Depth bias;
Cull hardware;
Cull software;
Lighting;
Shading Model;
Fog override;
Color write;
Max lights;
Iteration;

The attributes are described as follows:
Ambient r g B
It determines the degree of reflection of R, G, and B on each vertex. This attribute determines how much global environment light is reflected. This attribute is dynamic

The light is disabled or the colour_op_replace color replacement option of the texture layer is enabled.

Diffuse R, G, B
It determines the degree to which each vertex reflects the diffuse components of the scene light. It is disabled or enabled in illumination computing.

The attribute of colour_op_replace texture layer is invalid.

Emissive R, G, B
Sets the self-emitting color of the vertex. This attribute is invalid when vertex shader is enabled. When lighting off or colour_op_replace is enabled

Invalid.

Scene_blend add, scene_blend modulate, or scene_blend alpah_blend
Or two parameters.
Scene_blend one
Scene_blend src_colour one_minus_src_colour
Scene_blend src_alpha one_minus_src_alpha

Depth_check ON/OFF
Switch for deep Test

Depth_write ON/OFF
Switch for deep buffer writing

Depth_func func
Deep comparison functions
Alaways_fail, always_pass, less, less_equal, euqal, not_equal, greater_equal, greater

Depth_bias
Depth offset (can be used in special effects like decimal)

Cull_hardware (clockwise/anticlockwise/NONE)
Elimination Mode

Cull_software (Back/Front/NONE)
Equivalent to the corresponding option of cull_hardware

Lighting ON/OFF
Whether to enable illumination.

Shading flat/Gouraud/Phong
Coloring Mode

Fog_override true/false [type color density start end]
Tell pass whether to ignore the fog settings in the scenario and force your own settings to be used. When you want to place an object in a scenario that does not want to be blurred

It is very useful. The default value is false.
If it is set to yes, it may not be affected by the fog in the scenario. Instead, it uses the specified fog to set. type as the computing type.

None, linear, exp, exp2. color is the fog color, density is the concentration, it is set for exp and exp2. Start, end

Is set for the linear type fog.
Fog_override true Exp 1 1 0.002 10000

Colour_write ON/OFF
Color Buffer

Max_lights 8
Maximum number of lights

Texture layer attributes:
Texture
Anim_texture
Cubic_texture
Tex_coord_set
Tex_address_mode
Filtering
Max_anisotropy
Colour_op
Alpha_rejection
Colour_op_ex
Colour_op_multipass_fallback
Alpha_op_ex
Env_map
Scroll
Scroll_anim
Rotate
Rotate_anim
Scale
Wave_xform

Attribute description:
Texture <texturename> [<type>]
The texturename file name cannot contain spaces. You can use 1d, 2d, and cubic to indicate the dimension textures (default

Is 2 dimensions ).
The height of the 1D texture is 1 pixel, while the cubic texture is purchased from six 2D textures into a cube.

Anim_texture <base_name> <num_frames> <duration>
Or
Anim_texture <frame1> <frame2> <frame3>... <frame_n> <duration>
For example,
Anim_texture fire.jpg 5 1.3
Ghost builds an animation layer consisting of fire1.jpg, fire2.jpg... fire5.jpg, each staying for 1.3 seconds

Anim_texture fire1.jpg fire2.jpg fire3.bmp fire4.png 1.3
It creates a four-frame texture animation.

Cubic_texture <base_name> <combineduvw/sperateuv>
Or
Cubic_texture <front> <back> <left> <right> <up> <down> <combineduvw/seperateuv>

In the first format, the texture File Name of the six faces should be as follows: If base_nameis skybox.jpg, it should be

Skybox_fr.jpg, skybox_bk.jpg, skybox_up.jpg skybox_dn.jpg skybox_lf.jpg skybox_rt.jpg 6

Zhang.
Combineduvw refers to six textures connected to a single cubic texture map. The addressing mode is 3D coordinate uvw.
Seperateuv indicates that the six textures are still separated and still 2D. A 2D texture map is used.

Tex_coord_set <set_num>
Sets the coordinate system used by the texture layer.

Tex_address_mode <wrap/clamp/mirror>

Filtering <NONE/bilinear/trilinear/anisotropic>
Sets the texture filtering mode.

Filtering <minification> <magnification> <MIP>

Max_anisotropy <max>
Set the maximum exclusive filtering Value

Colour_op <replace/Add/modulate/alpha_blend>
Set color mixing

Alpha_rejection <function> <value>
Blocking the graphic elements that meet the conditions

Colour_op_ex <operation> <source1> <source2> [<manual_factor>] [<manual_colour1>]

[<Manual_colour2>]
Operation options are as follows:
Source1: Use Option 1 directly.
Source2: Use Option 2 directly.
Modulate: S1 * S2
Modulate_x2: (S1 * S2) * 2
Modulate_x4: (S1 * S2) * 4
Add: S1 + S2;
Add_signed: (S1 + S2.)-0.5
Add_smooth: (S1 + S2)-S1 * S2
Subtract: S1-S2
Blend_diffuse_alpha: S1 * alpha1 + S2 * (1-alpha2)
Blend_texture_alpha: S1 * alpha1 + S2 * (1-alpha2)

Particle System attributes:
Quota <max_participant>
Maximum number of particles.

Material <material_name>
Particle Material.

Participant _width <width>
Particle width

Participant _height Particle height

Cull_each <true/false>
All particle systems are excluded from a boundary box. The boundary box contains all particles. In most cases

Valid. In most particle systems, most particles are both visible and invisible. However, for some special Particles

System, which covers a wide range and may be "difficult" to remove (such as raindrops) using a boundary box.

Remove. In this case, the true value of cull_each is valid.

Billboard_type <point/oriented_common/oriented_self>
Point: the default setting, which enables the particle to always face the camera.
Oriented_common: the particle rotates around a specific fixed vector. That is, in the X and Z directions, it is an advertisement board, but in the Y direction

.
Oriented_self: particles circle a specific direction of custom particles. Such as laser and spark...

Attributes of the particle transmitter:
Angle
Color
Colour_range_start
Colour_range_end
Direction
Emission_rate
Position
Velocity
Velocity_min
Velocity_max
Time_to_live
Time_to_live_min
Time_to_live_max

Angle <degree>
Sets the angle range in which the transmitter emits particles up. When the value is 0, the particle only emits forward. 180 is

Circumference.

Color <r> <G> <B> [<A>]
Set the particle color in the range of [0, 1.

Colour_range_start <r> <G> <B>
Colour_range_end <r> <G> <B>

Emission_rate <rate>
Position <x> <Y> <z>
Velocity <world_units_per_second>
Velocity_min <vel>
Velocity_max <vel>
Time_to_live_min <num_seconds>
Time_to_live_max <num_seconds>
Common_direction <x> <Y> <z>

Ogre presets several particle Transmitters: Point, square, cylindrical, elliptical, hole, and ring

Emitter point
{
// Settings go here
}

Cubic shape:
Width <value>
Height <value>
Depth <value>
Launch at any position in the stereo body
Emitter box
{
//..
}

Cylindrical, elliptical, and other transmitters are the same as above.

Influencer:
Linear force affector
Force_vector <x> <Y> <z>
Set a force to affect the particle.

Force_application <Add/average>
Add: add the current external force to the motion of the original particle.
Average: the average of the current external force and the movement of the original particle.

Affector linearforce
{
//...
}

Color influencer
Red <delta_value>
Green <delta_value>
Blue <delta_value>
Alpha <delta_a>

Affector colourfader
{
//...
}

// Size influencer
Rate...
Affactor scaler
{
// Settngs go here.
}

Guielement Attribute Group

Metrics_mode <pixels/relative>
Select the size mode, pixel mode, and relative mode. The value ranges from 0 to 0 ~ 1

Horz_align <left/center/Right>
Horizontal Alignment Mode

Vert_align <top/center/bottom>
Vertical Alignment Mode

Left <value>
The value mode is relative, meaning 0.5 is half the width of the parent object.

Top <value>
Same as above.

Width <value>
Height <value>
Also relative width

Material <Name>
Specify Material

Caption <string>
Title item.

Standard GUI Elements

Panel (container)
Panel element. It is a rectangular area that can hold other elements. It can have or has no background. The background material is defined

The material attribute is determined, but it only appears when the transparent attribute is disabled.
The Panel attributes are as follows:
Transparent <true/false>
Whether the setting is transparent. If it is transparent, it is not displayed and only exists as a parent element (it can accommodate other elements ).
Tiling <layer> <x_tile> <y_tile>
Set the number of times that the texture of the target texture layer is overwritten in the XY direction on the panel.

Borderpanel (container)
It is an enhanced version of the Panel. It has a three-circle appearance (9 rectangles are actually drawn, and the middle is the main material. The remaining corners have eight sides and four sides,

Border material used for the four corners ).
Border_size <left> <right> <top> <bottom>
// Set the width of the left and right edges.
Border_material <Name>
Set the materials used by the edge
Border_topleft_uv <U1> <V1> <U2> <U2>
Border_topright_uv <U1> <V1> <U2> <U2>
Border_bottomleft_uv <U1> <V1> <U2> <U2>
Border_bottomright_uv <U1> <V1> <U2> <U2>
Set the texture coordinates of the four corners (rectangles.
Border_left_uv <U1> <V1> <U2> <U2>
Border_right_uv <U1> <V1> <U2> <U2>
Border_top_uv <U1> <V1> <U2> <U2>
Border_bottom_uv <U1> <V1> <U2> <U2>
Set the texture coordinates of the four edges (rectangles.

Textarea (element)
Attribute:
Font_name <Name>
Specifies the fontdef file.
Char_height Height
Color <red> <green> <blue>
Character Color
Colour_bottom <red> <green> <blue>
Colour_top <red> <green> <blue>
Create text with gradient effect from bottom to top

Textbox (element)
The input box can be input by the user. It consists of text_area and back_panel.
Text_area <Template Name> [<caption>]
Back_panel <Template Name>

Font
There are two ways to create a font.
1. Create a bitmap containing font data from the drawing tool.
2. Let the Ogre generate the corresponding Bitmap Based on the TrueType font.
Generally, the latter is much easier. We recommend that you first use the latter in the early stage. After everything is normal, use the previous method to create your own font.
A font texture always requires an alpha channel because it can create a pretty edge.

When using an existing bitmap, you can use the following attributes:
Type Image
This tells ogre to use a drawn bitmap.
Source <FILENAME>
The name of the bitmap to be loaded.
Glyph <character> <U1> <V1> <U2> <V2>
Specifies the texture coordinate range (I .e. its location) of a specific character ).

The following attributes can be used to allow ogre to create a bitmap using the current TrueType Font:
Type TrueType
Tells ogre to generate a bitmap from a font
Source <TTF File>
Font File

Size <size_in_points>
Generate the font size. Note that this only affects the size of the font in the texture, not on the screen.

Resolution <DPI>
Resolution: 72 or 96.
Antialias_colour <true/false>
This is an optional flag. The default value is false.

Grid tools
When creating an animation model for ogre, pay attention to the following three points.
1. The weight of each vertex in the grid is affected by a maximum of four bones. If the weight is exceeded, ogre selects the lowest setting and reinstalls it.

Row.
2. All vertices must be attached to at least one bone.
3. Each bone must have at least one key frame.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.