Foros - Stratos

Programadores => Programación gráfica => Mensaje iniciado por: Emotion en 07 de Octubre de 2002, 06:35:22 PM

Título: KTX_buffer_region
Publicado por: Emotion en 07 de Octubre de 2002, 06:35:22 PM
                                he estado mirando la documentacion en el registro de OpenGL pero no termino de entender la manera de utilizar la extension. alguien la ha probado y sabe para que puede ser util?                                
Título: KTX_buffer_region
Publicado por: DraKKaR en 07 de Octubre de 2002, 11:14:11 PM
                                Hola Emotion, yo vi hace un tiempo unos screenshots de una demo ke la usaba (la demo hecha en delphi nunca me funciono). La demo mostraba como mezclar bien imagen prerenderizada con render en tiempo real 3d. La demo mostraba 3 columnas en un escenario prerenderizado con 3 esferas ke se movian por la pantalla. Gracias a esta extension daba la sensación de ke las esferas 3d kedaban ocultadas por detras de algunas las clumnas prerenderizadas, aunke toda la imagen del fondo fuese una unica imagen. La utilidad? para hacer un ResidentEvil (yo prefiero llamarlos un Alone in the Dark ;P) perfecta.                                
Título: KTX_buffer_region
Publicado por: DraKKaR en 07 de Octubre de 2002, 11:23:25 PM
                                weno he encontrado la demo..  y sigue sin irme... aun cuando el autor de la demo dice ke en su TNT2 le rula perfectamente.
Lo ke la demo permite (no lo he comentado antes) para especificar la profundidad en el depth buffer de cada pixel de la imagen prerenderizada, es cargar una especie de depth-map en tonalidades de gris, donde el negro es el valor mas alejadop y el blanco el mas cercano. De esta forma puedes decirle al peth buffer ke ocultara a ke.
Aki te pasteo el txt ke viene con la demo (esta en inglispikinglis ;P):

 bufferregion.zip
********************

This demo illustrates the use of the WGL_ARB_buffer_region
extension. This extension allows you to save an area of the
framebuffer to an offscreen buffer that resides in video RAM. By
using buffer regions, you can solve the age-old performance
problems associated with glReadPixels() and glDrawPixels().

This demo performs a little trick that is typically very slow when
you have to do it in system RAM: it composites real-time rendered
3D objects onto a prerendered static background. To this effect,
both color and depth information for the background are needed. I
used Bryce to create the background - it has a "distance render"
mode that outputs the depth information.

When you start this demo, it will load the color and depth images
and save them to a buffer region. Then it will render a few moving
spheres onto the prerendered background. You will notice that the
spheres are correctly occluded by the objects in the background.
The demo performs extremely well, even on my TNT2. The overhead of
drawing the background image seems to be almost negligable. If
you've cursed glDrawPixels() many times before because of its
horrible performance, then buffer regions will be a godsend.

This technique is very useful, for example, in adventure games à
la Grim Fandango. You can put as much detail into backgrounds as
you want, without performance penalty, and at the same time still
enjoy the benefits of 3D animated characters (i.e. less labour-
intensive to create). The most important thing to keep in mind is
that you should render your background and your 3D objects with
the same coordinate system and with the same camera settings. I
didn't pay much attention to this for the purposes of this demo,
but for any non-trivial project this is of crucial importance.

 Tom Nuydens (delphi3d@gamedeveloper.org)


Postearia tb las imagenes de la demo pero creo ke no se peude.

Espero ke te sirva de algo ;P                                
Título: KTX_buffer_region
Publicado por: Emotion en 08 de Octubre de 2002, 10:41:14 AM
                                si, ahora ya veo como puedo usar esa extension... el ejemplo, si es de tom nuydens, lo encontraste en la pagina de Delphi3D.net, no?

gracias y un saludo :)