IonicWind Software

IWBasic => 3D Programming => Topic started by: Guilect on August 30, 2008, 07:16:51 PM

Title: How to set alpha level for a custom mesh ?
Post by: Guilect on August 30, 2008, 07:16:51 PM
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)
Title: Re: How to set alpha level for a custom mesh ?
Post by: Ionic Wind Support Team on September 01, 2008, 09:27:31 AM
Use a material and set the diffuse alpha component.

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

Paul.
Title: Re: How to set alpha level for a custom mesh ?
Post by: Guilect on September 01, 2008, 02:32:57 PM
Thanks for the reply.

(Now I know why I usually work in 2D  :P )
Title: Re: How to set alpha level for a custom mesh ?
Post by: Steven Picard on September 16, 2008, 09:28:18 PM
Is this Guilect from Brutus2D?
Title: Re: How to set alpha level for a custom mesh ?
Post by: Guilect on September 17, 2008, 05:13:20 AM
Yes.   :)
Title: Re: How to set alpha level for a custom mesh ?
Post by: Steven Picard on September 17, 2008, 09:17:45 AM
Cool!