org.xith3d.terrain
Interface GridSurface

All Superinterfaces:
GridResource
All Known Implementing Classes:
TextureSurface

public interface GridSurface
extends GridResource

A GridSurface is used to "prepare" a given rectangular region of a regular grid. This means an implementation provides an Appearance instance and appropriate texture coordinates for the area.

To enable effective data storage for LOD rendering of large scale landscapes, the prepare() method accepts a detail argument specifying the needed resolution of the generated Appearance (respectively for textures).

The values of the detail argument have no strict meaning other than a value of 0 requests the most detailed resolution, the GridSampler implementation has to offer. Higher numbers are for less detailed data resolutions. A detail-level of 0 requests the lowest available resolution. Typically (depends on the overall setup) a detail-level of 2 requests the highest available resolution.

Since:
1.0

Method Summary
 Appearance getAppearance()
          Returns an Appearance instance for a prepared rectangular region of the grid.
 int getTextureUnits()
          Will be called to return the amount of texture units needed.
 org.openmali.vecmath2.TexCoord2f map(float s, float t, int unit)
          Maps the passed grid coordinates to texture coordinates.
 void release()
          
 

Method Detail

getAppearance

Appearance getAppearance()
Returns an Appearance instance for a prepared rectangular region of the grid.


getTextureUnits

int getTextureUnits()
Will be called to return the amount of texture units needed.

Returns:
the number of texture units

map

org.openmali.vecmath2.TexCoord2f map(float s,
                                     float t,
                                     int unit)
Maps the passed grid coordinates to texture coordinates.

Parameters:
s - the "longitude" coordinate of the grid
t - the "latitude" coordinate of the grid
unit - the texture unit for which the coordinates have to be calculated.
Returns:
a texture coordinate

release

void release()

Specified by:
release in interface GridResource