Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 D3D9 How To Combine vert alpha with texture alpha

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
cbx Posted - Apr 10 2003 : 12:12:33 PM
The D3D9 managed "How to" docs has a "Blend a texture with vertex color" example. But, what I think many people want is to apply a texture to there mesh and use the vertex color for setting the ammount of transparency. I am posting this because from the fourm posts that I have read, many people are having trouble doing this.


1: To do this make sure you load your texture with a color key. For example ...

Public Function Add(ByVal Dev As Direct3D.Device, _
ByVal Filename As String, ByVal ColorKey As Color) As Integer
Dim Tex As Direct3D.Texture

Tex = Direct3D.TextureLoader.FromFile(Dev, Filename, _
0, 0, 1, 0, Direct3D.Format.Unknown, _
Direct3D.Pool.Managed, Direct3D.Filter.Linear, _
Direct3D.Filter.Linear, ColorKey.ToArgb)

Return Add(Tex)
End Function


2: Then spesify these texture states when you render your verts ...

' Blend a Texture with Vertex Color
.TextureState(0).ColorOperation = _
Direct3D.TextureOperation.Modulate
TextureState(0).ColorArgument1 = _
Direct3D.TextureArgument.TextureColor
.TextureState(0).ColorArgument2 = _
Direct3D.TextureArgument.Diffuse
.TextureState(0).AlphaOperation = _
Direct3D.TextureOperation.Modulate

... These are the same texture states that you find in the how to example but with one difference. The last line of code ...

.TextureState(0).AlphaOperation = _
Direct3D.TextureOperation.Modulate

... specifies modulate instead of disable.

VBGamer © Go To Top Of Page
This page was generated in 0.04 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.