performance - Render The Same Model Multiple Times -
what i'm trying do, having 1 model gets rendered multiple times, different translations , rotations.
so know how use array buffers
, array element buffers
(vertex buffer objects
), question is. when i've loaded model vbo
best approach if wanted render multiple times different translations , rotations.
i have 2 theories how done. (though i'm asking best approach).
load model 1
vbo
, keep callinggldrawarrays
, apply translation , rotation, each model want rendered.load model 1
vbo
multiple times. same model gets stored multiple times, which ends using lot of memory.
extra: when doing 1 way, quadtrees and/or frustum can used minimize amount of models required rendered.
which 1 of these ways best do, if want high fps , still save amount of memory possible, or there approach better?
just clarify i'm not asking how render using vbo's
or how render in general, i'm asking best approach when want render same model multiple times.
test model
this image of test model.
edit
i'm using opengl version 4.2.0, , i'm using on windows desktop computer.
to minimize draw calls , uniforms transfer can use gldrawarrayinstanced().this way,you submit many instances of original object wish in single draw call!matrices each instance can pack ubo(uniform buffer object) , access in vertex shader per instance gl_instanceid
Comments
Post a Comment