Vice City - Darker DFF exports from ZMod2?

GTA San Andreas and GTA Vice City discussion.

Moderator: Oleg

Carlos85G
Posts: 5
Joined: Wed Mar 22, 2023 7:20 am

Vice City - Darker DFF exports from ZMod2?

Post by Carlos85G »

Hello, everybody.

I've been having an issue for some time: I started my models in Zmod1, then imported the Z3D files into ZMod2 and continue my work there; however, It has come to my attention that Zmod2 DFF exports seem to be darker than their Zmod1 counterparts. Has somebody experienced this and could you give me some advice about it, please?

In the attached photo, the back bumber on the car on the left (exported with Zmod 2.2.6) is noticeably darker than the one on the car on the right (exported with Zmod 1.05B).
Attachments
darker BTTF2 - compressed.png
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Vice City - Darker DFF exports from ZMod2?

Post by Oleg »

This was ages ago, so I can't remember all the details, but ZModeler1 probably does not support per-vertex color. May be the model exported from ZModeler2 has per-vertex color (that is not white) and this makes model darker?

as a quick test, you can import into ZModeler2 the DFF model from zmodeler1 and export it to see whether just "import/export" makes these changes. Does something change in game after import/exporting?
Carlos85G
Posts: 5
Joined: Wed Mar 22, 2023 7:20 am

Re: Vice City - Darker DFF exports from ZMod2?

Post by Carlos85G »

Thank you for the response, Oleg.

Neither model has any vertex coloring but, to discard any model issues, I did the same test with the original Deluxo:

In the attached pic: on the right is the original Deluxo mesh that came bundled with GTA:VC; on the left, it's the same mesh but imported to Zmod2 and then exported (I checked "Autodetect lights" and "Respect Root Node Position" when exporting). Both car slots use the same texture file (duplicated) and have the same CarCol data, but the one on the left is still noticeably darker.
Attachments
darker Zmod2 - compressed.png
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Vice City - Darker DFF exports from ZMod2?

Post by Oleg »

looks like this has something to do with materials setup. Just as a quick test, import dark model into ZModeler and export it again - does it become even more darker in game?
Carlos85G
Posts: 5
Joined: Wed Mar 22, 2023 7:20 am

Re: Vice City - Darker DFF exports from ZMod2?

Post by Carlos85G »

I did the experiment and it seems it doesn't get darker after a second export.

First attached image:

- Background right: original Deluxo.
- Middle right: Zmod2 export (original imported into Zmod2 and then exported).
- Middle left: Zmod2 import export (Zmod2 export is re-imported into Zmod2 and then exported).
- Foreground left: Original imported and re-exported x20 (Original imported into Zmod2, then exported, then Zmod2 is closed and re-opened, then the export is re-imported and exported. Process is repeated 20 times).

All imports have option "Autodetect lights" unchecked.

All exports have have options "Autodetect lights", "Respect root node position" and "Save thumbnail" checked.

Given that all three exports look just as dark, maybe the problem is with the import of the original model and how ZMod2 sets materials up, instead.

Second attached image: Console output after importing the original Deluxo (the warnings and errors do not happen when importing a Zmod2 export).
Attachments
export_experiments.png
import_console.png
import_console.png (5.4 KiB) Viewed 2708 times
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Vice City - Darker DFF exports from ZMod2?

Post by Oleg »

Looks like ZModeler treats materials setup in a slightly different way. I advise to mess a little with materials setup - diffuse color, specular color, may be even emissive color.. also, some settings on reflection texture might be affecting the export too.

Also it is quite possible ZModeler2 write some pre-defined data in some material blocks that can't be changed in materials editor. ZModeler2 materials editor is quite limited in settings it can store for materials, so some unsupported material settings could be lost on import and exported with some "default" values. That's why you might get identical export of shading on every re-export from ZModeler (default game's parameter is lost and another one is always written on export). Just a thought of cause, I don't remember how this all works.

The "Autodetect lights" is not related to shading. This option allows to detect vehicle lights (front-left, front-right, rear-left...) based on polygons location.

The "importGeometryExtension" block that was not recognized by the importer has a size of 4 bytes, so it is likely just one value for an object. I can't say what is this and whether this is related to the issue or not, probably it's not.
Carlos85G
Posts: 5
Joined: Wed Mar 22, 2023 7:20 am

Re: Vice City - Darker DFF exports from ZMod2?

Post by Carlos85G »

I tried adding "Diffuse color" to the vertices, then removed "Simple color mode" from the materials and changed the "Ambient" color to (R)255, (G)255, (B)255 (they were set to a dark gray before) but no positive effect; instead, it has detrimental effects on matte materials, which loose transparency.

I've been checking some other forums and I found that there's some settings I can't find how to adjust in ZMod 2, like Ambient shading:

In attached images:
- First one: Original Deluxo imported with Blender's DragonFF add-on - Material properties of "primary" - Ambient shading is "1.00"
- Second one: Zmod2 export imported with Blender's DragonFF add-on - Material properties of "primary" - Ambient shading is "0.45"

Is there any way to change this "Ambient shading" value in ZMod2?
Attachments
original_ambient_shading.png
original_ambient_shading.png (2.57 KiB) Viewed 2694 times
dark_ambient_shading.png
dark_ambient_shading.png (2.69 KiB) Viewed 2694 times
Last edited by Carlos85G on Sat Mar 25, 2023 3:43 pm, edited 1 time in total.
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Vice City - Darker DFF exports from ZMod2?

Post by Oleg »

I can't remind this, it was way too long ago. It might be possible this value is hard-coded in an exporter.
Carlos85G
Posts: 5
Joined: Wed Mar 22, 2023 7:20 am

Re: Vice City - Darker DFF exports from ZMod2?

Post by Carlos85G »

Just in any case someone wants a semi-solution, I found a way to brute-force it:

Open the DFF in a hex editor (like HxD) and replace every instance of the following:

Code: Select all

66 66 E6 3E 00 00 80 3F 00 00 80 3F
(0.450, 1.000, 1.000)

with this:

Code: Select all

00 00 80 3F 00 00 80 3F 00 00 80 3F
(1.000, 1.000, 1.000)

This will change the ambient shading in every material's surface properties (labeled "Unknown" in the material struct 0x01)

Attached file:
- Right side: original ZMod2 export.
- Left side: Hex edit.
Attachments
hex-fix.png
Post Reply