rifter1818 Posted March 19, 2004 Posted March 19, 2004 How can i make a certain color (for instance Black) transparant in an allready loaded Texture (or surface). So far the only means by which i can think of is SufaceLoader.FromSurface(Surf,Surf,SomeFilter,color.black.toargb) this works however the framerate drops from 60 to 3 which a bit too much, ive tried filter.point,.linear,.none all end up with the same wonderfull 3 fps so i dont think its the filter.... Does anyone know of an actually usefull way to do this? Actually Thinking about it its probably because the surface is so large, so i guess next question asside from is there a more efficiant way to apply a transparancy, is what is the best way to scale a texture or surface down? Quote
RobyDx Posted March 19, 2004 Posted March 19, 2004 I think the best way is a rectangle with texture. Load it with color key and use alphatestenable=true use alphafunc to determine what show and how. Quote Come to visit
rifter1818 Posted March 19, 2004 Author Posted March 19, 2004 Sorry I think the best way is a rectangle with texture. Load it with color key and use alphatestenable=true use alphafunc to determine what show and how. Could you include a qiuck code snipit please, and thanks once again for all your help. Quote
RobyDx Posted March 19, 2004 Posted March 19, 2004 Could you include a qiuck code snipit please' date=' and thanks once again for all your help.[/quote'] device.RenderState.AlphaTestEnable = True device.RenderState.ReferenceAlpha=0 (or 255) device.RenderState.AlphaFunction=Compare.equal (or notEqual) With this set you altern show of part that has colorkey or not. load a texture with color key and apply it to a models. Quote Come to visit
rifter1818 Posted March 19, 2004 Author Posted March 19, 2004 Ohh device.RenderState.AlphaTestEnable = True device.RenderState.ReferenceAlpha=0 (or 255) device.RenderState.AlphaFunction=Compare.equal (or notEqual) With this set you altern show of part that has colorkey or not. load a texture with color key and apply it to a models. What i want to do is apply the transparancy to an allready loaded texture. (like for instance a texture i created by rendering to its surface....) Quote
RobyDx Posted March 19, 2004 Posted March 19, 2004 What i want to do is apply the transparancy to an allready loaded texture. (like for instance a texture i created by rendering to its surface....) just load a texture with colorkey. In the instruction for creating pass a color.toargb value for renderToSurface use a A8R8G8B format and render on this surface image that has color key. Then apply to a square and you 'll have trasparencties Quote Come to visit
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.