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

kian

  • Newbie
  • *
  • Posts: 18
  • Location: Slovenia
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
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
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: 284
  • Location: Athens, Greece
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" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://edmullen.net/flash/clock8.swf</a>

harmalarm

  • Newbie
  • *
  • Posts: 3
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: 284
  • Location: Athens, Greece
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" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://edmullen.net/flash/clock8.swf</a>

submaniac93

  • Newbie
  • *
  • Posts: 7
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #66 on: June 16, 2020, 08:09:25 pm »
Hello everyone, I come with an updated GT2 car viewer thanks to Leo's source code, with his approval.
The edit was done mostly by pez2k, with a quick fix by TheAdmiester.

Here's the changelog:

v0.2.4a TheAdmiester's fix
Fix quad data left over when loading a smaller car than previous

v0.2.3a
* Fix UV map drawing breaking when a model uses a UV Y coordinate
  of 224.

v0.2.2a

* Port to a newer version of Delphi, to replace an unlicensed
  gzip component with the built-in gzip library. Rewrite use of
  gzip to use this library, which conveniently also fixes crashes
  when scrolling quickly through cars.

v0.2.1a

* Reorganise the UI to maximise the size of the render window.
* Store the last selected path, checkbox state, and render
  background colour in the config file.
* Resize the texture preview to the correct 256x224.
* Change the vertex colour to magenta rather than yellow, and
  shrink the size on the texture preview from 2x2 to 1x1 to trade
  visibility for accuracy.
* Remove the gradient and vignette from the render, as well as
  the FPS counter.

Here's the download to the archive. http://www.mediafire.com/file/hizjc1f27v79ah6/GT2CarViewerEdit_v024a.7z/file

The source code to it is available upon request.

Here's an image to show the changes (background color is changeable in the .ini)


Happy car viewing!
Love Love x 2 View List

Leo2236

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
  • Location: Athens, Greece
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #67 on: June 16, 2020, 10:05:30 pm »
Thanks a lot for the update! Have add download link the screenshot and all the rest to the first post :)
« Last Edit: June 16, 2020, 10:31:09 pm by Leo2236 »
<a href="http://edmullen.net/flash/clock8.swf" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://edmullen.net/flash/clock8.swf</a>

submaniac93

  • Newbie
  • *
  • Posts: 7
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #68 on: June 17, 2020, 12:17:10 am »
Awesome ^^

xXxKOKExXx

  • Newbie
  • *
  • Posts: 1
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #69 on: June 17, 2020, 10:51:18 am »
Hi Leo!

i wish you will be able to "read" the others tracks of GT series ( to can remake them to others games).

up today, this is your Trial Mountain mesh.

before




after ( and still to much to do)







yes, thats your cars ;) good for atrezzo

i hope you would give some love to GT Track tool and reach the vision ( for exporting) of the rest of the tracks. Assetto community will be grateful to you forever ;)
Like Like x 2 View List

Tosyk

  • Newbie
  • *
  • Posts: 3
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #70 on: June 17, 2020, 02:08:40 pm »
this is cool! thanks for update guys! love old game models
Like Like x 1 View List

kian

  • Newbie
  • *
  • Posts: 18
  • Location: Slovenia
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #71 on: July 12, 2020, 08:55:19 am »
Thank you Submaniac and Leo. I see some nice projects going on. Me very proudina :)

Leo2236

  • Administrator
  • Sr. Member
  • *****
  • Posts: 284
  • Location: Athens, Greece
Re: GT2 Car Viewer: A tool to view GT2 cars...
« Reply #72 on: February 22, 2022, 05:32:33 pm »
Have fixed the polygon ordering issue, which could cause some problems with displaying stickers correctly on the cars…

Here's an example render from 3dsmax, the left one is the model imported from GTCV v0.2b and the right one is imported from GTCV v0.2.1b...


Download:
https://www.mediafire.com/file/827zqsba8wor6u2/GT2_Car_Viewer_v0.2.1b.rar/file
<a href="http://edmullen.net/flash/clock8.swf" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://edmullen.net/flash/clock8.swf</a>