|
|
//===== Copyright (c) Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
// $NoKeywords: $
//==================================================================//
#ifndef VTF_DECLARATIONS_H
#define VTF_DECLARATIONS_H
#ifdef _WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CUtlBuffer; class Vector; struct Rect_t; class IFileSystem;
//-----------------------------------------------------------------------------
// Texture flags
//-----------------------------------------------------------------------------
enum CompiledVtfFlags { // Flags from the *.txt config file
TEXTUREFLAGS_POINTSAMPLE = 0x00000001, TEXTUREFLAGS_TRILINEAR = 0x00000002, TEXTUREFLAGS_CLAMPS = 0x00000004, TEXTUREFLAGS_CLAMPT = 0x00000008, TEXTUREFLAGS_ANISOTROPIC = 0x00000010, TEXTUREFLAGS_HINT_DXT5 = 0x00000020, TEXTUREFLAGS_PWL_CORRECTED = 0x00000040, TEXTUREFLAGS_NORMAL = 0x00000080, TEXTUREFLAGS_NOMIP = 0x00000100, TEXTUREFLAGS_NOLOD = 0x00000200, TEXTUREFLAGS_ALL_MIPS = 0x00000400, TEXTUREFLAGS_PROCEDURAL = 0x00000800,
// These are automatically generated by vtex from the texture data.
TEXTUREFLAGS_ONEBITALPHA = 0x00001000, TEXTUREFLAGS_EIGHTBITALPHA = 0x00002000,
// Newer flags from the *.txt config file
TEXTUREFLAGS_ENVMAP = 0x00004000, TEXTUREFLAGS_RENDERTARGET = 0x00008000, TEXTUREFLAGS_DEPTHRENDERTARGET = 0x00010000, TEXTUREFLAGS_NODEBUGOVERRIDE = 0x00020000, TEXTUREFLAGS_SINGLECOPY = 0x00040000, TEXTUREFLAGS_SRGB = 0x00080000, //SRGB correction has already been applied to this texture.
TEXTUREFLAGS_DEFAULT_POOL = 0x00100000, // Nvidia Stereo Change: Water (Force a texture to the default pool)
TEXTUREFLAGS_COMBINED = 0x00200000,
TEXTUREFLAGS_ASYNC_DOWNLOAD = 0x00400000,
TEXTUREFLAGS_NODEPTHBUFFER = 0x00800000,
TEXTUREFLAGS_SKIP_INITIAL_DOWNLOAD = 0x01000000, // Skip initial download when creating a procedural texture
TEXTUREFLAGS_CLAMPU = 0x02000000, TEXTUREFLAGS_VERTEXTEXTURE = 0x04000000, // Usable as a vertex texture
TEXTUREFLAGS_SSBUMP = 0x08000000,
TEXTUREFLAGS_MOST_MIPS = 0x10000000, // Don't load the bottom few mips at runtime
TEXTUREFLAGS_BORDER = 0x20000000, // Clamp to border color on all texture coordinates
#if defined( _PS3 ) || defined SPU
// PS3 extensions
TEXTUREFLAGS_QUINCUNX = 0x40000000, TEXTUREFLAGS_QUINCUNX_ALT = 0x80000000, #elif defined( _X360 )
TEXTUREFLAGS_ALIAS_COLOR_AND_DEPTH_SURFACES = 0x40000000, TEXTUREFLAGS_UNUSED_80000000 = 0x80000000, #else
TEXTUREFLAGS_UNUSED_40000000 = 0x40000000, TEXTUREFLAGS_UNUSED_80000000 = 0x80000000, #endif
};
enum VersionedVtfFlags { VERSIONED_VTF_FLAGS_MASK_7_3 = ~0xD1780400, // For a ver 7.3 or earlier only these flags are valid
};
struct VtfProcessingOptions { uint32 cbSize; // Set to sizeof( VtfProcessingOptions )
//
// Flags0
//
enum Flags0 { // Have a channel decaying to a given decay goal for the given last number of mips
OPT_DECAY_R = 0x00000001, // Red decays
OPT_DECAY_G = 0x00000002, // Green decays
OPT_DECAY_B = 0x00000004, // Blue decays
OPT_DECAY_A = 0x00000008, // Alpha decays
OPT_DECAY_EXP_R = 0x00000010, // Channel R decays exponentially (otherwise linearly)
OPT_DECAY_EXP_G = 0x00000020, // Channel G decays exponentially (otherwise linearly)
OPT_DECAY_EXP_B = 0x00000040, // Channel B decays exponentially (otherwise linearly)
OPT_DECAY_EXP_A = 0x00000080, // Channel A decays exponentially (otherwise linearly)
OPT_NOCOMPRESS = 0x00000100, // Use uncompressed image format
OPT_NORMAL_DUDV = 0x00000200, // dU dV normal map
OPT_FILTER_NICE = 0x00000400, // Use nice filtering
OPT_SRGB_PC_TO_360 = 0x00000800, // Perform srgb correction for colormaps
OPT_SET_ALPHA_ONEOVERMIP = 0x00001000, // Alpha = 1/miplevel
OPT_PREMULT_COLOR_ONEOVERMIP = 0x00002000, // Color *= 1/miplevel
OPT_MIP_ALPHATEST = 0x00004000, // Alpha-tested mip generation
OPT_NORMAL_GA = 0x00008000, // Use Green-Alpha normal compression
OPT_PREMULT_ALPHA_MIPFRACTION = 0x00010000, // Alpha *= miplevel/mipcount
OPT_COMPUTE_GRADIENT = 0x00020000 // Compute normalized du du gradients of green channel and store in r and b
};
uint32 flags0; // A combination of "Flags0"
//
// Decay settings
//
uint8 clrDecayGoal[4]; // Goal colors for R G B A
uint8 numNotDecayMips[4]; // Number of first mips unaffected by decay (0 means all below mip0)
float fDecayExponentBase[4]; // For exponential decay the base number (e.g. 0.75)
//
// Alpha fading with mip levels
//
uint8 fullAlphaAtMipLevel; uint8 minAlpha; };
//-----------------------------------------------------------------------------
// Cubemap face indices
//-----------------------------------------------------------------------------
enum CubeMapFaceIndex_t { CUBEMAP_FACE_RIGHT = 0, CUBEMAP_FACE_LEFT, CUBEMAP_FACE_BACK, // NOTE: This face is in the +y direction?!?!?
CUBEMAP_FACE_FRONT, // NOTE: This face is in the -y direction!?!?
CUBEMAP_FACE_UP, CUBEMAP_FACE_DOWN,
CUBEMAP_FACE_COUNT,
// This is the fallback for low-end (obsolete, here for backward compat!)
CUBEMAP_FACE_SPHEREMAP = CUBEMAP_FACE_COUNT,
};
//-----------------------------------------------------------------------------
// Enumeration used for spheremap generation
//-----------------------------------------------------------------------------
enum LookDir_t { LOOK_DOWN_X = 0, LOOK_DOWN_NEGX, LOOK_DOWN_Y, LOOK_DOWN_NEGY, LOOK_DOWN_Z, LOOK_DOWN_NEGZ, };
#endif // VTF_H
|