Author Topic: GT2 Car Viewer: A tool to view GT2 cars...  (Read 8173 times)

kian

  • Newbie
  • *
  • Posts: 16
  • Location: Slovenia
    • View Profile
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #60 on: March 02, 2019, 06:27:50 am »
Look Leonidas.. All the pieces of the puzzle are slowly falling together! :3



harmalarm

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #61 on: May 05, 2019, 01:47:00 pm »
Hi Leo2236,

I have a question about the texture format (cdp, cnp) and perhaps you can help me out. I am trying to make a GT2 I/O Maxscript set, just for practicing Maxscript. So far I have managed to get the actual models in-game with UV coordinates, but I am struggling with the textures. What I understand so far is that they are 256x224 textures, with a number of palettes for the color changes of the cars. I know the colors are indexed from the address of 17312 (43A0h), and I understand that the palette colors are basically 16x16 colors, all made up out of words (two bytes).

What I don't understand is that the color indexes all refer to 4bit values (0-15) while the texture uses 256 colors. Certain parts of the texture use a certain 16 color palette strip? I cannot find out how the game knows which part of the texture uses which palette. But perhaps I am totally wrong in this assumption?

Also, I am having trouble reading the word values to rgb colors in Maxscript. I suspect it is a 16bit color (rgb565) but when looking at your source files you do some bit shift and and operations that I don't really understand. Everything I can find on the internet is referring to different shift operations and I am quite confused now.

Would it be possible for you to give me a quick explanation of your procedure in simple terms? You have written your tool in Delphi, which I can follow for the most part, but I am stuck at the color values and palette indices at the moment.

cheers and thanks for your awesome tools which have inspired me much  :D,
Harmalarm

harmalarm

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #62 on: May 10, 2019, 11:44:17 am »
Well, at least I figured out I was wrong in one of my assumptions. The textures are using rgb555 instead of rbg565, so I got that part licked now. Only need to figure out how to determine which part of the texture is using which part of the 256 color palette.

Leo2236

  • Administrator
  • Sr. Member
  • *****
  • Posts: 270
  • Location: Athens, Greece
    • View Profile
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #63 on: May 25, 2019, 07:50:59 am »
sorry I didn't answered you earlier, about your last question as far I can remember the each polygon data have some value(bit shift) that tell which palette to use in which polygon, that's all I can remember...

Here's the source BTW:
https://drive.google.com/open?id=15MBQb1HELJCa4Zx7GsJDq3NF4y4wUZX0

@kian that looks nice!
« Last Edit: May 25, 2019, 08:03:15 am by Leo2236 »
<a href="http://edmullen.net/flash/clock8.swf" target="_blank" class="new_win" rel="nofollow">http://edmullen.net/flash/clock8.swf</a>

harmalarm

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #64 on: May 27, 2019, 03:28:46 pm »
Awesome Leo, thanks for the info. I took a quick dive in your files and found it in texture_maker.pas
for triangles:
PI := ((TR1[LOD, ii].UKN13 shr 6) *4) +(TR1[LOD, ii].UKN13 and $003F);
for quads:
PI := ((QU1[LOD, ii].UKN12 shr 6) *4) +(QU1[LOD, ii].UKN12 and $003F);

I have never seen a situation like this before, but then again this is an old game and they used old tricks to get things rendered :D

Thanks again for the sources. would it also be possible for you to send me the sources of your track tool, perhaps via PM?

Leo2236

  • Administrator
  • Sr. Member
  • *****
  • Posts: 270
  • Location: Athens, Greece
    • View Profile
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #65 on: May 28, 2019, 11:41:09 am »
...would it also be possible for you to send me the sources of your track tool, perhaps via PM?
sure thing, check your PM ;)
<a href="http://edmullen.net/flash/clock8.swf" target="_blank" class="new_win" rel="nofollow">http://edmullen.net/flash/clock8.swf</a>