next_inactive up previous



Contents

Tage

Tage is a texture and landscape generator focused to game developers. A scene is described by tage data files, some of them are in samples package.

Tage datafile description

This file describes tage input files format and grammar.

Comments

The input file uses standard C++ comments:

// One line comment

/*
  Two or more line comment
*/

Properties

All properties are set by

property_name = value
a "value" can be strings, numbers (hexa, integer, float-point), colors, vectors and enumerated values.

Boolean

Boolean is a binary value (true/false) and it's used for switches or on/off properties. The false value is written as 0 and true any other number (typically 1).

// light is enabled 
enable_ligth = 1

// shadows are disabled
enable_shadows = 0

Numbers

Numbers are standard numerical values and can have a decimal part.

size = 10
height = 1.1

Strings

Strings don't use commas and can't contain spaces. String values are typically used for modificator/generator names.

name = my_modificator_name

Colors

Colors can be defined by two ways - by separated RGB values (0-1) or (0-255), by one hexadecimal digit (HTML color). There is an example of color_center set to R:33, G:25, B:7. The rgb() function converts number from (0-255) range to (0-1) range.
// by RGB:
color_center.r = 0.12
color_center.g = 0.09
color_center.b = 0.02

// by RGB & rgb() function
color_center.r = rgb(33)
color_center.g = rgb(25)
color_center.b = rgb(7)

// by one hexa number (RRGGBB)
color_center = #211907

The color type is stored internaly as tree float-point values and the .r .g and .b suffixes are normal numbers. You can use common arithmetics operations like:

color_center.r = 0.12
color_center.g = color_center.r * 2
color_center.b = color_center.r / 4

Vectors

Vectors are composed from two or three numbers. For instance, we want to set light_position vector:

light_position.x = -1
light_position.y =  1
light_position.z = -1
The .x,.y and .z suffixes are 0 by default. Another option is to use a vector format (x,y,z):
light_position = (-1,1,-1)

Rectangles

Rectangles defines a square area in a surface.

rect.x = 0
rect.y = 0
rect.dx = 20
rect.dy = 20

Angles

An angles are normal numbers (an angle in degrees), from 0 to 360. They are used in polar coordinates and so on.

some_angle = 20.6

Enumerated types

Enumerated types are values which can have some predefined values. They are typically used for blocks type descriptions, some types, targets, operations and so on.

// coordinate type
type = MODIFICATOR_COORDINATE

// set modificator_target to texture
modificator_target = TEXTURE

// set modificator_target to geometry
modificator_target = GEOMETRY

Aritmetic operations

It's one of frequently applied enumerated types and defines requested arithmetics operation. It's used for coordinates, color/height operations and many more. Aritmetic operation anumerator is used in this context:

\begin{displaymath}
result = destination OP source
\end{displaymath}

where OP is defined as:

Operation Meaning
SET \(result = source\)
ADD \(result = destination + source\)
SUB \(result = destination - source\)
MODULATE \(result = destination * source\)
MODULATE2X \(result = destination * source * 2\)

Intervals

Some values can be set as interval. If a value is an interval, it means it can get any value from the border values. The border values are marked as ".min" and ".max" suffixes. Intervals are always used with other types (number, angle, color, vector). Intervals can be set as a normal (non-interval) value, too.
/* Number intervals
*/
// Interval set by only one value so it's always 10
angle = 10

// Interval set by two border values, 
// can be any value from 10 to 20
angle.min = 10
angle.max = 20 

/* Vector intervals
*/ 
// As components
position.min.x = 10
position.min.y = 10
position.min.z = 10

position.max.x = 20
position.max.y = 20
position.max.z = 20

// As vectors
position.min = (10,10,10)
position.max = (20,20,20)

/* Color intervals
*/
// As components
color.min.r = 10
color.min.g = 10
color.min.b = 10

color.max.r = 20
color.max.g = 20
color.max.b = 20

// As vectors
color.min = (10,10,10)
color.max = (20,20,20)

// As hexadecimal (HTML) colors
color.min = #0a0a0a
color.max = #141414

Coordinates

Coordinates are 2D area which describes where a modificator is applied. The coordinate is a whole block with "type = MODIFICATOR_COORDINATE", index (will be described later) and start and size (or end) 2D vectors. There is an example of area which starts at (0,0) and is 40x40 pixels wide:
{
  type = MODIFICATOR_COORDINATE

  index = 0

  start.x = 0
  start.y = 0

  size.x = 40
  size.y = 40
}

Basic blocks

An atomic part of the file is a block inside compound braces. It describes one atomic unit inside generator or some generator values. Each block must contain its name and type.
{
  name = generator
  type = GENERATOR_MESH

  /* All generator params come here
  */
}
Blocks can be nested, like this one:
/* Describes pixel generator and its color definition
*/
{
  name = pixel_point
  type = MODIFICATOR_POINT_SINGLE

  {
    type = MODIFICATOR_POINT_SINGLE_COLOR
    color_center = #3b5528
  }
}
All block examples bellow uses this format:
{
  /* First part contains block name and type:
  */
  name = block_name
  type = block_type

  /*
    Second part is a list of all posible properties,
    descriptions and default values:

    [property_type]  property_name
   
    If the property_type is an enumerated type, all 
    posibilies come here:
    
    VALUE_1
    VALUE_2
    VALUE_3
  */  
  property_name = default_value_of_the_property
}

Tage generator architecture

Whole generator is designed as a modificator chain. There is one master (root) modificator and it passes results to slave modificators. A last modificator in the chain writes results (color pixel, heights) directly to a generator target (it can be mesh itself, mesh texture or something else).

Figure 1: Modificator chain which draws a line composed from single pixels.
\includegraphics[scale=0.6]{p08.eps}

A picture 1 is a nice example of a modificator chain. The first modificator here is the rectangle and it's applied to whole target surface because local coordinates are not defined. If the target surface is 2048 pixels wide and 1024 pixels high, the rectangle will get $(0,0)
-> (2048, 1024)$ coordinates.

By default the rectangle modificator paints whole area by pixels. So it calls specified slave modificator (the line here) for each pixel inside the $(0,0)
-> (2048, 1024)$ target surface area.

A next modificator here is the line and it's drawn for each pixel inside the target surface. We can define (by coordinate block inside the line modificator) the line size and direction so we can obtain a rectangle filled by single lines. The lines are composed from single pixels which are drawn by the last modificator here - pixel.

Generator launcher

Generator launcher defines which generators are performed and their order. It can be only one in the whole data file.
{
  /* Launcher name and type
  */
  name = generator_launcher_name
  type = GENERATOR_LAUNCHER

  /* Performed generators. 
  */
  generator_mesh = first_generator
  generator_mesh = second_generator
  generator_mesh = third_generator
}

Generator

Generator defines which modifiators are launched, their targets and order. There can be as many generators as you want in a data file.

/* A simple generator
*/
{
  /* Generator name and type
  */
  name = generator_name
  type = GENERATOR_MESH

  /*
    Modificator name and its target:
    
    [string]          modificator
    [enumerated type] modificator_target
      
      TEXTURE
      GEOMETRY
      GENERATOR_MESH
      AUX
      MODIFICATOR
      
    [string]          modificator_target_name
  */
  
  /*
    Mask properties:
    
    [...]  
  */
}

Generator items

Mask properties

Each target can have attached a mask which is applied to all pixels (color/height) written to the target. The properties are described in section 10.1.2.

There is an example of a simple generator there:

/* A simple generator
*/
{
  /* Generator name and type
  */
  name = generator_name
  type = GENERATOR_MESH
  
  /* First modificator chain writes to texture
  */
  modificator = first_modificator
  modificator_target = TEXTURE
  
  /* Second modificator chain writes to mesh
  */
  modificator = modificator_name  
  modificator_target = GEOMETRY
}


Multiple generator targets

Look at this example:

/* A simple generator
*/
{
  /* Generator name and type
  */
  name = generator_name
  type = GENERATOR_MESH
  
  /* A modificator chain writes to mesh and texture
  */
  modificator = modificator_name
  modificator_target = TEXTURE
  modificator_target = GEOMETRY
}

As you can see you may define more (up to five) targets for each modificator. If the targets have different sizes (e.g. texture is 512x512 pixels wide and generated mesh is a landscape with 20x20 points), the second and further targets are scaled according the first one (i.e. the geometry here will have 512x512 temporary points and they will be scaled to the final 20x20 grid).

Generator targets

A 3D objects generated by a single generator is usually a flat mesh with one big texture. If the texture is too big, it's sliced to smaller parts. The object is described by mesh, material and texture block.

Geometry target

The geometry target is defined by one MESH_PARAMS block. It defines mesh properties like type, size and so on. If it's missing in the tage file, default values are used for the generated mesh.

{
  name = mesh_name
  type = MESH_PARAMS

  /*
    [enumerated value]  mesh_type
   
      MESH_LAND
      MESH_BUNCH
      MESH_GRASS
      MESH_BUSH
  */
  mesh_type = MESH_LAND
  
  /*
    Mesh dimensions. All values are vectors.
  
    [vector] start
    [vector] diff
    [vector] size
  */  
  start = (0,0,0)
  diff = (1,1,1)
  size = (1,1,1)
  
  /*
    Parameters related to bunch:
    
    [int, interval]   bunch_slice_num
    [int, interval]   bunch_slice_segments
      
    [float, interval] bunch_slice_x_offset
    [float, interval] bunch_slice_z_offset
      
    [angle, interval] bunch_slice_falling
    [angle, interval] bunch_segment_falling
        
    [int]             bunch_slice_rotation_incemental
    [angle, interval] bunch_slice_rotation_range
    [angle, interval] bunch_slice_rotation_step
  */    
  bunch_slice_num = 6
  bunch_slice_segments = 1
  
  bunch_slice_x_offset = 0
  bunch_slice_z_offset = 0
  
  bunch_slice_falling = 0
  bunch_segment_falling = 0
  
  bunch_slice_rotation_incemental = 0
  bunch_slice_rotation_range = 180
  bunch_slice_rotation_step = 0
}

Mesh items

Texture target

The texture target is defined by two blocks - TEXTURE_PARAMS and MATERIAL_PARAMS.

Texture parameters

This block representes a texture of generated object. If it's missing in the tage file, default values are used for the generated texture.

{
  name = test_texture
  type = TEXTURE_PARAMS

  /*
    [vector]  texture_size
    [int]     texture_height
    [color]   background_color
    [int]     texture_alpha
  */
  texture_size = (512,512)
  texture_height = 512
  background_color = #000000
  texture_alpha = 0
}

Texture items

Material parameters

You can modify some texture parameters of generated mesh. If it's missing in the tage file, default values are used for the generated texture.

{
  name = test_material
  type = MATERIAL_PARAMS
  
  /*
    [boolean] transparent
    [boolean] double_side
  */
  transparent = 0
  double_side = 0  
}

Material items

Auxiliary target

Describes a helper target which contains color and height components. The parameters are identical with the texture ones. If you want to use color or height pixels written to this target you need to use a MODIFICATOR_TARGET modificator.

{
  name = aux_target
  type = AUX_PARAMETERS

  /*
    [vector]  aux_size
    [int]     aux_height
    [color]   background_color
    [int]     aux_alpha
  */
  aux_size = (512,512)  
  aux_height = 512
  background_color = #000000
  aux_alpha = 0
}

Texture items

Generator mesh target

GENERATOR_MESH TODO

Generator modificators

A generic modificator blocks

There are some properties which can be included in any modificator block, but not all properties are available in all modificators and some can have a different meaning.

Pixel properties

Pixel properties control pixel generation.

  /*
    [boolean] area_inverted
    
    [int]     pixel_size
    
    [int]     pixel_step
    [int]     pixel_step_x
    [int]     pixel_step_y
  
    [boolean] pixel_step_random
    [int]     pixel_step_random_min
    [int]     pixel_step_random_max
    
    [float]   pixel_color_density
    
    [boolean] probability_fade
    [float]   probability_fade_start
    [float]   probability_fade_stop
  
    [boolean] color_fade
    [float]   color_fade_start
    [float]   color_fade_stop
      
    [boolean] erode_border
    [float]   erode_factor
  */


Mask properties

Every modificator can use a mask. The mask controls if and how are modificator pixels (color/height) passed to slave modificator(s). The mask itself has to be defined as MODIFICATOR_MASK modificator first and then referenced from this modifiator. Mask is controlled by those properties:

  /*
    [string]              mask
    
    [aritmetic operation] mask_op
    [boolean]             mask_blend
    [boolean]             mask_dithering
    
    [boolean]             mask_create
    [boolean]             mask_inverted
    [integer]             mask_overlapping
    
    [color]               mask_color
    [float]               mask_height
    [float]               mask_height_min
    [float]               mask_height_max
  */

Mask creation

A content of MODIFICATOR_MASK (the mask) can be created when the modificator is called for first time. Mask type and other mask configuration is set in MODIFICATOR_MASK block besides the mask size which is a size of area where the modificator is applied. There are two types of created mask:

  /*
    [string]              mask_create
    [string]              mask_create_remove
  */

Slave modificators

Almost every modificator (except the MODIFICATOR_POINT_SINGLE) needs to have defined a slave modificator. You can define up to five slave modificators for each class (slave, pre, post) and those modificators are called in order how they are defined.

  /*
    [string] modificator_slave
    [string] modificator_pre
    [string] modificator_post
  */

So imagine there's a MODIFICATOR_RECT which generates a rectangle area from \((20,20)\) to \((50,50)\). It means that:

Local coordinates setup

Each modificator can contain local coordinate setup. It's defined by nested MODIFICATOR_COORDINATE block and other properties described in next chaper.

Coordinates

Each modificator is applied to an area which is restricted by "top" coordinates. Top coortinates are defined by master modificator or size of target surface for the first modificator.

Figure 2: Target surface and one modificator.
\includegraphics[scale=0.6]{p02.eps}

Those "top" coordinates are further modified by local coordinate block (randomization, size extension and so on).

Coordinate block

Defines a block with local coordinate configuration. Top coordinates are defined by master modificator or modificator target and local coordinates are defined by coordinate block which can be included in any modificator.

Figure 3: An example of top and local coordinates composition.
\includegraphics[scale=0.6]{p06.eps}

Coordinate properties define operations between top and local coordinates, whether the local ones are generated (randomized) or not and so forth. If there are more than one MODIFICATOR_COORDINATE block, the modificator is called for each of them (see figure 4).

Coordinate setup properties

  /*
    Local coordinates setup:
    
    [aritmetic operation] coordinates_operation 
    [boolean]             coordinates_random
    [int]                 coordinates_random_num
    [enumerated type]     modificator_start
    [enumerated type]     modificator_size
            
      COORD_CURRENT
      COORD_LAST_START
      COORD_LAST_SIZE
      COORD_LAST_START_SIZE      
  */  
  coordinates_operation = OPERATION_SET
  coordinates_random = 0
  coordinates_random_num = 0
  modificator_start = COORD_CURRENT
  modificator_size = COORD_CURRENT
  
  /*
    First coordinates blocks:
  */
  {
    type = MODIFICATOR_COORDINATE
    
    /*
      [vector] start
      [vector] size
      [int]    index
    */
  }
  
  /*
    Second coordinates blocks:
  */
  {
    type = MODIFICATOR_COORDINATE
    
    /*
      [vector] start
      [vector] size
      [int]    index
    */
  }
  
  /*
    Third one...
  */
  {
    [...]
  }

Coordinate block properties

Modificator coordinate sub-block properties

Figure 4: An example of modificator chain with local coordinate setup.
\includegraphics[scale=0.6]{p05.eps}

Modificator parameters

Parameters are float point values in $<0,1>$ range which are passed between modificators on parameter stack. If a modificator generates any parameter, the parameter is added on top of the parameter stack. If a modificator does not emit any parameter the stack is passed without modification.

The parameters and are typically used by simple point modificator for color/height generation and so on. For instance, there's a fractal modificator which generates a height map. The fractal modificator calls a slave modificator (simple point modificator for instance) for each generated pixel and as parameter passes pixel height. So the slave pixel modificator can draw pixels by color adjusted by pixel height. Another example showns figure 1.

There is a list of available modificator parameters:

PARAM_PREV_0 a parameter on top of the parameter stack
PARAM_PREV_1 a second one
PARAM_PREV_2 third one
...  
PARAM_PREV_9  
PARAM_RAND a random number from $<-1,1>$ with normal distribution
PARAM_RAND_HALF a random number from $<0,1>$ with normal distribution
PARAM_GAUSS a random number from $<-1,1>$ with gaussian distribution
PARAM_GAUSS_HALF a random number from $<0,1>$ with gaussian distribution (center is in 0)

Point modificators

Point modificators are designed as last modificators and usually write data directly to targets (height to mesh geometry or color/heights to texture).

Single point modificator

Single point modificator writes to target (slave modificator or texture target) only one single point. Its size is always 1x1 so for instance if it gets $(20,20) -> (100,100)$ coordinate from master modificator, it writes only single pixel to $(20,20)$ with $(1,1)$ size. Pixel_size property is ignored by this modificator.

The single point modificator consists from basic setup in main block and subblocks. A subblock defines particular color/height operations applied to any pixel processed by single point modificator. Number of color/height subblocks is not limited.

There are two types of subblocks. MODIFICATOR_POINT_OPBOX is applied to each pixel which is processed by the single point modificator. For instance when a parent modificator is a MODIFICATOR_RECT then the MODIFICATOR_POINT_OPBOX is applied to all pixels inside the generated rectangle.

On the other hand the MODIFICATOR_POINT_OPBOX_INIT block (which is a sub block of MODIFICATOR_POINT_OPBOX is called only once when the parent modificator starts to emit the pixels by MODIFICATOR_POINT_OPBOX. So it allows to set values which are constant in all calls of MODIFICATOR_POINT_OPBOX.

Single point modificator block contains

{
  name = some_modificator_name
  type = MODIFICATOR_POINT_SINGLE
  
  /*
    Generated colors can be crop:
  
    [boolean]               color_borders
    [color]                 color_border_min
    [color]                 color_border_max
   */
  color_borders = 0
  color_border_min = (0,0,0)
  color_border_max = (255,255,255)
  
  /*
    Color tables:
          
    [string]                color_table
  */
  
  /*
    A subblock
  */
  {
    type = MODIFICATOR_POINT_OPBOX
    
    /*
      Write color/height to target pixels
    */
    
    [...]
    
    {
      type = MODIFICATOR_POINT_OPBOX_INIT
      
      /*
        Initialize values for parent 
        MODIFICATOR_POINT_OPBOX block
      */
            
      [...]
    }
  }
  
  /*
    Another subblock
  */
  {
    type = MODIFICATOR_POINT_OPBOX
    [...]
  }
}

Single point modificator properties

Color table can define a colors which can be used for color generation. For instance you can take a picture and generate pixels with colors from the image. If the color table is active, for each generated color is located the nearest color in the image (in RGB) and the nearest color is used as a result instead of the generated one.

Generated parameters

None.

MODIFICATOR_POINT_OPBOX predefined variables

MODIFICATOR_POINT_OPBOX can perform any color and height operaton on the target pixels. There are some predefined variables for that purpose. All of them are for reading and some of them for writing:

Name Type Mode Meaning
pixel_color_final color R/W color of the processed pixel
pixel_height_final float R/W height of the processed pixel
pixel_normal vector R normal vector of the processed pixel
pixel_coordinate vector R absolute position of processed pixel
pixel_area rectangle R an area where the pixels are generated
target_area rectangle R size of whole target

If more than one target is set (see chapter 8.1), pixel_color_final, pixel_height_final and pixel_normal are available for each target. They are distinguished by a _n suffix where n is a number from 1 to 5:

Name Meaning
pixel_color_final_1 color of pixel for first target
pixel_height_final_1 height of pixel for first target
pixel_normal_1 a normal vector of pixel for first target
pixel_color_final_2 color of pixel for second target
pixel_height_final_2 height of pixel for second target
pixel_normal_2 a normal vector of pixel for second target
... ...
pixel_color_final_5 color of pixel for last target
pixel_height_final_5 height of pixel for last target
pixel_normal_5 a normal vector of pixel for last target

Actually the pixel_color_final, pixel_height_final and pixel_normal are an alias for pixel_color_final_1, pixel_height_final_1 and pixel_normal_1.

MODIFICATOR_POINT_OPBOX operations

There are some operations (aside from direct assigmet) wich can be applied to color, vector, rectangle and number types:

Name Meaning
$+$ Adds two operands with the same type (colors or numbers)
$-$ Subtracts two operands with the same type (colors or numbers)
$*$ Multiplies two operands, can have different types
$/$ Divides two operands, can have different types
$()$ Braces, chnages precedences
$=$ Assignment, can change types

MODIFICATOR_POINT_OPBOX functions

Plus there are some build-in functions:

Name Returns Description
sin(number) number Sine of given number
cos(number) number Cosine of given number
sqrt(number) number Square of given number
norm(number / color) number / color Normalizes given number or color to $<0,1>$range
abs(number) number An absolute value of given number
rgb(number) number Converts an argument from $<0,255>$ range to $<0,1>$ range.

MODIFICATOR_POINT_OPBOX examples

For some examples look at the exampes package, to samples/tutorial/01_point folder.

MODIFICATOR_POINT_OPBOX_INIT operations and variables

MODIFICATOR_POINT_OPBOX_INIT uses the same predefined variables, operations and functions as MODIFICATOR_POINT_OPBOX but if you set a variable in MODIFICATOR_POINT_OPBOX_INIT block, is also available in MODIFICATOR_POINT_OPBOX block. It allows you to define random variables which are persistent for all pixels generated by MODIFICATOR_POINT_OPBOX. There's an example of simple point modificator:

{
  name = pixel_point
  type = MODIFICATOR_POINT_SINGLE

  {
    /*
       Set basic_color variable
       before the pixels are emitted by 
       MODIFICATOR_POINT_OPBOX
     */
    {
      type = MODIFICATOR_POINT_OPBOX_INIT
      basic_color = #ffffff * PARAM_RAND
    }

    /*
       Use the basic_color as a final texture color
       for each pixel
     */
    type = MODIFICATOR_POINT_OPBOX
    pixel_color_final = basic_color
  }
}

The modificator is initialized by random color:

basic_color = #ffffff * PARAM_RAND
and this color is written to target surface for each pixel:
pixel_color_final = basic_color

MODIFICATOR_POINT_OPBOX_INIT examples

For some the examples look at the exampes package, to samples/tutorial/01_point/init.dat.

Extended point modificator

Extended point modificator draws a point (circle) from single pixels. The pixel generation is controlled by properties of generic (basic) modificator.

{
  name = some_modificator_name
  type = MODIFICATOR_POINT_EXTENDED
}

Extended point modificator properties

Extended point modificator does not have any specific properties.

Generated parameters

None.

Rectangle modificator

Rectangle modificator generates points in whole area defined by coordinates.

{
  name = some_modificator_name
  type = MODIFICATOR_RECT
}

Rectangle modificator properties

Extended point modificator does not have any specific properties.

Generated parameters

None.

Height modificators

Heightmap modifiators are used for height or parameter generation.

Height map modificator

Heightmap modificator is a simple heigtmap which can be loaded from a bitmap file, a target surface or generated by a fractal generator. Its typically useful as a master modificator for MODIFICATOR_POINT_SINGLE, where pixel height is inserted to parameter stack, passed to MODIFICATOR_POINT_SINGLE modifiator and used for color shift there.

{
  name = some_modificator_name
  type = MODIFICATOR_HEIGHT_MAP
  
  /*
    [string]          height_bitmap
    
    [enumerated type] height_source
      TEXTURE
      GEOMETRY
      GENERATOR_MESH
      AUX
      MASK
    
    [string]          height_source_name
  */
    
  /*    
    [float]     height_multiplier
    [float]     height_shift
  */
  height_multiplier = 1
  height_shift = 0
  
  /*
    [float]     height_range_min
    [float]     height_range_max
  */  
  height_range_min = 0
  height_range_max = 1
  
  /*    
    [float]     intensity_multiplier
    [float]     intensity_shift
  */
  intensity_multiplier = 1
  intensity_shift = 0
  
  /*
    [float]     intensity_range_min
    [float]     intensity_range_max
  */  
  intensity_range_min = 0
  intensity_range_max = 1

  /*  
    [boolean]   scale_target
    [int]       scale_width
    [int]       scale_height
  */
  heightmap_scale = 0
  height_scale_width = 0
  height_scale_height = 0
}

Height map modificator properties

Generated parameters

Parameter Meaning
0 relative pixel height
1 relative pixel intensity
2 pixel height
3 pixel intensity

Pixel height

is an absolute pixel height. If \(height\_range\_min = 0.5\) and \(height\_range\_max = 0.8\), all pixels are at this range \(<0.5,0.8>\).

Pixel intensity

means that a normal vector is calculated and its dot-product with light vector is passed here. The light vector is \((0,1,0)\) by default.

Relative pixel height

means that pixel height is clamped to $<height\_range\_min, height\_range\_max>$ ranges and adjusted by height_multiplier and height_shift. The formula is:


\begin{displaymath}
height\_translated = \frac{height\_pixel - height\_range\_min}{height\_range\_max - height\_range\_min}
\end{displaymath}


\begin{displaymath}
height\_output = height\_translated * height\_multiplier + height\_shift
\end{displaymath}

Relative pixel intensity

means that pixel intensity is clamped to $<intensity\_range\_min, intensity\_range\_max>$ ranges and adjusted by intensity_multiplier and intensity_shift. The formula is:


\begin{displaymath}
intensity\_translated = \frac{intensity\_pixel - intensity\_range\_min}{intensity\_range\_max - intensity\_range\_min}
\end{displaymath}


\begin{displaymath}
intensity\_output = intensity\_translated * intensity\_multiplier + intensity\_shift
\end{displaymath}

Mid-point modificator

Mid point fractal generator is derived from heightmap modificator so its result is a heighmap. An output of fractal generator is written to temporary heighmap modificator, normalized to $<0,1>$ range and processed as a normal heighmap, so all properties of heightmap modificator can be used.

{
  name = some_modificator_name
  type = MODIFICATOR_FRACTAL

  /*
    [float]             fractal_hurst
  */
  generator_hurst = 0.6
  
  /*
    [float]             fractal_delta
    [float]             fractal_center
  */
  fractal_delta = 1
  fractal_center = 0
  
  /*   
    [float]             correction_center
    [float]             correction_border
    
    [float]             border_start
    [float]             perturbation
    
    [int]               pixel_distance
    [int]               pixel_fill
    
    [int]               pixel_filter
    [int]               pixel_filter_num
    
    [int]               generation_border
  */
  border_start = 0
  pixel_distance = 1
  pixel_fill = TRUE
  pixel_filter = FALSE
  pixel_filter_num = 0
  generation_border = 0
  
  /*
    [enumerated type]   interpolation
      MID_POINT
      LINE_MIN
      LINE_MAX
      LINE_CENTER
      LINE_PRIORITY_HIGH
      LINE_PRIORITY_LOW
      LINE_RANGE_HIGH
      LINE_RANGE_LOW
      LINE_RANDOM
      
    [enumerated type]   interpolation_first
      MID_POINT
      LINE_MIN
      LINE_MAX
      LINE_CENTER
      LINE_PRIORITY_HIGH
      LINE_PRIORITY_LOW
      LINE_RANGE_HIGH
      LINE_RANGE_LOW
      LINE_RANDOM

    [enumerated type]   interpolation_second
      MID_POINT
      LINE_MIN
      LINE_MAX
      LINE_CENTER
      LINE_PRIORITY_HIGH
      LINE_PRIORITY_LOW
      LINE_RANGE_HIGH
      LINE_RANGE_LOW
      LINE_RANDOM
        
    [int]               interpolation_border
  */  
  interpolation = LINE_MAX
  interpolation_border = 0
}

Mid-point modificator properties

Generated parameters

Are the same as for heightmap modificator.

Perlin noise modificator

Perlin noise generator. It's derived from heightmap modificator so its result is a heighmap. It includes all MODIFICATOR_HEIGHT_MAP modificator parameters plus some extra.

{
  name = some_modificator_name
  type = MODIFICATOR_PERLIN

  /*
    [float]             perlin_persistence
    [int]               perlin_octaves_start
    [int]               perlin_octaves
  */
  perlin_persistence = 0.8
  perlin_octaves_start = 0
  perlin_octaves = 30
}

Perlin noise modificator properties

Generated parameters

Are the same as for heightmap modificator.

Line modificators

Single line modificator

Draws line from start point to start+size point.

{
  name = some_modificator_name
  type = MODIFICATOR_LINE

  /*
    [int]       line_size    
  */
  line_size = 1
}

Line modificator properties

Generated parameters

Parameter Meaning
0 pixel distance from start

Pixel distance from start

is a distance from start coordinate. The parameter is 0 for pixel at start and 1 for pixel at start+size.

Leaf modificator

{
  name = some_modificator_name
  type = MODIFICATOR_LINE_LEAF

  /*
    [float, interval] leaf_start
    [float, interval] leaf_stop
  
    [float, interval] leaf_width
    [angle]           leaf_thread_angle
  */
}

Leaf modificator properties

Generated parameters

Parameter Meaning
0 pixel distance from leaf center
1 pixel distance from start

Crack modificator

{
  name = some_modificator_name
  type = MODIFICATOR_CRACK

  /*
    [enumerated type]   crack_type    
      DEFAULT
      CENTER
      
    [float]             direction_treshold
    [float]             direction_angle_range
    
    [int]               crack_branches
    [boolean]           crack_angle_random
  */
  crack_type = DEFAULT
  
  direction_angle_range = 0.1
  direction_treshold = 0.1
  
  crack_branches = 1
  crack_angle_random = FALSE
}

Crack modificator properties

Generated parameters

Parameter Meaning
0 pixel distance from start

Brick modificator

{
  name = some_modificator_name
  type = MODIFICATOR_BRICK

  /*
    [int] brick_corners
        
    [int] brick_width
    [int] brick_height
        
    [float] brick_width_scatter
    [float] brick_height_scatter
        
    [int] brick_width_max
    [int] brick_height_max
        
    [int] brick_width_zip
    [int] brick_height_zip
        
    [float] brick_width_join_pobability
    [float] brick_width_join_pobability_multiplier
        
    [float] brick_height_join_pobability
    [float] brick_height_join_pobability_multiplier
  */
}

Brick modificator properties

Generated parameters

None.

Bunch modificator

Bunch modificator emits points which are connected by splines and filled with some pattern.

Figure 5: Bunch construction scheme.
\includegraphics[scale=0.6]{p11.eps}

A picture 5 describes the construction scheme. The whole object is constructed around center point which also has maximal height.

{
  name = some_modificator_name
  type = MODIFICATOR_BUNCH

  /*
    [float]           height
    
    [float]           height_correction_center
    [float]           height_correction_left
    [float]           height_correction_top      
  */
  height = 1
  
  /*
    [float, interval] corner_curvature
  */
  corner_curvature = 0.4
    
  /*    
    [int, interval]   points
    [float, interval] lenght
  */
  points = 4
  lenght = 0.75  
    
  /*
    [float]           angle
    [int]             border
  */  
  angle = 0
  border = 0
}

Bunch modificator properties

Generated parameters

Parameter Meaning
0 pixel height

Mask modificator

{
  name = some_modificator_name
  type = MODIFICATOR_MASK

  /*
    Mask type:
  
    [enumerated type] mask_type
  
      MASK_BOOL
      MASK_COLOR
      MASK_HEIGHT
  */
  
  /*
    Mask sources:
  
    [string]          mask_bitmap
    
    [enumerated type] mask_source    
      TEXTURE
      GEOMETRY
      GENERATOR_MESH
      AUX
      MASK
      
    [string]          mask_source_name
    
    [vector]          mask_size
  */
}

Mask modificator properties

Generated parameters

None.

Light modificator

Calculates light intensity for each pixel. Light values are written to target unless a slave modifiator is defined. If there is a slave modifiator defined, the light modificator does not emit any pixels to target but passes light intensity as a parameter to slave modificator.

{
  name = some_modificator_name
  type = MODIFICATOR_LIGHT

  /*      
    [bool]    planar
      
    [vector]  light_position
      
    [float]   angle_min
    [float]   angle_scale
      
    [float]   specular_shine
      
    [color]   color_ambient
      
    [bool]    color_diffuse_active
    [color]   color_diffuse
      
    [bool]    color_specular_active
    [color]   color_specular
  */
  planar = 1
  light_position = (0,1,0)
  
  angle_min = 0
  angle_scale = 1
  
  color_ambient = (0,0,0,0)
  
  color_diffuse_active = 1
  color_diffuse = (1,1,1,1)
  
  color_specular_active = 0
  color_specular = (1,1,1,1)
  specular_shine = 1
}

Mask modificator properties

Standard components of phong illumination model. A final light and final pixel color is calculated as:

\begin{displaymath}
diffuse\_light = color\_ambient + (1 - angle\_final) * color\_diffuse
\end{displaymath}


\begin{displaymath}
specular\_light = (1 - \frac{angle\_final}{specular\_shine}) * color\_specular
\end{displaymath}


\begin{displaymath}
pixel\_color = pixel\_color * diffuse\_light + specular\_light
\end{displaymath}

Generated parameters

Parameter Meaning
0 pixel light intensity

Target modificator

Target modificator reads pixels from defined target (target_name) and puts it on parameter stack as parameters. It can be used by simple pixel modificator to write the data to another target.

{
  name = some_modificator_name
  type = MODIFICATOR_TARGET

  /*      
    [string]  target_name
  */
}

Target modificator properties

Generated parameters

Parameter Meaning
0 pixel color, red component
1 pixel color, green component
2 pixel color, blue component
3 pixel color, alpha component
4 pixel color, height component
5 pixel normal vector, x component
6 pixel normal vector, y component
7 pixel normal vector, z component

Filter modificator

Filter modificator can directly filter given target surface. It does not use any slave modificator because it writes data directly to target surface.

{
  name = some_modificator_name
  type = MODIFICATOR_FILTER

  /*      
    [enumerated]  filter_target
      HEIGHT
      COLOR
      
    [enumerated]  filter_type
      INTERPOLATE
      BLUR
      
    [int]         filter_strength
  */
  filter_target = HEIGHT
  filter_type = INTERPOLATE
  filter_strength = 1  
}

Filter modificator properties

Generated parameters

None

Bitmap modificator

TODO

Generator modificator

TODO

About this document ...

Tage data file description

This document was generated using the LaTeX2HTML translator Version 2008 (1.71)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split +0 -no_footnode tage.tex

The translation was initiated by on 2010-12-28


next_inactive up previous
2010-12-28