Material types
This document explains all the material types available in the FFilmation engine as well as the parameters they use. Hopefully one day when the FFilmation Editor is complete materials will be created within the editor and you won’t have to bother understanding the XML structure, but in the meantime this page contains examples of how to do it by hand.
BASE MATERIALS
The base materials are those that only use simple graphical assets loaded from an SWF file. Read this page if you want to know how to create media for these materials.
MOVIECLIP material
Creates a material from a MovieClip or image exported in any SWF you import into the scene. The clip/image is scaled to fit the requested dimensions. If you want it to tile, use the fTileMaterial instead.
If you use a movieClip, place your “hole” definition clips only in the first frame. After reading the holes the class will gotoAndStop(2) the clip. In frame 2 you should have what you want to be visible as well as clips for doors and windows. See examples and tutorials for further info on holes, doors and windows
Example
Here’s an example of how to define a material of type fMaterialTypes.CLIP
<materialDefinition name="Ground" type="clip">
<diffuse>Ground</diffuse>
<bump>Ground_bump</bump>
</materialDefinition>
diffuse: export name of the symbol to use as diffuse map a movieClip for “clip” materials
bump: (optional) export name of the symbol to use as bumpmap. If none, this material is not bumpmapped
TILE material
Creates a material by “Tiling” an image in the imported libraries. This is the material you will be using the most, as it behaves as the typical “texture” in any modelling package
Example
Here’s an example of how to define a material of type fMaterialTypes.TILE
<materialDefinition name="Ground" type="tile"> <diffuse>Ground</diffuse> <bump>Ground_bump</bump> </materialDefinition>
diffuse: export name of the symbol to use as diffuse map, an image for “tile” materials.
bump: (optional) export name of the symbol to use as bumpmap. If none, this material is not bumpmapped
COMPOUND MATERIALS
Compound materials are more complex materials that use other materials as base. A compound material can be the base of another compound material. For example a window material can be the base of a door material and thus generatin a material with both windows and doors.
DOOR material
Creates a door in any wall. The Door material allows users to build doors fast.
Example
Here’s an example of how to define a material of type fMaterialTypes.DOOR
<materialDefinition name="MNIP_VillageMaterials_Door13" type="door"> <base>FFMaterials_woods2_Wood2_13</base> <frame>FFMaterials_woods2_Wood2_11</frame> <door>FFMaterials_woods2_Wood2_14</door> <position>0</position> <width>90</width> <height>150</height> <framesize>10</framesize> </materialDefinition>
base: Base material for this material
frame: Frame material
door: Door material
position: Door position, as percent of wall size, from -100 to 100. The default 0 value centers the door in the wall
width: Door size, without frame
height: Door size, without frame
framesize: Frame size
FENCE material
Creates a Fence material filling the plane with posts of given size. Keep in mind that holes have an impact in performace of the collision an light algorythms and therefore, this material has to be used with moderation.
Example
Here’s an example of how to define a material of type fMaterialTypes.FENCE
<materialDefinition name="MNIP_VillageMaterials_Fence" type="fence"> <base>FFMaterials_woods1_Wood1_9</base> <width>20</width> <gap>10</gap> <irregular>20</irregular> </materialDefinition>
base: Base material for this material
width: Size of every post
gap: Space between posts
irregular: Between 0 and 100. Randomly alters height of every post to generate a more natural look
PERLIN material
Perlin materials are procedural materials formed by a base material and unlimited layers of other materials, each one rendered from a perlin noise definition. The perlin noise for each layer is used as the alpha-mask for that layer.
Both the base material and the layer materials’ definitions must be included for the perlin material to work.
With perlin materials, you can create more natural-looking environments without extra effort
Example
Here’s an example of how to define a material of type fMaterialTypes.PERLIN
<materialDefinition name="MNIP_VillageMaterials_Ground" type="perlin">
<base>FFMaterials_ground_Ground1</base>
<layer>
<noise>
<seed>0</seed>
<baseX>200</baseX>
<baseY>200</baseY>
<octaves>2</octaves>
<fractal>true</fractal>
</noise>
<material>FFMaterials_ground_Ground7</material>
</layer>
</materialDefinition>
seed: The random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The Perlin noise function creates the same results each time from the same random seed. Use 0 if you want the engine to pick a random seed each time
baseX: Frequency to use in the x direction.
baseY: Frequency to use in the y direction.
octaves: Number of octaves or individual noise functions to combine to create this noise. Larger numbers of octaves create noise with greater detail. Larger numbers of octaves also require more processing time.
fractal: If the value is true, the method generates fractal noise; otherwise, it generates turbulence. An image with turbulence has visible discontinuities in the gradient that can make it better approximate sharper visual effects like flames and ocean waves.
PROCEDURAL material
Creates a material using a custom class. The class must implement the fEngineMaterial interface
See also
org.ffilmation.engine.interfaces.fEngineMaterial in The Ffilmation API Reference
Example
Here’s an example of how to define a material of type fMaterialTypes.PROCEDURAL
<materialDefinition name="Ground" type="procedural"> <classname>com.domain.game.materials.myMaterial</classname> </materialDefinition>
classname: class to be used. Make sure it is included when you compile your application
WINDOW material
Adds windows to any wall. This is a fast way of creating nicer buildings with little effort. Keep in mind that holes have an impact in performace of the collision an light algorythms and therefore, this material has to be used with moderation.
Example
Here’s an example of how to define a material of type fMaterialTypes.WINDOW
<materialDefinition name="MNIP_VillageMaterials_Windows13" type="window"> <base>FFMaterials_woods2_Wood2_13</base> <frame>FFMaterials_woods2_Wood2_11</frame> <position>0</position> <width>60</width> <height>90</height> <framesize>5</framesize> <separation>80</separation> <geometry>2x2</geometry> </materialDefinition>
base: Base material for this material
frame: Frame material
position: Windows’ vertical position, as percent of wall height, from -100 to 100.The default 0 value centers the windows vertically in the wall
width: Window size, without frame
height: Window size, without frame
framesize: Frame size
separation: Horizontal gap between windows. The engine will fit as many windows as possible depending on this value, the windows’ width and the size of the plane where this material is applied
geometry: Window geometry, like 3×2 or 2×4. Its default value will draw one single window without subdivisions

