Final Fantasy Hacktics

Modding => PSX FFT Hacking => Topic started by: andredoubleu on December 08, 2013, 02:41:44 am

Title: Orbonne Monastery Texture Sheet in Color
Post by: andredoubleu on December 08, 2013, 02:41:44 am
Hi!  I'm programming Orbonne Monastery from scratch for a computer graphics class.  I just finished my model, but the texture sheet that I have is in grayscale (I obtained the texture sheet from Ganesha).  Does anyone have a color version you can send me real fast?

I found some colored texture sheets for Orbonne Monastery in Tethical, but the colors are all kind of off and I'm not quite sure why.    I also tried getting the texture sheets from map2gl, but after attempting to run map2gl on 6 different computers and several operating systems and it not working, I abandoned those attempts.

I would like to understand the process for getting the colored textures myself, but right now I'm more concerned with just getting my hands on a copy so I can turn my assignment in!
Title: Re: Orbonne Monastery Texture Sheet in Color
Post by: lirmont on December 08, 2013, 04:14:12 am
The simple answer is to use the appropriate blend file Tethical's original github repository provides. That's the mesh plus a material that references the image. If you want to just use the model on its own, you'll need to replace the reference to the image file within Blender (a 3d modeling program). Then, you'll need to export the result back to whatever format your project needs (which Blender likely has an exporter for already).

Other than that, you have a misconception about how the textures work. That grayscale image is the texture. Like practically every other image in the game, it's a paletted image (re: it has indexed colors). The stuff you described as "all kinds of off" is the grayscale image put next to itself in all of the different palettes in one image. For computer graphics, this is the easiest way to realize the end result in a 3d modeling program. I don't know how the actual game does it, but map2gl realizes it like that, then rewrites the UV coordinates to point only to the appropriately realized section.

That said, you do need to use map2gl to appropriately pull out both the mesh and the realized texture if you want it to show up in color in an external program.

Here are threads where other people tried to get map2gl working: http://ffhacktics.com/smf/index.php?topic=10013 (http://ffhacktics.com/smf/index.php?topic=10013) and http://ffhacktics.com/smf/index.php?topic=8283 (http://ffhacktics.com/smf/index.php?topic=8283).

Good luck.
Title: Re: Orbonne Monastery Texture Sheet in Color
Post by: andredoubleu on December 09, 2013, 12:42:52 am
lirmont, thank you soo much for answering all of my questions.  I looked again at the mega image and just combined the pieces I wanted so that I wouldn't have to rewrite any of my code.  It was kind of a hack, but I just needed to turn my assignment in.

But actually, I didn't use map2gl to pull the mesh and the realized texture; because this is an introductory graphics course, we were required to draw all of our polygons and map all of our textures by hand, and not import any other objects into the scene.  It was a pain in the rear, and took a few days, but I finally got it.

As far as using map2gl, I read the posts that you linked to, but I still can't get it to work.  I tried on a Windows 7 32-bit machine, and I keep getting the error:

NameError: global name 'create_textures_seprate' is not defined

I then tried on Ubuntu Precise.  I was able to run the program and get it to display the scene, but it won't respond to any keyboard inputs, and in the File menu, there's no option to export anything.
Title: Re: Orbonne Monastery Texture Sheet in Color
Post by: lirmont on December 09, 2013, 02:29:17 am
Okay, well, you hit a bug in the software. Gomtuu (the guy who wrote it) apparently did the work to carry on with individual textures, but he didn't link up the features he wrote to do that correctly in the code. It's probably because it's very unlikely to ever get called. Anyway, I've fixed it to call his code correctly, but you'll have to re-download the pack again: [535]map2gl+export-full.zip (http://www.darkabstraction.com/showOff/ffhackticks/%5B535%5Dmap2gl17%2Bexport-full.zip). However, you won't be able to export it (because that code I wrote to export the map and texture assumes you're using the single combined texture). If you run the updated version, I'd be interested to see the output around this place:

Debugging the GLError
(http://darkabstraction.com/showOff/ffhackticks/glerror-in-map2gl.png)

Your GLError won't say that. That's an error I forced in the OpenGL graphics context to show what it might look like on your end. I'm interested in what it says, and maybe, having that text, I'll be able to adjust the code so it doesn't fail on you; it's just the success of a single graphics call that the program makes the determination off of.

Specifically, that line is:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB5_A1, ix, iy, 0, GL_RGBA, GL_UNSIGNED_BYTE, imagestr)

If I had to guess, I'd guess your card/drivers don't support GL_RGB5_A1 (which is arguably a pretty specific graphics storage mode and probably unnecessary; re: 5 bits Red, 5 bits Green, 5 bits Blue, 1 bit Alpha).

If it complains about that in the GLError, you might download a program that lets you view what your video card's OpenGL implementation actually contains (like GLView (http://www.realtech-vr.com/glview/); would be in the "Pixel Formats" location of the program).
Title: Re: Orbonne Monastery Texture Sheet in Color
Post by: andredoubleu on December 10, 2013, 02:10:23 am
I'll definitely get to this in a few days.  It's finals week..!