Slade Posted September 18, 2003 Posted September 18, 2003 (edited) I'm attempting to convert my UI code that is successfully using TransformedTextured to code that uses PositionTextured so that my imagry changes size to fit when resolution is changed. From my understanding I simply need to set my view and world matrices to Identity and then setup my projection matrix to fit the screen.. I've put together a little test app that does it as such. device.Transform.World = Matrix.Identity; device.Transform.View = Matrix.Identity; device.Transform.Projection = Matrix.OrthoOffCenterLH(0, 640, 480, 0, 0, 1); However I'm not getting the results I expect. Does anyone have any ideas? (I've attached the complete source to my test)form1.cs Edited September 18, 2003 by Slade Quote
Slade Posted September 18, 2003 Author Posted September 18, 2003 I've actually narrowed it down to a problem with alpha // These two lines cause the code to render nothing device.RenderState.SourceBlend = Blend.SourceAlpha; device.RenderState.DestinationBlend = Blend.InvSourceAlpha; // These two lines cause it to work. device.RenderState.SourceBlend = Blend.One; device.RenderState.DestinationBlend = Blend.Zero; this kills the alpha blending however :/ I guess now I'm lost on why this works as I'd like it to with transformed vertices, but not with position ones. Quote
Menge Posted September 18, 2003 Posted September 18, 2003 i dont know... but u can go and pretend stupid (like me) and do this - dont change the SourceBlend nor the DestinationBlend properties - use color keying when painting the images (this keeps the alpha values). Quote Menge
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.