Blit for Textures?

Started by Thomas., March 25, 2011, 05:34:18 PM

Previous topic - Next topic

Thomas.

Is there anything like blit(....) but for texture?  :)

EgonOlsen

No. Either use an ITextureEffect for this or compose your texture from different bitmaps, if this is really needed.

Thomas.

#2
I really do not know how to use ITextureEffect... Have you any simple example of this? Say I have this green texture and I want to place the scaled red texture as shown the image.


Thomas.

int[] dest and int[] source are what? Thase are the colors (0x000000)? what y or x coordinates???

EgonOlsen

RGB color values. You can set single pixels of the texture with that.

Thomas.

say I have texture 16x16 and I want set color in point[10,2], is correct if I use dest[26] = 0x000000;?

EgonOlsen

The index is y*16+x in that case. Remember that x and y both start at 0.

Thomas.

I don't see any method like is texture.getArray(), so how can I get colors from other texture?

EgonOlsen

You can (ab)use another ITextureEffect just to grab that data. However, i'm not sure if this is really the best solution to an (for me) unknown problem. Maybe we should take back one step and ask what the actual goal of all this is!?

Thomas.

Still same problem, I have elevator with many floors and I want edit texture depending on where is elevator... I have one texture and I need another texture place into first one...

EgonOlsen

Then why not model the floor display as a simple plane and switch it's texture? It's cheaper and easier than any other solution IMHO.

Thomas.

#11
My english is very bad and I don't know how to describe it... panels that shows floors of elevator are interactive and I can choose floor by touch on screen and I want use scale effect of text during the choosing process :)
So, the best solution for this is ITextureEffect, or...?

Thomas.

#12
ITextureEffect is very slow (from 55 to 24 fps), is there any other solution for this? blit another texture to first one....

EgonOlsen

Uploading new texture data is expensive and not meant to be done every frame. Is this still about the floor display in an elevator? If so, then i still think that rendering all floor numbers into a texture use either the PolygonManager or a texture matrix is the better solution.