Results 1 to 3 of 3

Thread: Transparent stuff!?

  1. #1

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75

    Question Transparent stuff!?

    Hey everyone!

    My latest dilema is making a texture in Directx8 transparent. Not like a mask type of thing where one color you cant see, I mean like I want the whole surface to be slightly transparent. Is that like alpha blending or some needlessly complex thing like that? Anyhoo- no matter what it is- how do ya do it!?

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Did you use a transparent texture (like TGA w/ alphachannel)?

  3. #3
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41
    Give the vertices of your object a color (RGBA) with RGB white (to show a normal texture) and A (=alpha) a value for the transparency of that vertex.
    Code:
    D3DColorMake(R, G, B, A) 'with each ranging from 0 to 1
    'or
    D3DColorRGBA(R, G, B, A) 'with each ranging from 0 to 255
    
    'and don't forget to turn alpha blending on
    objD3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
    objD3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
    objD3DDevice.SetRenderState D3DRS_ALPHABLENDENABLE, True

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width