Re: Dynamic Texture

New Message Reply Date view Thread view Subject view Author view

Don Burns (don_burns++at++peru.engr.sgi.com)
Mon, 11 Oct 1999 13:41:08 -0700 (PDT)


> How can I query the capability to use Framebuffer as a texture source ?

I am not aware of any way to query the capability. The following should work:

Given a texture, or frame buffer size s X t (in this case both must be powers
of two):

//
// Set up a NULL texture which will load from the frame buffer
//
    pfTexture *tex = new pfTexture;
    tex->setImage( NULL, 3, s, t, 0);
    tex->setLoadMode( PFTEX_LOAD_SOURCE, PFTEX_SOURCE_FRAMEBUFFER);
//
// 16 bit texture work faster here. Choose your favorite
// texture format
//
    //tex->setFormat( PFTEX_INTERNAL_FORMAT, PFTEX_RGB_5 );
    tex->setFormat( PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_8 );

    tex->setFormat( PFTEX_SUBLOAD_FORMAT, PF_ON);
    tex->setFilter( PFTEX_MINFILTER, PFTEX_BILINEAR);
    tex->setLoadOrigin( PFTEX_ORIGIN_SOURCE, 0, 0);
    tex->setLoadSize( s, t);

Call tex->load() in a predraw DRAW callback before any geosets using this
texture are drawn.

Hope this helps,

-don


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Oct 11 1999 - 13:41:11 PDT

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