Re: [info-performer] pfTexture/pfTexEnv problem

Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 10/23/2003 14:20:21


Hi Volodymyr,

Looks like only the highest resolution mip level of your
texture contains valid data.

Try explicitely setting a minfilter which does not use
mipmap levels by adding the line:

texture->setFormat(PFTEX_MINFILTER, PFTEX_BILINEAR);

Hope this helps.
Regards,
Paolo

Volodymyr Kindratenko wrote:

>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
>___________________________________________________________
>*
>
>
>
>-----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-----------------------------------------------------------------------
>
>
>
>

-- 
Paolo Farinelli                                           paolo++at++sgi.com
Member of Technical Staff, OpenGL Performer              1-650-933-1808
Silicon Graphics        1600 Amphitheatre Pkwy, Mountain View, CA 94043


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Oct 23 2003 - 14:20:34 PDT