Author Topic: Zangan bug... (EDIT: Now has Exporter Discussion)  (Read 5817 times)

Contra

  • *
  • Posts: 278
    • View Profile
    • http://contraspontanus.deviantart.com
It seems.. on a lot of 2D backgrounds and objects in the battle fields, only the bottom half is shown. Examples: 'Holy' in the bizzaro sephiroth field; the background images of the pilliars in the stairs going up the pilliar. And a lot more of the same kind of thing. Is this a known bug, or a glitch on my part? Any known fix?

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #1 on: 2003-03-23 18:15:43 »
Well, it wasn't a known bug, but I guess it is now.

Not sure what could be causing it, Zangan uses a fairly (now) reliable P reader based on every bit of information we know about the file format. It's possible that we *don't* know everything about the file format, of course, although I thought we were fairly close. I'll look into it at any rate.

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #2 on: 2003-03-23 18:55:03 »
Well, turned out to be a silly mistake in the code scanning the LGP for files related to each location. Now fixed; v1.13 is up on my web page.

Contra

  • *
  • Posts: 278
    • View Profile
    • http://contraspontanus.deviantart.com
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #3 on: 2003-03-23 20:45:17 »
LOL! It's funny because, due to that bug, I have just installed drivers, nearly crashed my system, rolledback drivers, and am now having problems with FF7. I wanted to see if it was a driver issue, and I found new drivers for my (Dun dun DUN!!!) Nvidia GeForce 2, after I installed them, I lost 8-bit palletized texture support, and the Nvidia patch didn't help (I got a bunch of blue and white lines. =/) So I had to roll back. ^_^;; I liked some of those new Nview features, too... and OpenGL 4 would be nice.... Anyways... On an unrelated note, the 'Windowed' Cetra patch ONLY works with 1.02, if you didn't know that, and it MIGHT have something to do with the big black line I have running through my FMVs. I'll have to use my fullscreen executable and find a working FMV player in the Debug Room.

Aaron

  • *
  • Posts: 2818
    • View Profile
    • http://aaron-kelley.net/
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #4 on: 2003-03-23 20:48:33 »
Using high-end GeForce cards with FF7:

Locate a copy of RivaTuner.
Open it up.
Driver Settings -> Customize -> DirectDraw and Direct3D settings -> Textures -> UNCHECK "Enable 8-bit Paletized Textures"

Make sure FSAA and AF are off, and run FF7 with the 1.02 TNT patch enabled.  FF7 should look ok now with newer drivers?

...well, it worked for me.

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #5 on: 2003-03-23 21:03:38 »
OpenGL 4? I think the OpenGL team would like to know if you could get support for that, GL2 hasn't even been finalised yet :P

I guess you mean v1.4 ;)

As for Cetra; yeah, pretty much *all* Cetra patches work with v1.02 only. Simply because *I* run v1.02, so that's what I work with. Plus, of course, anyone who doesn't need the 1.02 features can still use it fine, so it's the best version to program for.

Contra

  • *
  • Posts: 278
    • View Profile
    • http://contraspontanus.deviantart.com
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #6 on: 2003-03-23 21:16:33 »
Ehe... Yeah.. typo on my part, but I'm not gonna fix it; it's already been spoken of.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #7 on: 2003-03-24 14:15:18 »
Fice speaking of which I have my 'dll' programed for a plugin to export data from Zangan.  I however have no data files to test it on? Is it possible you could temporarily put up a sampling of things you would like to see exported into other formats (3d of course) and then perhaps an image of what it should look like ;)  Finding FF7 seems to be kind of hard these days :)

Cyb

Contra

  • *
  • Posts: 278
    • View Profile
    • http://contraspontanus.deviantart.com
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #8 on: 2003-03-24 19:51:40 »
You could always let someone else try the DLL, Cyberman. I'd be happy to. :D Of course, You'd have to ask Fice, but I think you have to have the full battle.lgp to run Zangan...And Qhimm doesn't like us doing that kinda stuff... =/

Cyberman

  • *
  • Posts: 1572
    • View Profile
Seeing Red?
« Reply #9 on: 2003-03-24 21:33:10 »
Fice:
I've got it exporting the textures into BMP files, kind of boggling as they are heavy RED. The format you are using is RGBA8 right? or do I need to do some more inspection of the textures to find out what there format is. The results kind of look right except as I said heavy in red.

My Conversion routine for the textures is this:
Code: [Select]

//---------------------------------------------------------------------------
void TConvert::LoadTex(int Tex)
{
   int   Width, Height;
   int   X, Y;
   UINT32  *Data, *Index;
   Graphics::TBitmap *BM;
   AnsiString  Txt;

   BM = TexImage->Picture->Bitmap;
   // get the texture
   glBindTexture(GL_TEXTURE_2D, Tex);
   glGetTexLevelParameteriv(
      GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &Width);
   glGetTexLevelParameteriv(
      GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &Height);
   Data = new UINT32[Width * Height];
   glGetTexImage(
      GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, (void *)Data);
   Index = Data;
   BM->Width = Width;
   BM->Height = Height;
   for (Y = 0; Y < Height; Y++)
   {  for(X = 0; X < Width; X++)
      {  BM->Canvas->Pixels[X][Y] = RGBA2TColor( *Index++);
      }
   }
   delete Data;
}
//---------------------------------------------------------------------------
TColor TConvert::RGBA2TColor(UINT32 Color)
{  // we must now convert RGBA to BGR
   int   R, G, B, Temp;

   R = (Color & 0xFF000000) >> 24;  // Red
   G = (Color & 0xFF0000)>>16;       // Green
   B = (Color & 0xFF00) >> 8;       // Blue
   Temp = R | ( G << 8) | (B << 16);
   // Alpha is ignored
   return (TColor) Temp;
}
//---------------------------------------------------------------------------

On Scene
Texture1Texture2
Texture3Texture4
Texture5Texture6

Os Scene
Texture1Texture2
Texture3Texture4
Texture5
My 'decoding' function is very simple to convert from what the texture format is to a TColor type.  I am wondering if I should not try to get more information on the texture and using a smarter decoding method.  I wonder if this is RGBA4 format internally or something (hmmms).  

The only thing I can find is it does say you are using RGBA format.. but not what specifically it is. Sigh.

Cyb

Cyberman

  • *
  • Posts: 1572
    • View Profile
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #10 on: 2003-03-24 21:40:19 »
Argh never mind Dang it.. it's in ABGR format!

Spent on hour looking at this stuff (smirk).

This works though:
Code: [Select]
        Temp = Color & 0xFFFFFF;

Go figure.. Ahh well I noticed the values in floating point are rather high.  The stupid question is.. what is the scale of the backgrounds? millimeters?

Cyb

Mofokubik

  • *
  • Posts: 453
    • View Profile
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #11 on: 2003-03-24 21:49:30 »
you lost me...

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
Zangan bug... (EDIT: Now has Exporter Discussion)
« Reply #12 on: 2003-03-24 22:19:55 »
Cyberman: Yeah, traditionally in OGL you list the least significant data first, so RGBA means R is in the low byte (Value & 0xff), G next up ... and A in the top byte (Value & 0xff000000). I suppose you could call that ABGR if you were to list the formats the other way around ... I didn't consider that; I'm just used to working in OpenGL ;)

Looks like your libraries (C++ Builder are they?) use the same arrangement as OpenGL, so masking off the alpha seems fine, yeah.

I've no idea at all what the scale is, although I suppose you could work out a rough guide. I seriously doubt it's millimeters; cm seems more likely, although I've not really looked at it.

Cyberman

  • *
  • Posts: 1572
    • View Profile
TADA!
« Reply #13 on: 2003-03-24 22:32:23 »
The sweet smell of success!

Here are 2 POV rendered images from the plugin.
First battle scene info Fice gave me.

Second battle scene info Fice gave me.


It would look better if I used Smoothed Triangles but this requires the calculation of the normals at each triangle vertice and that is subjective unfortunately.

Cyb