Re: texturing a texture

New Message Reply Date view Thread view Subject view Author view

From: Marcin Romaszewicz (marcin++at++asmodean.engr.sgi.com)
Date: 03/14/2000 10:56:25


What you have to do in performer right now is to draw the object multiple
times, once for each texture, and combine the results in the framebuffer.
You will need to do this in the draw callback, where you can make OpenGL
calls. The procedure looks something like this:

pfPushState();
pfDrawBin(n); //draw the objects in bin n with their default textures

glEnable(GL_BLEND);
glBlendMode(GL_ONE, GL_ONE); //add the results

//apply the second texture
texture2->apply();

//make sure performer does not use default texture. The last one applied
//will be the active one.
pfOverride(PFSTATE_TEXTURE, PF_ON);

pfDrawBin(n); //draw the objects in bin n again with the second texture

pfPopState();
glDisable(GL_BLEND);

to put objects into bin, take a look at pfGeoSet::setDrawBin

-- Marcin

On Tue, 14 Mar 2000, ken sartor wrote:

>
> Hi -
>
> Is there an example(s) that demonstrates how to use
> Performer and/or OpenGL to applying a texture to another
> texture?
>
> TIA.
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> 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 2b29 : Tue Mar 14 2000 - 10:56:30 PST

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