Re: Infinite Reality, Colour matrix etc

New Message Reply Date view Thread view Subject view Author view

Graham Jones (graham.jones++at++sharp.co.uk)
Thu, 23 Jan 1997 14:23:37 +0000


OK, I'm still having no luck with my textures, maybe an explanation of
what I am trying to do would help!

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 );

All I get on screen is the geoset textured with the tex1 texture but in
full colour, not just the red component. The texture is a PFTEX_RGBA_8
internal format texture subloaded from the framebuffer.

For an extension to this little bit of graphics it is vital that I can
use the subloaded textures to give me the image in the second channel so
if there are any ideas about how to make this work I would love to hear
them.

I'm sorry to keep pushing this point but by myself I'm not getting
anywhere. The suggestions I have had so far have been interesting but
don't actually help me get the image I need on screen!

Graham.

-- 
Sharp Laboratories of Europe,         Phone: +44-(0)1865-747711
Oxford Science Park,                  Fax:   +44-(0)1865-714217
Oxford, OX4 4GA
England                               Graham.Jones++at++sharp.co.uk
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/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 2.0b2 on Mon Aug 10 1998 - 17:54:26 PDT

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