//note that these are the game normal defaults. The game may decide to override these depending on card caps //e.g. if card doesn't support w-buffer. //ALWAYS render states must exist in all material files (the game will drop out with an error if it is missing) //NEVER means that a command should not appear in a material file (the game will drop out with an error if it is missing) //ALWAYSW. If the state is missing, it is inserted with the default value automatically. Warning is displayed //NEVERW. If the state is present, it is removed. Warning is displayed. //RARE means that a command will not often appear in a material. If it does, the sustem handles resetting it to a sensible state. //note that the defaults are game defaults. This is the value the state will be reset to if it is a rare-state //for RARE states, it is important that the default is set to the most commonly used value in-game. //state type name Common/rare/never Game default (NOT D3D default) //RenderState ANTIALIAS RARE NONE //RenderState TEXTUREPERSPECTIVE RARE TRUE RenderState ZENABLE RARE USEW //special case, game will choose TRUE or WBUF RenderState FILLMODE RARE SOLID RenderState SHADEMODE RARE GOURAUD RenderState LINEPATTERN RARE 0 RenderState ZWRITEENABLE RARE TRUE RenderState ALPHATESTENABLE RARE FALSE RenderState LASTPIXEL RARE TRUE //TRUE means last pixel is NOT drawn! (?) RenderState SRCBLEND ALWAYSW SRCALPHA RenderState DESTBLEND ALWAYSW INVSRCALPHA RenderState CULLMODE RARE CCW RenderState ZFUNC RARE LESSEQUAL RenderState ALPHAREF RARE 0 RenderState ALPHAFUNC RARE NOTEQUAL //D3D default = ALWAYS RenderState DITHERENABLE RARE TRUE //D3D default = FALSE RenderState ALPHABLENDENABLE ALWAYSW FALSE RenderState FOGENABLE RARE FALSE //the game should set a suitable default for this RenderState SPECULARENABLE RARE FALSE RenderState ZVISIBLE RARE 0 //D3D unsupported //RenderState STIPPLEDALPHA NEVERW FALSE RenderState FOGCOLOR RARE 0 //the game should set a suitable default for this RenderState FOGTABLEMODE RARE NONE RenderState FOGSTART RARE 0.0f //FOGTABLESTART replaced with FOGSTART in DX7 RenderState FOGEND RARE 1.0f //FOGTABLEEND replaced with FOGEND in DX7 RenderState FOGDENSITY RARE 1.0f //FOGTABLEDENSITY replaced with FOGDENSITY in DX7 RenderState EDGEANTIALIAS RARE FALSE //RenderState COLORKEYENABLE NEVERW FALSE RenderState ZBIAS RARE 0 RenderState RANGEFOGENABLE RARE FALSE RenderState TWOSIDEDLIGHTING RARE FALSE RenderState STENCILENABLE RARE FALSE RenderState STENCILFAIL RARE KEEP RenderState STENCILZFAIL RARE KEEP RenderState STENCILPASS RARE KEEP RenderState STENCILFUNC RARE ALWAYS RenderState STENCILREF RARE 0 RenderState STENCILMASK RARE 0xffffffff RenderState STENCILWRITEMASK RARE 0xffffffff RenderState TEXTUREFACTOR RARE 0xffffffff //this function is currently handled separately RenderState WRAP0 RARE 0 //texture set 0 wrap (not stage!) RenderState WRAP1 RARE 0 //these replace WRAPU and WRAPV legacy functions RenderState WRAP2 RARE 0 RenderState WRAP3 RARE 0 RenderState WRAP4 RARE 0 RenderState WRAP5 RARE 0 RenderState WRAP6 RARE 0 RenderState WRAP7 RARE 0 RenderState CLIPPING RARE TRUE //let D3D handle clipping RenderState LIGHTING NEVERW FALSE //lighting is handled as a special case //RenderState EXTENTS NEVERW FALSE RenderState AMBIENT NEVERW 0x00000000 //scene ambient not used in materials RenderState FOGVERTEXMODE RARE NONE RenderState COLORVERTEX RARE FALSE //D3D default is TRUE, FALSE is speedier! RenderState LOCALVIEWER RARE FALSE //D3D default is TRUE, FALSE is speedier! RenderState NORMALIZENORMALS RARE FALSE //RenderState COLORKEYBLENDENABLE NEVERW FALSE RenderState DIFFUSEMATERIALSOURCE RARE COLOR1 /get from vertex colour (except when COLORVERTEX disabled) RenderState SPECULARMATERIALSOURCE RARE COLOR2 //turn off SPECULARENABLE when not needed RenderState AMBIENTMATERIALSOURCE RARE MATERIAL //D3D defaults COLOR2 with specular vertex? RenderState EMISSIVEMATERIALSOURCE RARE MATERIAL RenderState VERTEXBLEND RARE DISABLE RenderState CLIPPLANEENABLE RARE 0 RenderState SOFTWAREVERTEXPROCESSING NEVER FALSE RenderState BLENDOP RARE ADD RenderState COLORWRITEENABLE RARE 15 TextureStageState COLOROP ALWAYSW DISABLE //these must exist for every stage that is used TextureStageState COLORARG1 ALWAYSW TEXTURE //the unused states will always be cleared as before. TextureStageState COLORARG2 ALWAYSW CURRENT TextureStageState ALPHAOP ALWAYSW DISABLE TextureStageState ALPHAARG1 ALWAYSW TEXTURE TextureStageState ALPHAARG2 ALWAYSW CURRENT TextureStageState BUMPENVMAT00 RARE 0 TextureStageState BUMPENVMAT01 RARE 0 TextureStageState BUMPENVMAT10 RARE 0 TextureStageState BUMPENVMAT11 RARE 0 TextureStageState TEXCOORDINDEX ALWAYSW 0 //note that the loader will also remove it if it is considered redundant //TextureStageState ADDRESS RARE WRAP //gets stripped out anyway if the stage doesn't require textures TextureStageState ADDRESSU ALWAYSW WRAP //not allowed yet! TextureStageState ADDRESSV ALWAYSW WRAP TextureStageState BORDERCOLOR NEVERW 0 //such poor support for this, not worth using TextureStageState MAGFILTER RARE LINEAR TextureStageState MINFILTER RARE LINEAR TextureStageState MIPFILTER RARE LINEAR TextureStageState MIPMAPLODBIAS RARE 0.0f TextureStageState MAXMIPLEVEL RARE 0 TextureStageState MAXANISOTROPY RARE 1 TextureStageState BUMPENVLSCALE RARE 0.0f TextureStageState BUMPENVLOFFSET RARE 0.0f TextureStageState TEXTURETRANSFORMFLAGS RARE DISABLE