C# Class idTech4.Renderer.idImageManager

ファイルを表示 Open project: iainmckay/idtech4.net

Public Properties

Property Type Description
ImageFilters ImageFilter>.Dictionary

Public Methods

Method Description
BeginLevelLoad ( ) : void

Mark all file based images as currently unused, but don't free anything. Calls to ImageFromFile() will either mark the image as used, or create a new image without loading the actual data.

BindNullTexture ( ) : void

Disable the active texture unit.

ChangeTextureFilter ( ) : void

Resets filtering on all loaded images. New images will automatically pick up the current values.

CompleteBackgroundLoading ( ) : void
EndLevelLoad ( ) : void

Free all images marked as unused, and load all images that are necessary. This architecture prevents us from having the union of two level's worth of data present at one time.

GenerateAlphaNotchImage ( idImage image ) : void
GenerateAlphaRampImage ( idImage image ) : void

Creates a 0-255 ramp image.

GenerateAmbientNormalImage ( idImage image ) : void
GenerateBlackImage ( idImage image ) : void
GenerateBorderClampImage ( idImage image ) : void
GenerateDefaultImage ( idImage image ) : void
GenerateFlatNormalImage ( idImage image ) : void
GenerateFogEnterImage ( idImage image ) : void

Modulate the fog alpha density based on the distance of the start and end points to the terminator plane.

GenerateFogImage ( idImage image ) : void

We calculate distance correctly in two planes, but the third will still be projection based.

GenerateNoFalloffImage ( idImage image ) : void

This is a solid white texture that is zero clamped.

GenerateQuadraticImage ( idImage image ) : void
GenerateRGB8Image ( idImage image ) : void
GenerateRGBA8Image ( idImage image ) : void
GenerateRampImage ( idImage image ) : void

Creates a 0-255 ramp image.

GenerateSpecular2DTableImage ( idImage image ) : void

Create a 2D table that calculates (reflection dot , specularity).

GenerateSpecularTableImage ( idImage image ) : void

Creates a ramp that matches our fudged specular calculation.

GenerateWhiteImage ( idImage image ) : void
ImageFromFile ( string name, TextureFilter filter, bool allowDownSize, TextureRepeat repeat, TextureDepth depth ) : idImage

Finds or loads the given image, always returning a valid image pointer. Loading of the image may be deferred for dynamic loading.

ImageFromFile ( string name, TextureFilter filter, bool allowDownSize, TextureRepeat repeat, TextureDepth depth, CubeFiles cubeMap ) : idImage

Finds or loads the given image, always returning a valid image pointer. Loading of the image may be deferred for dynamic loading.

ImageProgramStringToCompressedFileName ( string program ) : string
Init ( ) : void
LoadFromCallback ( string name, ImageLoadCallback generator ) : idImage

Images that are procedurally generated are allways specified with a callback which must work at any time, allowing the render system to be completely regenerated if needed.

LoadImage ( string name, System.DateTime &timeStamp, bool makePowerOf2 ) : Microsoft.Xna.Framework.Graphics.Texture2D

Loads any of the supported image types into a cannonical 32 bit format.

Automatically attempts to load .jpg files if .tga files fail to load.

Anything that is going to make this into a texture would use makePowerOf2 = true, but something loading an image as a lookup table of some sort would leave it in identity form.

It is important to do this at image load time instead of texture load time for bump maps.

timestamp may be NULL if the value is going to be ignored

If data is NULL, the image won't actually be loaded, it will just find the timestamp.

LoadImageProgram ( string name, System.DateTime &timeStamp, TextureDepth &depth ) : Microsoft.Xna.Framework.Graphics.Texture2D
ParseImageProgram ( string source, System.DateTime &timeStamp, TextureDepth &depth ) : Microsoft.Xna.Framework.Graphics.Texture2D

If data is NULL, the timestamps will be filled in, but no image will be generated If both data and timeStamp are NULL, it will just advance past it, which can be used to parse an image program from a text stream.

QueueBackgroundLoad ( idImage image ) : void
ReloadImages ( ) : void
idImageManager ( ) : System

Private Methods

Method Description
Cmd_ReloadImages ( object sender, CommandEventArgs e ) : void

Regenerate all images that came directly from files that have changed, so any saved changes will show up in place.

New r_texturesize/r_texturedepth variables will take effect on reload.

CreateImage ( string name, ImageLoadCallback generator ) : idImage
CreateImage ( string name, TextureType type, TextureFilter filter, TextureRepeat repeat, TextureDepth depth, CubeFiles cubeMap, bool allowDownSize ) : idImage
FogFraction ( float viewHeight, float targetHeight ) : float
InitCvars ( ) : void
InitFilters ( ) : void
SetNormalPalette ( ) : void
SetSamplers ( ) : void

Method Details

BeginLevelLoad() public method

Mark all file based images as currently unused, but don't free anything. Calls to ImageFromFile() will either mark the image as used, or create a new image without loading the actual data.
public BeginLevelLoad ( ) : void
return void

BindNullTexture() public method

Disable the active texture unit.
public BindNullTexture ( ) : void
return void

ChangeTextureFilter() public method

Resets filtering on all loaded images. New images will automatically pick up the current values.
public ChangeTextureFilter ( ) : void
return void

CompleteBackgroundLoading() public method

public CompleteBackgroundLoading ( ) : void
return void

EndLevelLoad() public method

Free all images marked as unused, and load all images that are necessary. This architecture prevents us from having the union of two level's worth of data present at one time.
public EndLevelLoad ( ) : void
return void

GenerateAlphaNotchImage() public static method

public static GenerateAlphaNotchImage ( idImage image ) : void
image idImage
return void

GenerateAlphaRampImage() public static method

Creates a 0-255 ramp image.
public static GenerateAlphaRampImage ( idImage image ) : void
image idImage
return void

GenerateAmbientNormalImage() public static method

public static GenerateAmbientNormalImage ( idImage image ) : void
image idImage
return void

GenerateBlackImage() public static method

public static GenerateBlackImage ( idImage image ) : void
image idImage
return void

GenerateBorderClampImage() public static method

public static GenerateBorderClampImage ( idImage image ) : void
image idImage
return void

GenerateDefaultImage() public static method

public static GenerateDefaultImage ( idImage image ) : void
image idImage
return void

GenerateFlatNormalImage() public static method

public static GenerateFlatNormalImage ( idImage image ) : void
image idImage
return void

GenerateFogEnterImage() public static method

Modulate the fog alpha density based on the distance of the start and end points to the terminator plane.
public static GenerateFogEnterImage ( idImage image ) : void
image idImage
return void

GenerateFogImage() public static method

We calculate distance correctly in two planes, but the third will still be projection based.
public static GenerateFogImage ( idImage image ) : void
image idImage
return void

GenerateNoFalloffImage() public static method

This is a solid white texture that is zero clamped.
public static GenerateNoFalloffImage ( idImage image ) : void
image idImage
return void

GenerateQuadraticImage() public static method

public static GenerateQuadraticImage ( idImage image ) : void
image idImage
return void

GenerateRGB8Image() public static method

public static GenerateRGB8Image ( idImage image ) : void
image idImage
return void

GenerateRGBA8Image() public static method

public static GenerateRGBA8Image ( idImage image ) : void
image idImage
return void

GenerateRampImage() public static method

Creates a 0-255 ramp image.
public static GenerateRampImage ( idImage image ) : void
image idImage
return void

GenerateSpecular2DTableImage() public static method

Create a 2D table that calculates (reflection dot , specularity).
public static GenerateSpecular2DTableImage ( idImage image ) : void
image idImage
return void

GenerateSpecularTableImage() public static method

Creates a ramp that matches our fudged specular calculation.
public static GenerateSpecularTableImage ( idImage image ) : void
image idImage
return void

GenerateWhiteImage() public static method

public static GenerateWhiteImage ( idImage image ) : void
image idImage
return void

ImageFromFile() public method

Finds or loads the given image, always returning a valid image pointer. Loading of the image may be deferred for dynamic loading.
public ImageFromFile ( string name, TextureFilter filter, bool allowDownSize, TextureRepeat repeat, TextureDepth depth ) : idImage
name string
filter TextureFilter
allowDownSize bool
repeat TextureRepeat
depth TextureDepth
return idImage

ImageFromFile() public method

Finds or loads the given image, always returning a valid image pointer. Loading of the image may be deferred for dynamic loading.
public ImageFromFile ( string name, TextureFilter filter, bool allowDownSize, TextureRepeat repeat, TextureDepth depth, CubeFiles cubeMap ) : idImage
name string
filter TextureFilter
allowDownSize bool
repeat TextureRepeat
depth TextureDepth
cubeMap CubeFiles
return idImage

ImageProgramStringToCompressedFileName() public method

public ImageProgramStringToCompressedFileName ( string program ) : string
program string
return string

Init() public method

public Init ( ) : void
return void

LoadFromCallback() public method

Images that are procedurally generated are allways specified with a callback which must work at any time, allowing the render system to be completely regenerated if needed.
public LoadFromCallback ( string name, ImageLoadCallback generator ) : idImage
name string
generator ImageLoadCallback
return idImage

LoadImage() public method

Loads any of the supported image types into a cannonical 32 bit format.
Automatically attempts to load .jpg files if .tga files fail to load.

Anything that is going to make this into a texture would use makePowerOf2 = true, but something loading an image as a lookup table of some sort would leave it in identity form.

It is important to do this at image load time instead of texture load time for bump maps.

timestamp may be NULL if the value is going to be ignored

If data is NULL, the image won't actually be loaded, it will just find the timestamp.

public LoadImage ( string name, System.DateTime &timeStamp, bool makePowerOf2 ) : Microsoft.Xna.Framework.Graphics.Texture2D
name string
timeStamp System.DateTime
makePowerOf2 bool
return Microsoft.Xna.Framework.Graphics.Texture2D

LoadImageProgram() public method

public LoadImageProgram ( string name, System.DateTime &timeStamp, TextureDepth &depth ) : Microsoft.Xna.Framework.Graphics.Texture2D
name string
timeStamp System.DateTime
depth TextureDepth
return Microsoft.Xna.Framework.Graphics.Texture2D

ParseImageProgram() public method

If data is NULL, the timestamps will be filled in, but no image will be generated If both data and timeStamp are NULL, it will just advance past it, which can be used to parse an image program from a text stream.
public ParseImageProgram ( string source, System.DateTime &timeStamp, TextureDepth &depth ) : Microsoft.Xna.Framework.Graphics.Texture2D
source string
timeStamp System.DateTime
depth TextureDepth
return Microsoft.Xna.Framework.Graphics.Texture2D

QueueBackgroundLoad() public method

public QueueBackgroundLoad ( idImage image ) : void
image idImage
return void

ReloadImages() public method

public ReloadImages ( ) : void
return void

idImageManager() public method

public idImageManager ( ) : System
return System

Property Details

ImageFilters public_oe static_oe property

public static Dictionary ImageFilters
return ImageFilter>.Dictionary