Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtMipmapK
[Mipmapping]


Functions

void  RtMipKClumpCalculateKValues (RpClump *clump, RwCamera *camera)
void  RtMipKWorldCalculateKValues (RpWorld *world, RwCamera *camera)

Detailed Description

PlayStation 2 / Mipmap K Value Toolkit for RenderWare.

RtMipK Toolkit Overview

Requirements
There are four versions of the RtMipK libraries in the RenderWare Graphics SDK. They are fully featured versions on the RtMipK toolkit, and they contain identical APIs. However, because the rendering pipelines are large we've taken the step to compile different versions of the toolkit so that the user can select precisely the pipelines they will be using.
Requirements for rtmipk library
Requirements for rtmipkmatfx library
Requirements for rtmipkpatch library
Requirements for rpmipkpatchmatfx library
Note:
Only one of the rtmipk libraries should be used in an application at once.

Overview

The RtMipK Toolkit is used to try and calculate realistic "K" values for textures in RpClump's and RpWorld's. The "K" values are stored in the texture with either the RpMipmapKL plugin or directly into the driver texture specific data.

The set "K" value is calculated as the average "K" value for all the triangles using a RwTexture.

So we first calculate the screen texel ratio by:


   screen texel ratio :=        (video mode width * video mode height)
                         ----------------------------------------------------
                         ((view window width * 2) * (view window height * 2))
   

Then the triangle texel area is calculated, by calculating the screen pixel area per triangle:


    screen space pixel area := triangle area * screen texel ratio
   

Then the pixel to texel ratio for the triangle:


   pixel to texel ratio := screen space pixel area * texel area
   

The root of this the pixel to texel ratio is added to the sum for all the triangles referencing the texture.

Finally we calculate the average "K" value by:


   average "K" := - ( log( sum / count ) / log(2) )
   

This MipMap "K" value is then stored in the texture.


Function Documentation

void RtMipKClumpCalculateKValues RpClump   clump,
RwCamera   camera
 

RtMipKClumpCalculateKValues computes the Sky specific "K" values for textures used in a clump's atomics, based on the current video mode and the view window of the specified camera.

Parameters:
clump  pointer to the clump
camera  pointer to the camera
See also:
RtMipKWorldCalculateKValues
void RtMipKWorldCalculateKValues RpWorld   world,
RwCamera   camera
 

RtMipKWorldCalculateKValues computes the Sky specific "K" values for textures used in a world, based on the current video mode and the view window of the specified camera.

Parameters:
world  pointer to the world
camera  pointer to the camera
See also:
RtMipKClumpCalculateKValues

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:59 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)