iphone - OpenGL ES 2D - z-ordering, depth buffer vs drawing in order -
iphone - OpenGL ES 2D - z-ordering, depth buffer vs drawing in order -
i'm new opengl sorry if it's silly question. no thought if makes difference, in case, i'm using opengl es 1.1.
currently i'm drawing sprites in order of texture, i've read it's improve performance (makes sense). i'm wondering whether right approach because need sprites in front end of others regardless of texture.
as far i'm aware, options z-ordering either enable depth buffer , utilize that, or switch drawing order sprites drawn in order of z value.
i've read depth buffer can performance hit, changing order. should do?
the short reply is, sort sprites.
it sounds you're creating that's 2d based, , while z-buffer can useful tool, can impressive performance nail if hardware doesn't back upwards it, , if you're not using 3d objects may intersecting 1 another, doesn't create lot of sense me.
in addition, if have sprites partially transparent, i.e. have pixels alpha value isn't 0 or 255 (or 0.0 or 1.0 if using floating point) have sort anyway.
as side note, believe performance lost when changing "sprites" occurs when switching out surfaces, , rarely. 1 way help mitigate problem set many different sprites in 1 image can, on grid, , utilize little pieces of surfaces sprites.
iphone objective-c ios opengl-es
Comments
Post a Comment