TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sces99
NA
3
0
Can't use simple material alpha blending ?
Apr 1 2005 2:54 AM
I want to make a simple quad (custom vertexs) fading in and out (work as a fade in/out background). I see there are some method to changing alpha , like vertex alpha , texture alpha , material alpha. But I want a simple changing alpha method by setting the material alpha , but somehow , I do not work. Below is my code : (DirectX 9.0 SDK 2004 Summer update + Visual Studio 2003) device.VertexFormat = CustomVertex.TransformedColoredTextured.Format; device.RenderState.AlphaBlendEnable = true; device.RenderState.SourceBlend = Blend.SourceAlpha; device.RenderState.DestinationBlend = Blend.InvSourceAlpha; backgroundColor = Color.FromArgb((int)backgroundAlpha * 0xff, 255, 255, 255); backgroundMaterial.Diffuse = backgroundColor; device.TextureState[0].AlphaArgument1 = TextureArgument.Diffuse; device.TextureState[0].AlphaOperation = TextureOperation.SelectArg1; device.Material = backgroundMaterial; device.SetStreamSource( 0, backgroundVertexBuffer, 0 ); device.DrawPrimitives( PrimitiveType.TriangleStrip, 0, 2 ); device.RenderState.AlphaBlendEnable = false; The alpha is control by backgroundAlpha ( 0 <= a <= 1). Anyone help ?
Reply
Answers (
0
)
After two alt tabs, full screen DX app constantly sending D3DERR_DEVLOST exception.
Resetting device error