C# Class idTech4.Renderer.idImageManager

Afficher le fichier Open project: iainmckay/idtech4.net

Méthodes publiques

Свойство Type Description
ImageFilters ImageFilter>.Dictionary

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat void

BindNullTexture() public méthode

Disable the active texture unit.
public BindNullTexture ( ) : void
Résultat void

ChangeTextureFilter() public méthode

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

CompleteBackgroundLoading() public méthode

public CompleteBackgroundLoading ( ) : void
Résultat void

EndLevelLoad() public méthode

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
Résultat void

GenerateAlphaNotchImage() public static méthode

public static GenerateAlphaNotchImage ( idImage image ) : void
image idImage
Résultat void

GenerateAlphaRampImage() public static méthode

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

GenerateAmbientNormalImage() public static méthode

public static GenerateAmbientNormalImage ( idImage image ) : void
image idImage
Résultat void

GenerateBlackImage() public static méthode

public static GenerateBlackImage ( idImage image ) : void
image idImage
Résultat void

GenerateBorderClampImage() public static méthode

public static GenerateBorderClampImage ( idImage image ) : void
image idImage
Résultat void

GenerateDefaultImage() public static méthode

public static GenerateDefaultImage ( idImage image ) : void
image idImage
Résultat void

GenerateFlatNormalImage() public static méthode

public static GenerateFlatNormalImage ( idImage image ) : void
image idImage
Résultat void

GenerateFogEnterImage() public static méthode

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
Résultat void

GenerateFogImage() public static méthode

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

GenerateNoFalloffImage() public static méthode

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

GenerateQuadraticImage() public static méthode

public static GenerateQuadraticImage ( idImage image ) : void
image idImage
Résultat void

GenerateRGB8Image() public static méthode

public static GenerateRGB8Image ( idImage image ) : void
image idImage
Résultat void

GenerateRGBA8Image() public static méthode

public static GenerateRGBA8Image ( idImage image ) : void
image idImage
Résultat void

GenerateRampImage() public static méthode

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

GenerateSpecular2DTableImage() public static méthode

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

GenerateSpecularTableImage() public static méthode

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

GenerateWhiteImage() public static méthode

public static GenerateWhiteImage ( idImage image ) : void
image idImage
Résultat void

ImageFromFile() public méthode

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
Résultat idImage

ImageFromFile() public méthode

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
Résultat idImage

ImageProgramStringToCompressedFileName() public méthode

public ImageProgramStringToCompressedFileName ( string program ) : string
program string
Résultat string

Init() public méthode

public Init ( ) : void
Résultat void

LoadFromCallback() public méthode

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
Résultat idImage

LoadImage() public méthode

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
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

LoadImageProgram() public méthode

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

ParseImageProgram() public méthode

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
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

QueueBackgroundLoad() public méthode

public QueueBackgroundLoad ( idImage image ) : void
image idImage
Résultat void

ReloadImages() public méthode

public ReloadImages ( ) : void
Résultat void

idImageManager() public méthode

public idImageManager ( ) : System
Résultat System

Property Details

ImageFilters public_oe static_oe property

public static Dictionary ImageFilters
Résultat ImageFilter>.Dictionary