2013-07-09 1 views
0

그냥 보지 못했던 간단한 수정 사항 : 빌보드에 투명도를 구현하려고하지만 스프라이트는 정의되지 않은 픽셀이있는 곳에서 단색을 유지합니다. 투명 png 파일 자체. 나는 투명도 (0의 값과 1 사이의 float)Windows Phone 용 XNA의 빌보드 투명성

spriteBatch.Begin(0, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect); 

Vector3 viewSpaceTextPosition = Vector3.Transform(this.position, camera.View * invertY); 
spriteBatch.Draw(Texture, new Vector2(viewSpaceTextPosition.X, viewSpaceTextPosition.Y), null, Color.White * this.Transparency /*Here's where I try to set the transparency of the image drawn*/, 0, new Vector2(Texture.Bounds.Center.X, Texture.Bounds.Center.Y), this.Scale, SpriteEffects.None, viewSpaceTextPosition.Z); 

spriteBatch.End(); 

은 명백한 실수가 있습니까 의해 Color.White를 곱하여 투명도를 변경하기 위해 노력하고있어? 아니면 3D로 투명하게 렌더링 할 수없는 Windows Phone 7 용 XNA입니까?

답변

1

대신 내장 된 스프라이트 효과, 난 당신이 재료 알파 설정해야 확신의 BasicEffect 사용하고 있기 때문에 :

basicEffect.Alpha = this.Transparency; 
+0

감사합니다, 그것은 지금은 완벽하게 작동을 :) – TotalJargon