Re: Infinite Reality, Colour matrix etc
Ran Yakir (rany++at++rtset.co.il)
Thu, 23 Jan 1997 17:06:36 +0200
On Jan 23, 2:23pm, Graham Jones wrote:
> Subject: Re: Infinite Reality, Colour matrix etc
> I have one channel in which I render a scene, full colour/textured etc.
> It could be any model which can be loaded into Performer. The rendered
> image is subloaded into a pfTexture to be used later. I need to hang on
> to all the colour information.
>
> I have a second channel in which I render a simple set of tri-strips as
> a geoset. These tri-strips are textured with the subloaded texture. When
> I do this rendering I want to be able to render the R, G and B
> components of the texture separately (rendering the geoset 3 times) into
> the Red component of the second channel. I then need to be able to do
> the same thing but into the Green component, and then into the Blue
> component. I will arrange that all the data goes to the correct pixels
> to end up with the required image.
>
> I can't get to the individual colour components of the texture.
>
> I had hoped to use the colour matrix extension, except that it doesn't
> act when rendering a texture, only downloading. I had then hoped to use
> the GL_QUAD_TEXTURE_SELECT extension to select the individual components
> and use them as Intensity textures but that doesn't want to work either!
> (I can use the colour mask to restrict rendering to the R, G or B
> component of the channel). I don't need to process the intensities once
> thay have been transferred to the other colour components.
>
> Maybe a snippet of my, very simple, code would help. Can anybody give
> any suggestion why this doesn't select a single component of the
> texture?
>
> glDisable( GL_DEPTH_TEST );
> glDisable( GL_MULTISAMPLE_SGIS );
> pfDisable( PFEN_LIGHTING );
>
> pfEnable( PFEN_TEXTURE );
> glTexParameteri( GL_TEXTURE_2D,
> GL_QUAD_TEXTURE_SELECT_SGIS, 0 /* RED */);
> tex1->apply(); // tex1 is one of my subloaded pfTextures
> gSet[0][0]->draw();
>
> pfEnable( PFEN_LIGHTING );
> glEnable( GL_DEPTH_TEST );
> glEnable( GL_MULTISAMPLE_SGIS );
>
Graham,
You should do the following :
When you create the pfTexture that is being subtexloaded with the screen, you
should give it an internal format of GL_QUAD_LUMINANCE8_SGIS. I think that
Performer will eat this argument although it is a GL constant.
When you need to use the texture, bind it first (using apply()), and then call
glTexParameter with the selection.
Ran
--
__ | Ran Yakir
/_) _ __ \ / _ / o __ | RT-SET Ltd.
/ )_ (_(_) ) \/ (_(_/<_(_)( |
_/ |
-------------------------------------+--------------------------------
Phone : | E-mail : rany++at++rtset.co.il
Work : 972-9-9552236 | rany++at++netvision.net.il
Res. : 972-9-7489974 |
Fax : 972-9-9552239 |
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:54:27 PDT