niftools / nifxml

A repository for the nif.xml file, which contains the nif file format description.
http://www.niftools.org
GNU General Public License v3.0
37 stars 43 forks source link

Flags - Alpha threshold #18

Open neomonkeus opened 10 years ago

neomonkeus commented 10 years ago

Threshold values for NiAplhaProperty seem to be bit-flags, should find common values and see what the bits are.

@ttl269 - any input on this as you encounter this issues alot.

ttl269 commented 10 years ago

I don't think so. I think that it si defined correctly in nif.xml - like the threshold for alpha testing function - and it works like that. So, I don't see any reason to change anything here.

hexabits commented 10 years ago

@neomonkeus @ttl269 There are actually undeciphered values for NiAlphaProperty's Flags.

Harvestable plants where the texture changes when picked e.g. florajazbay01.nif (a bad example because the vanilla NIF's threshold is actually wrong. Fixed in USKP.) seem to have a Flags value of 37612.

This means more than likely that 32768 has something to do with harvestable plants. The way that this appears to work is that Bethesda expects the Threshold to be 128. There are parts of the DDS file's alpha that you paint a grey color. Once you harvest the plant it adds a certain value to the threshold such that this grey color becomes invisible.

This means there is also a 16384 value.

ttl269 commented 10 years ago

@jonwd7 @neomonkeus My investigations:

hexabits commented 10 years ago

@ttl269 So does disabling the 15th bit not cause the "increase threshold on harvest" function to cease in game? Because it's odd that these harvestable plants have this bit, yet other plants and grass do not.

I will eventually getting around to writing an 010 script that can test the various bitflags in the NIF format so that I can actually start compiling lists of all the NIFs with certain bits toggled on.

ttl269 commented 10 years ago

@jonwd7 I have tested it yesterday and disabling this bit didn't broke "increase threshlod on harvest" function in game. Later then I have found a name for that bit - Editor Alpha Ref Test - so I assume that this bit has something to do only in CK.