...
This extension allows to generate grass on the top of meshes. It works as a object modifier plugin. Internally it creates blades and converts them to different grass primitives depending on the user parameters.
Example of how to create a MaxwellGrass object:
Code Block | ||||
---|---|---|---|---|
| ||||
// If we don't need to call functions such as CgeometryModifierExtension::getProxyDisplayPoints() // (i.e for display purposes) // then it is possible to define procedural geometries or object modifiers // without loading extension dynamic libraries (.mxx files) // but a MXparamList object can be created and filled with the desired parameters. Cmaxwell::Cobject mesh = pMaxwell->createMesh( ... ); // ...fill mesh parameters MXparamList* grassParams = new MXparamList( "MaxwellGrass" ); float bladesDensity = 500.0; grassParams->setFloat>createUInt( "Density", 2000, 1, 1000000000 ); grassParams->setUint( "Density", bladesDensity ); float length = 0.25; grassParams->createFloat( "Length", 10.0f, 0.f, 100000.f ); grassParams->setFloat( "LengthLenght ", length ); grassParams->createString( "Material", "" ); grassParams->setString( "Material", materialName ); //...etc.. object.applyGeometryModifierExtension( grassParams ); |
Parameters
...
language | cpp |
---|
...
Name | Type | Min | Max | Default | Description |
---|---|---|---|---|---|
Material | |||||
char* | -- | -- | -- | Material name | |
Points per Blade | unsigned int | 2 | 20 | 4 | Number of control points per blade |
Primitive Type | unsigned int | 0 | 2 | 0 | Grass type (0: Smooth; 1: Flat; 2: Cylinder (hair) |
Seed | unsigned int | 0 | 16383 | 0 | Initial seed for blades generation (useful when there are two grass modifiers in the same mesh) |
Density | unsigned int | 1 | 1e8 | 2000 | Blades density (blades/m2) |
Density Map | |||||
Cmap | -- | -- | -- | Blades density texture map | |
Length | |||||
float | 0.0 | 1e5 | 10.0 | Blade length in centimeters | |
Length Map | |||||
Cmap | -- | -- | -- | ||
Blade length map | |||||
Length Variation | |||||
float | 0.0 | 100.0 | 20.0 | Length random variation (%) | |
Root Width | float | 0.1 | 1e5 | 5.0 | Root width in milimeters |
Tip Width | float | ||||
0.1 | |||||
1e5 | |||||
1.0 | Tip width in milimeters | ||||
Initial Angle | float | ||||
byte | |||||
float | |||||
float | |||||
byte | |||||
byte | |||||
unsigned int | |||||
unsigned int | |||||
float | |||||
stest | tes | ||||
asd | asdf | asfdf | dfl kaldfla df;l af;l | a dfa;lkj | |
asdga
asdf adf
"FileName"
Name of the file that contains particles data. It is a NULL terminated string.
Example:
Code Block | ||
---|---|---|
| ||
char* file = "/home/paco/Emitter01_00049.bin";
extParam->setString( "FileName", file ); |
"Radius Factor"
Multiplier for the particle radius that is read from the file. Can go from 0.00001 to 1000000 and the default value is 1.
Example:
Code Block | ||
---|---|---|
| ||
float rFactor = 0.3f;
extParam->setFloat( "Radius Factor", rFactor ); |
"MB Factor"
Multiplier to increase or decrease the amount of motion blur of the particles. Can go from 0.0 to 1000000.0. Default is 1.0.
Example:
Code Block | ||
---|---|---|
| ||
float factor = 0.3f;
extParam->setFloat( "MB Factor", factor ); |
"Shutter 1/"
Shutterspeed of the active camera. Affects the amount of motion of the particles. It is the inverse of the time the shutter is open.
Example:
Code Block | ||
---|---|---|
| ||
float shutter = 125.f;
extParam->setFloat( "Shutter 1/", shutter ); |
0.0 | 90.0 | 80.0 | Initial blade-ground angle in degrees (º) | ||
Initial Angle Map | Cmap | -- | -- | -- | Initial angle texture map |
Initial Angle Variation | float | 0.0 | 100.0 | 25.0 | Initial angle variation (%) |
Start Bend | float | 0.0 | 100.0 | 40.0 | Start bend point (in % of blade length) |
Start Bend Map | Cmap | -- | -- | -- | Start bend texture map |
Start Bend Variation | float | 0.0 | 100.0 | 25.0 | Start bend variation (%) |
Bend Radius | float | 0.001 | 1e5 | 10.0 | Bend radius in centimeters |
Bend Radius Map | Cmap | -- | -- | -- | Bend radius texture map |
Bend Radius Variation | float | 0.0 | 100.0 | 25.0 | Bend radius variation (%) |
Bend Angle | float | 0.0 | 360.0 | 80.0 | Bend angle in degrees (º) |
Bend Angle Map | Cmap | -- | -- | -- | Bend angle texture map |
Bend Angle Variation | float | 0.0 | 100.0 | 25.0 | Bend angle variation (%) |
Cut Off | float | 100.0 | 0.0 | 100.0 | Cut off point (in %) |
Cut Off Map | Cmap | -- | -- | -- | Cut off texture map |
Cut Off Variation | float | 0.0 | 100.0 | 0.0 | Cut off variation (%) |
Enable LOD | byte | 0 | 1 | 0 | Enable density level of detail |
LOD Min Distance | float | 0.0 | 1e5 | 10.0 | Level of detail starting distance (in meters) |
LOD Max Distance | float | 0.0 | 1e5 | 50.0 | Level of detail end distance (in meters) |
LOD Max Distance Density | float | 0.0 | 100.0 | 10.0 | Percent (%) of initial density at Max. distance |
Display Percent | unsigned int | 0.0 | 100.0 | 10.0 | Percent (%) of blades displayed for preview purposes |
Display Max. Blades | unsigned int | 0.0 | 1e5 | 1000.0 | Maximum amount of blades displayed for preview purposes |
"TRIANGLES_WITH_BLADES" | byte array | -- | -- | -- | Optional array to define which triangles of the modified mesh will have blades. The size of this array should be the same than the triangle count, each element of the array corresponds to a triangle index
|