KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches

Hardware Fog API for the PowerVR More...

Functions

void pvr_fog_table_color (float a, float r, float g, float b)
 Set the table fog color.
 
void pvr_fog_vertex_color (float a, float r, float g, float b)
 Set the vertex fog color.
 
void pvr_fog_far_depth (float d)
 Set the fog far depth.
 
void pvr_fog_table_exp2 (float density)
 Initialize the fog table using an exp2 algorithm (like GL_EXP2).
 
void pvr_fog_table_exp (float density)
 Initialize the fog table using an exp algorithm (like GL_EXP).
 
void pvr_fog_table_linear (float start, float end)
 Initialize the fog table using a linear algorithm (like GL_LINEAR).
 
void pvr_fog_table_custom (float tbl1[])
 Set a custom fog table from float values.
 

Detailed Description

Hardware Fog API for the PowerVR

Note
Thanks to Paul Boese for figuring this stuff out

Function Documentation

◆ pvr_fog_far_depth()

void pvr_fog_far_depth ( float d)

Set the fog far depth.

This function sets the PVR_FOG_DENSITY register appropriately for the specified value.

Parameters
dThe depth to set

◆ pvr_fog_table_color()

void pvr_fog_table_color ( float a,
float r,
float g,
float b )

Set the table fog color.

This function sets the color of fog for table fog. 0-1 range for all colors.

Parameters
aAlpha value of the fog
rRed value of the fog
gGreen value of the fog
bBlue value of the fog

◆ pvr_fog_table_custom()

void pvr_fog_table_custom ( float tbl1[])

Set a custom fog table from float values.

This function allows you to specify whatever values you need to for your fog parameters. All values should be clamped between 0 and 1, and its your responsibility to set up the PVR_FOG_DENSITY register by calling pvr_fog_far_depth() with an appropriate value. The table passed in should have 129 entries, where the 0th entry is farthest from the eye and the last entry is nearest. Higher values = heavier fog.

Parameters
tbl1The table of fog values to set

◆ pvr_fog_table_exp()

void pvr_fog_table_exp ( float density)

Initialize the fog table using an exp algorithm (like GL_EXP).

This function will automatically set the PVR_FOG_DENSITY register to 259.999999 as a part of its processing, then set up the fog table.

Parameters
densityFog density value

◆ pvr_fog_table_exp2()

void pvr_fog_table_exp2 ( float density)

Initialize the fog table using an exp2 algorithm (like GL_EXP2).

This function will automatically set the PVR_FOG_DENSITY register to 259.999999 as a part of its processing, then set up the fog table.

Parameters
densityFog density value

◆ pvr_fog_table_linear()

void pvr_fog_table_linear ( float start,
float end )

Initialize the fog table using a linear algorithm (like GL_LINEAR).

This function will set the PVR_FOG_DENSITY register to the as appropriate for the end value, and initialize the fog table for perspectively correct linear fog.

Parameters
startFog start point
endFog end point

◆ pvr_fog_vertex_color()

void pvr_fog_vertex_color ( float a,
float r,
float g,
float b )

Set the vertex fog color.

This function sets the fog color for vertex fog. 0-1 range for all colors. This function is currently not implemented, as vertex fog is not supported by KOS. Calling this function will cause an assertion failure.

Parameters
aAlpha value of the fog
rRed value of the fog
gGreen value of the fog
bBlue value of the fog