NVIDIAGameWorks / rtx-remix

Combined repo for the RTX-Remix runtime
https://www.nvidia.com/en-us/geforce/rtx-remix/
MIT License
1.31k stars 68 forks source link

GTA III / VC / SA vehicle color and alpha values for materials #189

Open JuniorDjjr opened 1 year ago

JuniorDjjr commented 1 year ago

All vehicles in GTA San Andreas (as so GTA III and GTA Vice City) have body painted on white instead of using correct car colors from carcols.dat.

I'm going to talk more specifically about GTA San Andreas, but the trilogy work essentially the same or similar.

I have 12 years experience modding GTA SA and I know the inner workings of it. This information that may not be directly related, but may help in case of problems: Just before rendering a car, the game changes the properties of its materials, to apply the body colors, remapping (car paintjobs, changes one texture to other), colors and ambient lighting for light textures etc. Therefore, all vehicles of the same model use the same materials, as well as the same mesh, but the materials are adjusted just before rendering each one.

There is also a second uvmap for a second texture (env map, called "xvehicleenv128" or "vehicleenvmap128" from "vehicle.txd") which is rendered over the top of the body, window and some other parts to simulate chrome reflections. But this, in my view, has nothing to do with the problem at the moment, as the same bug is seen even in parts without this env map, but it's interesting to keep this in mind for future debugging, btw it's also a good way to detect where the car's body painting is to apply the correct shaders, not always the colors of the car is used for bodywork.

Not only the car's body painting, but also materials painted by the game, are also white (example, the original Dodo plane has transparent black faces to simulate fake shadows, but with RTX Remix, the faces are opaque white).

Related to this, vehicle windows do not have opacity. They're still black because the game uses the 1 pixel mapping of the "vehiclegeneric256" texture, but the alpha value is in the material, so it's not transparent.

Another detail is that the game itself or mods can also use painting materials on other models, such as map objects and weapons. This issue is not necessarily about vehicles, but essentially, the issue is only noticeable on them.

locobourne commented 1 year ago

this guy knows

Hemry81 commented 12 months ago

I found a temporary fix method described below : https://discord.com/channels/1028444667789967381/1097105394821759006/1123350155433873419

NV-LL commented 2 months ago

Hello! Will you please test this on the latest release and let us know if the issue persists? Thank you!

locobourne commented 2 months ago

Hello! Will you please test this on the latest release and let us know if the issue persists? Thank you!

Hello, it is still not solved. at least in the default configurations