Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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.

Posted
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.

Posted

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....)

Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...