Hello for all! I'm writing client for online game and have a problem.
As it is on screenshot ONE frame consists of many images. If i at first render images to texture and then do billboard->setTexture(), then it have very, very poor perfomance. Because it's also need to rescale/rotate "basic" images. What can i do? I think there is way with matrixes when i set it, then draw basic image and so on.
Last edited by Randajad on Mon Sep 10, 2012 12:44 pm, edited 1 time in total.
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
Not sure if I got the other part of your question. The part of the texture used is affected by uv-coordinates for each vertex. Rotation can be done by setting a texture-matrix for the corresponding TextureLayer in your material: http://irrlicht.sourceforge.net/docu/cl ... layer.html
Sorry, too many mistakes in my post above. I don't know how i wrote it.
I'm reupload image.
So. I had animation which consists of many frames. Each frame consists of "basic" images. Basic image have position, scale and rotate. I need to show frames. How i can render it better?
I try to make final frame by drawing basic images on iimage and creting itexture, then set this texture to billboard. But it's have poor perfomance. I think there is way to draw right basics images on screen and when node is rendering, disable zbuffer to draw one picture on another. Is there?
Last edited by Randajad on Mon Sep 10, 2012 1:44 pm, edited 1 time in total.
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
Hm, first question - do you really need a billboard? Billboard is for putting an image in 3D ... this looks on first view like something you could do with 2d.
And if that would be sufficient you could use IVideoDriver 2d drawing functions. For rotation - please search around the forum for image rotation, I think there had been some solutions. I'm not certain on how I would do that myself, I guess I would try setting the world-matrix to some rotation matrix before using 2d drawing functions, but don't know if this works as I didn't try. Disabling zbuffer can be done as mentioned above by setting an SMaterial with ZBuffer and ZWriteEnable to whatever you need. And then use IVideoDriver::setMaterial before calling your draw functions.
maybe a draw3DSpriteBatch could be a nice addition to the video driver? or anything that did something similar to drawing a large amount of billboards, each of them with a custom texture fragment that could change on a per call basis.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
@ Randajad, no those flags are not only for transparency, transparency just also needs them. But you probably need to set ZBuffer and not ZWriteEnable in your case. And I suspect you have to set it to irr::video::ECFN_ALWAYS which sounds like write always to me.
@Mel: Yeah, I had hoped spritebanks would be extended to have more sprite functions one day. But not sure right now if Bitplane will ever get back to working on those... he's been a little quite lately :-(
I'm not certain from this shots what the problem is. Should there be a full person above the shoes which is overlapped by the castle? Is the castle 3d or another sprite? If it is another sprite - what about the gras - is that the same sprite as the castle?
You must be a little more talkative - we don't see/know what's going on except for what you describe :-)
All world is 3d. Characters are sprites.
So, i think, then there is no way to resolve zbuffer trouble. Okay, i will try to find another way to do what i need.
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^