Texture paging in iR with pf and ogl

New Message Reply Date view Thread view Subject view Author view

Javier Castellar (javier++at++sixty.asd.sgi.com)
Wed, 19 Jun 1996 15:37:37 -0700


Hi,

        Following please find how to page textures in iR using performer.

Performer initialization for texture paging :
---------------------------------------------

    share->tex = pfNewTex ( arena );

        /* PFTEX_SOURCE_IMAGE = source is in main memory */
        /* PFTEX_SOURCE_FRAMEBUFFER = source is the framebuffer */
        /* PFTEX_SOURCE_VIDEO = source is Sirius live video */
    pfTexLoadMode ( share->tex, PFTEX_LOAD_SOURCE, PFTEX_SOURCE_IMAGE);

        /* you should match the internal format with the external format */
        /* you could use GL_RGB10_EXT but since you need a fast paging *
        /* I recomend PFTEX_RGB_5 (five bits per component) */
    pfTexFormat ( share->tex, PFTEX_INTERNAL_FORMAT , PFTEX_RGB5 );
    pfTexFormat ( share->tex, PFTEX_SUBLOAD_FORMAT , PF_ON);
    pfTexFilter ( share->tex, PFTEX_MINFILTER , PFTEX_BILINEAR );
    pfTexFilter ( share->tex, PFTEX_MAGFILTER , PFTEX_BILINEAR );

            /* Texture size warnning: padding to powers of two */
    pfTexImage (share->tex , NULL, 3, textureSizeS, textureSizeT, 1);

Performer/OpenGL initialization draw callback (at initialization on FIRST
frame)
--------------------------------------------------------------------------------
[ You should make in on the Pre draw callback with other initializations ]

    if( share->first )
    {
        /* texture initialization (just in case) */
        /* this is the place in which the texture definition is being MADE */
        pfApplyTex(dist->tex);
    }

Performer/OpenGL POST draw callback (real time ... )
----------------------------------------------------
[It is in the POST draw callback in order to perform parallel paging while
the Raster Manager 6 is busy]

        pfSubloadTex( share->tex, PFTEX_IMAGE, (uint *) image
                    , 0, 0, 0, 0
                    , textureSizeS, textureSizeT);

If you change the image pointer per frame: you have a movie.

As far as I know the performer API works nicely (pfTexture::subload,
pfTexture::subloadLevel). pfSubloadTex is using internally glBindTextureEXT and
glTexSubImage2DEXT, glCopyTexSubImage2DEXT ... etc.

You have to convert the images to 5551 format (the main memory format) to match
the internal format and then save a lot of paging bandwidth. It is very easy.

Remember: all powers of two !!!!!!!!! My advice is to work in fields (60hz) of
512x256. Use izoom to perform the scan down. If they work in frames (30hz) I
may suggest 512x512. If they need more, you can use a 1kx1k texture and then
Subtexload only the video image. For subtexload in pieces you need to follow
paddings of 8 pixels in S and T.

Regards.

-Javier

-- 
*************************************************************************
* Javier Castellar Arribas     * Email:              javier++at++asd.sgi.com *                 
*                              * Vmail:            		 3-1589 *            
* Member of Technical Staff    * Phone: (415)-933-1589 | 933-2108 (lab) *
* Applied Engineering 	       * Fax:                    (415)-964-8671 *     
* Advanced Systems Division    * MailStop:                       8L-800 *
************************************************************************* 
* Silicon Graphics Inc.                                                 *
* 2011 N. Shoreline Boulevard,                                          *                        
* Mountain View, California 94043-1386, USA                             *
*************************************************************************
"Violence is the last refuge of the incompetent"
						Hari Seldon

======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:02 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.