March 28, 2024, 11:46:54 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


How to set alpha level for a custom mesh ?

Started by Guilect, August 30, 2008, 07:16:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guilect

August 30, 2008, 07:16:51 PM Last Edit: September 01, 2008, 02:33:13 PM by Guilect
I see where you can set the alpha value during creation of a mesh:
#<VERTEX1TEXTURE>pVB.diffuseColor = RGBA(255,255,255,255)

I see commands for setting how the alpha blending is done:
ball.EnableAlpha(TRUE)
ball.SetAlphaOp(D3DBLENDOP_MAX)
ball.SetAlphaSource(D3DBLEND_SRCCOLOR)
ball.SetAlphaDest(D3DBLEND_INVSRCCOLOR)

How does one adjust the alpha value on an already made mesh?
For example to gradually fade out the image.
Do you have to lock vertex buffers and do this stuff again:
#<VERTEX1TEXTURE>pVB.diffuseColor = RGBA(255,255,255,128)

It would be nice to be able to just do:
mesh.SetAlpha(255)
Maybe someone has made a function to do this for any passed mesh:
sub SetAlpha(temp as C3DMesh)

Ionic Wind Support Team

Use a material and set the diffuse alpha component.

ret.SetAlphaArg1(0, D3DTA_DIFFUSE)
ret.SetAlphaOperation(0, D3DTOP_SELECTARG1)

Paul.
Ionic Wind Support Team

Guilect

Thanks for the reply.

(Now I know why I usually work in 2D  :P )

Steven Picard



Steven Picard