[info-performer] pfTexture/pfTexEnv problem

Date view Thread view Subject view Author view

From: Volodymyr Kindratenko (kindr++at++ncsa.uiuc.edu)
Date: 10/23/2003 13:27:52


Hi:

I am developing a virtual mirror (scene rendered in a separate channel and
then uploaded as a texture to a polygon in the channel's draw callback). It
seems to be working, but...

When I look at the resulting mirror from a short distance, it looks OK:

http://moneypenny.ncsa.uiuc.edu/temp/mirror/1.jpg

When I start moving away from the mirror, the texture is combined with the
color of the base texture set by

texture->setImage((uint*)pfMalloc(comp*ns*nt*nr), comp, ns, nt, nr);

http://moneypenny.ncsa.uiuc.edu/temp/mirror/2.jpg

Eventually, only the base texture color remains as I move far away:

http://moneypenny.ncsa.uiuc.edu/temp/mirror/3.jpg

pfTexEnv mode is set to PFTE_REPLACE

What am I doing wrong? Which flags need to be set on pfTexEnv? Please
help! Here is the code that creates the texture:

  // texture
  int comp=4, ns=128, nt=128, nr=1;
  pfTexture *texture = new pfTexture;
  texture->setFormat(PFTEX_IMAGE_FORMAT, PFTEX_RGBA); // standard format
  texture->setFormat(PFTEX_SUBLOAD_FORMAT, PF_ON);
  texture->setImage((uint*)pfMalloc(comp*ns*nt*nr), comp, ns, nt, nr);

  // texture environment
  pfTexEnv *texenv = new pfTexEnv;
  texenv->setMode(PFTE_REPLACE);

  // geostate
  pfGeoState *geostate = new pfGeoState;
  geostate->setMode(PFSTATE_CULLFACE, PFCF_OFF);
  geostate->setMode(PFSTATE_TRANSPARENCY, PFTR_OFF);
  geostate->setMode(PFSTATE_ENTEXTURE, PF_ON);
  geostate->setAttr(PFSTATE_TEXTURE, texture);
  geostate->setAttr(PFSTATE_TEXENV, texenv);

  geoset->setGState(geostate);

Volodymyr

*
___________________________________________________________
Dr. Volodymyr Kindratenko ............. kindr++at++ncsa.uiuc.edu

  National Center for Supercomputing Applications (NCSA)
  University of Illinois, Urbana tel: 217-265-0209
  M/C 476 - 152 CAB lab: 217-244-4913
  605 East Springfield Avenue fax: 217-244-2909
  Champaign, IL 61820
                            http://www.ncsa.uiuc.edu/~kindr
                          http://intellibadge.ncsa.uiuc.edu
___________________________________________________________
*
 


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Oct 23 2003 - 13:43:46 PDT