If you do not store your vertex attributes in a VBO, the whole data will be moved from the system to the graphics card on every glDraw* call. After everything ordered in the glDraw* call has been rendered, the memory containing the data is immediately freed. The concept of 'frame' does not play into it and it's not really something that makes much sense in the context of modern OpenGL.there is also subquestion of deleting the geometry data
- if i upload a large vertex geometry in the frame and it resides in vram then it seem that before sendoing it next frame some api call deletes the prevoius in the vram.. is this true? what api call this is?
As said repeatedly, static data which is rendered repeated is usually placed in a VBO. Using glRotatef, glTranslatef is no longer used in modern programs. That whole part of the API has been deprecated for good reasons. And while it's unlikely that your programs will stop working (at least on AMD or NVIDIA card) for the foreseeable future, you are artificially locking yourself out of new features, might end up on code paths that are less optimal than using the modern API and you are causing yourself more pain and inconvenience in the future (because the modern API has a bit more initial boilerplate code you need but is far simpler once that initial investment is done).as to moving the vertices i do not want to move the vertices by updating the vertex array but just use glRotate glTranslate but then it is again whole vertex array sending (uploading)... is this correct way of writing programs or this is bad way at all?
What you want is to do is use Vertex buffer objects (VBO) They store all your mesh data on the GPU until you explicitly destroy them and then do skeletal animation using the vertex shaders(GPU skinning) that way you only have to send transformation matrices for the bones each frame in order to animate the mesh.
allright this is usefull - i understand that there are two modes one does vram geometry clearing other preserves it
- though as to clearing i do not understand when it clears is it immediate, when some source triangle is just sent thru rendering its source data is freed immediate or this is on some frame basis? (i understand you sy this is more immediate but i do not see it clearly, previously i suspected it was more like glFlush end of the frame)
- also i do not know how to sent the parameters to the whole big set of geometry data residing in vram - say it is by shaders, istn it very unhandy ? if you have scene that
contains a thousand of meshes need a thousand of parameters (position etc).. so
there is a thousand case switch in the shader which is reaching thousand times
to cpu RAM memory to fetch this coordinates?
These days everything is done by shaders, even if you use the fixed function pipeline, The driver provides basic shaders that mimic the way the old fixed functions worked), glTranslate, glRotate etc modify a matrix on the CPU and the driver will pass it to its stock shaders if you issue a draw call without using your own shaders.
This is worth reading: http://classes.soe.ucsc.edu/cmps162/Spring12/s12/labnotes/shaders.html