yuri++at++casa-de.es
Fri, 3 Nov 95 16:47:13 -0800
Unfortunately, their answers were not enough. Here is my problem again: I have
one 4 component texture format that I would like to map to my models. The
function that reads the texture provides a pointer that works OK with IrisGL
but crashes with Performer (1.2) giving strange results. Loading a RGB texture
gives no problem. This is a somehow resumed version of my code:
textures[ActTex] = pfNewTex(arena);
sprintf(ext, "%s", &TEXname[strlen(TEXname)-3]);
if(strcmp(ext, "rgb")==0)
{ if(pfLoadTexFile(textures[ActTex], TEXname)==0) ErrorObj(); }
else if (strcmp(ext, "vst")==0) {
char FullTEXname[256];
ulong *image;
long ns, nt, comp;
size_t tot;
if (!pfFindFile(TEXname, FullTEXname, R_OK)) ErrorObj();
VSTtemp = Load_imageVST(FullTEXname);
comp = (long) VSTtemp->ncom;
ns = (long) VSTtemp->xlon;
nt = (long) VSTtemp->ylon;
image = VSTtemp->image;
pfTexImage(textures[ActTex], image, comp, ns, nt, 0L);
pfTexFormat(textures[ActTex], PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_8);
pfTexName(textures[ActTex], TEXname);
}
else ErrorObj("extension de textura no valida");
pfTexRepeat(textures[ActTex], PFTEX_WRAP, (wrap)? PFTEX_REPEAT:PFTEX_CLAMP);
pfTexFilter(textures[ActTex], PFTEX_MINFILTER, PFTEX_BILINEAR);
pfTexFilter(textures[ActTex], PFTEX_MAGFILTER, PFTEX_BILINEAR);
pfGStateAttr(gstate, PFSTATE_TEXTURE, textures[ActTex]);
Load_imageVST reads in a texture file and gives a pointer to the structure you
can guess. I also tried to copy the actual image to another location before
serving it to pfTexImage, just in case it gets erased. Any ideas?
One other issue I would like to ask those of you who are still reading is:
have you ever tried to load a .ptu file? I have, and the Programming Guide
(1.2) is wrong enough to make you waste some precious time until you check
the actual code. Once I did this and got my terrain working, somehow it
disabled antialiasing and the lightpoints on my vehicles appeared as big
boxes instead of small dots as before. LOD switching and all that stuff seem
to work but I notice no improvement over my former all-in-one-geode terrain.
I guess this is just something somewhere spoiling it all -- I would like to
know this before I attempt to do the work myself, as the application I am
currently working on would do with a ptu.
Thank you.
_________________________________________________________________________________
_/_/_/_/ _/ _/_/_/_/ _/ Juan R. "Yuri" Saenz-Diez
_/ _/_/ _/ _/_/
_/ _/ _/ _/_/_/_/ _/ _/ C.A.S.A - E S P A C I O -
_/ _/_/_/_/ _/ _/_/_/_/ Av. de Aragon, 404
_/_/_/_/ _/ _/ _/_/_/_/ _/ _/ 28022 Madrid - Spain
_/_/
_/_/ _/_/ Tel: (34 1) 585 78 17
_/_/ --o-- _/_/ Fax: (34 1) 747 47 99
_/_/ _/_/ Tlx: 48540 CASA-E
_/_/
E-mail yuri++at++inf.casa-de.es
_________________________________________________________________________________
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:01 PDT