Thread: D3DRenderStates

Results 1 to 4 of 4
  1. #1
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh

    D3DRenderStates

    I recently found this useful for something i'm working on and figured i'd share it because there's quite a few options i never knew about and figured it might help someone out

    Code:
    typedef enum D3DRENDERSTATETYPE { 
      D3DRS_ZENABLE                     = 7,
      D3DRS_FILLMODE                    = 8,
      D3DRS_SHADEMODE                   = 9,
      D3DRS_ZWRITEENABLE                = 14,
      D3DRS_ALPHATESTENABLE             = 15,
      D3DRS_LASTPIXEL                   = 16,
      D3DRS_SRCBLEND                    = 19,
      D3DRS_DESTBLEND                   = 20,
      D3DRS_CULLMODE                    = 22,
      D3DRS_ZFUNC                       = 23,
      D3DRS_ALPHAREF                    = 24,
      D3DRS_ALPHAFUNC                   = 25,
      D3DRS_DITHERENABLE                = 26,
      D3DRS_ALPHABLENDENABLE            = 27,
      D3DRS_FOGENABLE                   = 28,
      D3DRS_SPECULARENABLE              = 29,
      D3DRS_FOGCOLOR                    = 34,
      D3DRS_FOGTABLEMODE                = 35,
      D3DRS_FOGSTART                    = 36,
      D3DRS_FOGEND                      = 37,
      D3DRS_FOGDENSITY                  = 38,
      D3DRS_RANGEFOGENABLE              = 48,
      D3DRS_STENCILENABLE               = 52,
      D3DRS_STENCILFAIL                 = 53,
      D3DRS_STENCILZFAIL                = 54,
      D3DRS_STENCILPASS                 = 55,
      D3DRS_STENCILFUNC                 = 56,
      D3DRS_STENCILREF                  = 57,
      D3DRS_STENCILMASK                 = 58,
      D3DRS_STENCILWRITEMASK            = 59,
      D3DRS_TEXTUREFACTOR               = 60,
      D3DRS_WRAP0                       = 128,
      D3DRS_WRAP1                       = 129,
      D3DRS_WRAP2                       = 130,
      D3DRS_WRAP3                       = 131,
      D3DRS_WRAP4                       = 132,
      D3DRS_WRAP5                       = 133,
      D3DRS_WRAP6                       = 134,
      D3DRS_WRAP7                       = 135,
      D3DRS_CLIPPING                    = 136,
      D3DRS_LIGHTING                    = 137,
      D3DRS_AMBIENT                     = 139,
      D3DRS_FOGVERTEXMODE               = 140,
      D3DRS_COLORVERTEX                 = 141,
      D3DRS_LOCALVIEWER                 = 142,
      D3DRS_NORMALIZENORMALS            = 143,
      D3DRS_DIFFUSEMATERIALSOURCE       = 145,
      D3DRS_SPECULARMATERIALSOURCE      = 146,
      D3DRS_AMBIENTMATERIALSOURCE       = 147,
      D3DRS_EMISSIVEMATERIALSOURCE      = 148,
      D3DRS_VERTEXBLEND                 = 151,
      D3DRS_CLIPPLANEENABLE             = 152,
      D3DRS_POINTSIZE                   = 154,
      D3DRS_POINTSIZE_MIN               = 155,
      D3DRS_POINTSPRITEENABLE           = 156,
      D3DRS_POINTSCALEENABLE            = 157,
      D3DRS_POINTSCALE_A                = 158,
      D3DRS_POINTSCALE_B                = 159,
      D3DRS_POINTSCALE_C                = 160,
      D3DRS_MULTISAMPLEANTIALIAS        = 161,
      D3DRS_MULTISAMPLEMASK             = 162,
      D3DRS_PATCHEDGESTYLE              = 163,
      D3DRS_DEBUGMONITORTOKEN           = 165,
      D3DRS_POINTSIZE_MAX               = 166,
      D3DRS_INDEXEDVERTEXBLENDENABLE    = 167,
      D3DRS_COLORWRITEENABLE            = 168,
      D3DRS_TWEENFACTOR                 = 170,
      D3DRS_BLENDOP                     = 171,
      D3DRS_POSITIONDEGREE              = 172,
      D3DRS_NORMALDEGREE                = 173,
      D3DRS_SCISSORTESTENABLE           = 174,
      D3DRS_SLOPESCALEDEPTHBIAS         = 175,
      D3DRS_ANTIALIASEDLINEENABLE       = 176,
      D3DRS_MINTESSELLATIONLEVEL        = 178,
      D3DRS_MAXTESSELLATIONLEVEL        = 179,
      D3DRS_ADAPTIVETESS_X              = 180,
      D3DRS_ADAPTIVETESS_Y              = 181,
      D3DRS_ADAPTIVETESS_Z              = 182,
      D3DRS_ADAPTIVETESS_W              = 183,
      D3DRS_ENABLEADAPTIVETESSELLATION  = 184,
      D3DRS_TWOSIDEDSTENCILMODE         = 185,
      D3DRS_CCW_STENCILFAIL             = 186,
      D3DRS_CCW_STENCILZFAIL            = 187,
      D3DRS_CCW_STENCILPASS             = 188,
      D3DRS_CCW_STENCILFUNC             = 189,
      D3DRS_COLORWRITEENABLE1           = 190,
      D3DRS_COLORWRITEENABLE2           = 191,
      D3DRS_COLORWRITEENABLE3           = 192,
      D3DRS_BLENDFACTOR                 = 193,
      D3DRS_SRGBWRITEENABLE             = 194,
      D3DRS_DEPTHBIAS                   = 195,
      D3DRS_WRAP8                       = 198,
      D3DRS_WRAP9                       = 199,
      D3DRS_WRAP10                      = 200,
      D3DRS_WRAP11                      = 201,
      D3DRS_WRAP12                      = 202,
      D3DRS_WRAP13                      = 203,
      D3DRS_WRAP14                      = 204,
      D3DRS_WRAP15                      = 205,
      D3DRS_SEPARATEALPHABLENDENABLE    = 206,
      D3DRS_SRCBLENDALPHA               = 207,
      D3DRS_DESTBLENDALPHA              = 208,
      D3DRS_BLENDOPALPHA                = 209,
      D3DRS_FORCE_DWORD                 = 0x7fffffff
    } D3DRENDERSTATETYPE, *LPD3DRENDERSTATETYPE;
    basic usage
    Code:
    //Invert Mode
    pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA);
    
    //HD Mode
    pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR);
    
    //White Walls
    pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
    there's a lot of other stuff you can do like with Fog color mixing and different stencil effects are all i've dug through so far

    credits go to microsoft

    to learn about all this, idk if i can post a link to microsoft, just remove it if i can't
    Code:
    http://msdn.microsoft.com/en-us/library/windows/desktop/bb174693(v=vs.85).aspx
    Last edited by supercarz1991; 12-11-2013 at 09:42 AM.

    commando: You're probably the best non-coder coder I know LOL


  2. The Following 2 Users Say Thank You to supercarz1991 For This Useful Post:

    gibam761 (12-11-2013),pDevice (12-11-2013)

  3. #2
    zikox's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    568
    Reputation
    40
    Thanks
    993
    My Mood
    Cool
    Nice keep going

  4. #3
    Fєηix's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    Brαzil
    Posts
    1,124
    Reputation
    114
    Thanks
    6,645
    My Mood
    Sleepy
    d3d9types.h

  5. The Following User Says Thank You to Fєηix For This Useful Post:

    topblast (12-12-2013)

  6. #4
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    4,922
    My Mood
    Cool
    Quote Originally Posted by --Fenix-- View Post
    d3d9types.h
    I wouldnt call this source code, more like info, these are already defined in 'd3d9types.h', some of the information is useful but could of done more.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development