Re: Problems with transparency and textures

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++bitch.reading.sgi.com)
Wed, 22 May 1996 19:47:24 +0100


On May 22, 12:12pm, Richard M. Owens wrote:
> Subject: Problems with transparency and textures
> I'm new to Performer and I'm having some problems. I've looked at the
archives
> and all the source code that comes with Performer (2.0), but I can't seem to
> find my problem.
>
> First, transparency -- I'm developing a C++ application, and I'm just trying
to
> get one polygon to have an alpha value of about 0.2. I'm using the "Builder"
> functionality to create the geometry (one rectangle). I specify the alpha
> component of the "color" field of the primitive, and call
> pfdBldrStateMode(PFSTATE_TRANSPARENCY, PFTR_ON). I've also tried an alternate
> method of:
> 1. enabling lighting with pfdBldrStateMode(PFSTATE_ENLIGHTING, PF_ON)
> 2. adding a material with the following properties:
> material->setColorMode(PFMTL_FRONT, PFMTL_CMODE_COLOR);
> material->setAlpha(0.2f);
> This didn't work, either. After calling pfdBuild(), I am adding this node to
my
> scene object (scene->addChild(transparentPolygon)).

Is this an IrisGL compile right?
If it is then your geometry geoset colour attribute bindings are turning off
your lighting. Try transparency information in your colour attributes for your
vertices.

>
> The second problem, texturing. I made my own pfdLoadFile_xxx based on one of
> the provided ones, and added texture coords to it (and setting buffer->tbind
=
> PFGS_PER_VERTEX). A debugging session showed valid values being set for S and
> T. Then I tried to enable texturing with:
> pfTexture *tex = new pfTexture;
>
> tex->setFilter(PFTEX_MINFILTER, PFTEX_BILINEAR);
> if (tex->loadFile(textureName))
> {
> gstate->setAttr(PFSTATE_TEXTURE, tex);
> gstate->setMode(PFSTATE_ENTEXTURE, PF_ON);
> gstate->setAttr(PFSTATE_TEXENV, new pfTexEnv);
> }
> Again, no dice. The scene is appropriately slower (Indigo Elan), but my
surface
> is not textured. (It is a bit darker, however).

Slower and darker is a good sign :), it suggests your texture coordinates are
not being bound or are somehow bogus.
What texture coordinates are you using?
What texture image do you load?
Is the image loading correctly?
Have you previously display listed your geoset?

>
> I am able to supply more source code if necessary. Any help would be GREATLY
> appreciated.
>
> Richard
>
> --
> O o~ o_O/ Richard Owens
> /|-o _______|_______ \ PSI/NRL Code 7183
> / \ | | |\ Richard.Owens++at++nrlssc.navy.mil
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Richard M. Owens

-- 
Angus Dorbie,
The Reality Centre,
Silicon Graphics Ltd, UK
dorbie++at++reading.sgi.com
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer.html
            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:52:55 PDT

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