dexyfex / CodeWalker

https://www.gta5-mods.com/tools/codewalker-gtav-interactive-3d-map
469 stars 205 forks source link

Update Ytyp Archetype Flags and Fix for Generate Capsule LODLight and Fix for Capsule HDLight #205

Closed kirill-mapper closed 1 year ago

kirill-mapper commented 1 year ago

64 - Unk07 archetype flag: disable sorting for shaders with alpha. Used for glass objects, has a bug of drawing through objects in a mirror and a white glare strip in specular shaders 524288 - Unk20 archetype flag: plays YCD animation on Dynamic objects. Works on objects with 131072 - Dynamic

kirill-mapper commented 1 year ago

According to my research, the capsule uses only the first Extent.X value in the game, the rest are not used, but simply duplicated. I made changes to correctly generate the LOD of the capsule, as well as correctly display the HD height of the capsule. I also noticed that it needs fixing, this is a capsule shader, the shader uses extent y, it would also be worth changing to x

dexyfex commented 1 year ago

Care to explain about the 1.82..? Also can you please only include a single commit for each PR for small changes like this, and please don't include multiple different features in a single PR like you have here.

kirill-mapper commented 1 year ago

Care to explain about the 1.82..?

Matching the two capsules, the integer value of the LOD of the light, and adjusting the floating value of the HD light, I got the value, then rounded it to two decimal places 1.82 for easy perception, since later the final value will be rounded and represented by the byte data type, and using a more accurate a value with a bunch of decimal places doesn't make sense and won't affect the final value in any way.

dexyfex commented 1 year ago

Does the 1.82 work for all capsules..? Did you determine this value from looking at vanilla capsules lights? Usually there is some reasoning/math to make such magic numbers, so mostly I'm wondering what that would be.

kirill-mapper commented 1 year ago

Does the 1.82 work for all capsules..? Did you determine this value from looking at vanilla capsules lights? Usually there is some reasoning/math to make such magic numbers, so mostly I'm wondering what that would be.

Yes, this is for all capsules. I tried to research some LOD capsule lights and came to the conclusion that LOD capsules are prescribed in most cases without any system. If you take any LOD value of coneOuterAngleOrCapExt and divide it by 1.82, you will get the HD value of Extent, and both capsules will match exactly.

dexyfex commented 1 year ago

Ahhhh I should have thought of this before, but 6ft = 1.8288m... I wonder if the maths still works out using that value? I suppose R* reasoning could be that one unit in the lod capsule size is 6ft, I've seen crazier conversion values heh.

kirill-mapper commented 1 year ago

Ahhhh I should have thought of this before, but 6ft = 1.8288m... I wonder if the maths still works out using that value? I suppose R* reasoning could be that one unit in the lod capsule size is 6ft, I've seen crazier conversion values heh.

изображение Interesting about ft. I have done tests on the value 1.8288 and it can be clearly seen that it is significantly higher for an exact match of the capsules

dexyfex commented 1 year ago

For sure the value 1.82 seems in your pictures to be the correct one... Maybe they took the 6ft value and rounded it down? I can't think of any better reason for such a number. Anyway thanks for your work.. I just wish we knew the actual explanation!