Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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
languagecpp
linenumberstrue
// 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

 

...

languagecpp

...

"""Density"""""""Length density ""    
NameTypeMinMaxDefaultDescription
Material
char*------Material name
Points per Bladeunsigned int2204Number of control points per blade
Primitive Typeunsigned int020Grass type (0: Smooth; 1: Flat; 2: Cylinder (hair)
Seedunsigned int0163830Initial seed for blades generation (useful when there are two grass modifiers in the same mesh)
Densityunsigned int11e82000Blades density (blades/m2)
Density Map
Cmap------Blades density texture map
Length
float0.01e510.0Blade length in centimeters
Length Map
Cmap------
Blade length map
Length Variation
float0.0100.020.0Length random variation (%)
Root Width
float0.11e55.0Root width in milimeters
Tip Widthfloat
0.1
1e5
  
1.0Tip width in milimeters
Initial Anglefloat
    
 byte    
 float    
 float    
 byte    
 byte    
 unsigned int    
 unsigned int    
 float    
 stesttes   
 asdasdfasfdfdfl kaldfla df;l af;la dfa;lkj
      

asdga

asdf adf

 

"FileName"

Name of the file that contains particles data. It is a NULL terminated string.

Example:

Code Block
languagecpp
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
languagecpp
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
languagecpp
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
languagecpp
float shutter = 125.f;
extParam->setFloat( "Shutter 1/", shutter );
0.090.080.0Initial blade-ground angle in degrees (º)
Initial Angle MapCmap------Initial angle texture map
Initial Angle Variationfloat0.0100.025.0Initial angle variation (%)
Start Bendfloat0.0100.040.0Start bend point (in % of blade length)
Start Bend MapCmap------Start bend texture map
Start Bend Variationfloat0.0100.025.0Start bend variation (%)
Bend Radiusfloat0.0011e510.0Bend radius in centimeters
Bend Radius MapCmap------Bend radius texture map
Bend Radius Variationfloat0.0100.025.0Bend radius variation (%)
Bend Anglefloat0.0360.080.0Bend angle in degrees (º)
Bend Angle MapCmap------Bend angle texture map
Bend Angle Variationfloat0.0100.025.0Bend angle variation (%)
Cut Offfloat100.00.0100.0Cut off point (in %)
Cut Off MapCmap------Cut off texture map
Cut Off Variationfloat0.0100.00.0Cut off variation (%)
Enable LODbyte010Enable density level of detail
LOD Min Distancefloat0.01e510.0Level of detail starting distance (in meters)
LOD Max Distancefloat0.01e550.0Level of detail end distance (in meters)
LOD Max Distance Density
float0.0100.010.0Percent (%) of initial density at Max. distance
Display Percentunsigned int0.0100.010.0Percent (%) of blades displayed for preview purposes
Display Max. Bladesunsigned int0.01e51000.0Maximum 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

  • 0: skip this triangle
  • 1:generate grass in this triangle