I figured out how to fix the global illumination. We still don't have shadows, but heck, this is quite a big step towards the visual quality.
First off, we'll be using the higher quality GIA lighting provided in the DLC Packs for Unleashed. Brother Zoney has been uploading them, and I've been trying to figure out how to make them right.
It's widely known by now that between the 360 version and the PC version, all UVs for terrain-related stuff are flipped. So even if we do flip the textures for the terrain, the lighting still needs to be fixed. But you just can't flip around the GIA lighting textures and make it work... Most of these textures hold nearly 10 to 100 sub-textures for saving up space, and if you just rotated them, it would look glitchy as hell because the coordinates would be wrong.
But, you see, inside each of these gia.ar files, there's a little binary file called atlasinfo, with an easy to guess binary structure. Heck, I already reverse-engineered it fully:
Followed this structure, flipped the UVs of each texture with Photoshop, swapped the uv multipliers and scales inside each atlasinfo thanks to a handy tool, and this is the result. Correct global illumination:
Now notice there's still a few textures we missed because we didn't copy them sadly, and the GIA loading data range hasn't been tweaked yet in that video because the DLC GIA data is MUCH heavier than the normal one. This should be all fixable by editting a few xmls though.
Now all we got left to do is figure out how to enable shadowing of the terrain(notice Sonic nor objects cast Shadows on the terrain, even if the shadows are there shown by the previous evidence). As for the darker coloring, the reason might be that the GIA textures might be lower bit-depth than the PC version, so a higher-bit depth will give it this more saturated look. Once I figure out the right settings, it should work.
I should be able to record a run of Windmill Isle Act 2 with the correct global illumination once the Archive editor is updated for admitting a text file as a command line.
First off, we'll be using the higher quality GIA lighting provided in the DLC Packs for Unleashed. Brother Zoney has been uploading them, and I've been trying to figure out how to make them right.
It's widely known by now that between the 360 version and the PC version, all UVs for terrain-related stuff are flipped. So even if we do flip the textures for the terrain, the lighting still needs to be fixed. But you just can't flip around the GIA lighting textures and make it work... Most of these textures hold nearly 10 to 100 sub-textures for saving up space, and if you just rotated them, it would look glitchy as hell because the coordinates would be wrong.
But, you see, inside each of these gia.ar files, there's a little binary file called atlasinfo, with an easy to guess binary structure. Heck, I already reverse-engineered it fully:
struct atlasinfo_header {
char padding=0;
unsigned int8 textures_ammount; // How many DDS files it needs to load
char add_padding=0;
};
// Read this for textures_ammount times after reading sub_texture_info
struct texture_header {
unsigned int8 texture_name_size; // How many chars the texture name has
char texture_name[texture_name_size]; // DDS texture name (without the .dds extension), non-null terminated
unsigned int8 sub_texture_size; // How many subtextures are in this file
char padding=0;
};
// Read the next structure structure for sub_texture_size times
struct sub_texture_info {
unsigned int8 subtexture_name_size; // How many chars the subtexture name has
char subtexture_name[subtexture_name_size]; // non-null terminated string, internal name of the texture this gia data belongs to in the terrain(or perhaps the object)
// Multipliers for the UV coords
unsigned int8 u_mult;
unsigned int8 v_mult;
// Absolute value of the UV coordinate this texture is
// Should be multiplied by u_mult, and v_mult
unsigned int8 u_scale;
unsigned int8 v_scale;
};
Followed this structure, flipped the UVs of each texture with Photoshop, swapped the uv multipliers and scales inside each atlasinfo thanks to a handy tool, and this is the result. Correct global illumination:
Now notice there's still a few textures we missed because we didn't copy them sadly, and the GIA loading data range hasn't been tweaked yet in that video because the DLC GIA data is MUCH heavier than the normal one. This should be all fixable by editting a few xmls though.
Now all we got left to do is figure out how to enable shadowing of the terrain(notice Sonic nor objects cast Shadows on the terrain, even if the shadows are there shown by the previous evidence). As for the darker coloring, the reason might be that the GIA textures might be lower bit-depth than the PC version, so a higher-bit depth will give it this more saturated look. Once I figure out the right settings, it should work.
I should be able to record a run of Windmill Isle Act 2 with the correct global illumination once the Archive editor is updated for admitting a text file as a command line.
This post has been edited by Dario FF: 30 January 2012 - 11:06 AM


