mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix M2 white shell artifact from missing textures, add opacity track support
Batches whose named texture fails to load now render invisible instead of white (the swampreeds01a.blp case causing a white shell around aquatic plants). Also implements proper M2 opacity plumbing: - Parse texture weight tracks (M2Track<fixed16>) and color animation alpha tracks (M2Color.alpha) to resolve per-batch opacity at load time - Skip batches with batchOpacity < 0.01 in the render loop - Apply M2Texture.flags (bit0=WrapS, bit1=WrapT) to GL sampler wrap mode - Upload both UV sets (texCoords[0] and texCoords[1]) and select via textureUnit uniform, so batches referencing UV set 1 render correctly
This commit is contained in:
parent
4ba10e772b
commit
9a950ce09f
4 changed files with 141 additions and 15 deletions
|
|
@ -196,6 +196,16 @@ struct M2Model {
|
|||
std::vector<M2TextureTransform> textureTransforms;
|
||||
std::vector<uint16_t> textureTransformLookup;
|
||||
|
||||
// Texture weights (per-batch opacity, from M2Track<fixed16>)
|
||||
// Each entry is the "at-rest" opacity value (0=transparent, 1=opaque).
|
||||
// batch.transparencyIndex → textureTransformLookup[idx] → textureWeights[trackIdx]
|
||||
std::vector<float> textureWeights;
|
||||
|
||||
// Color animation alpha values (from M2Color.alpha M2Track<fixed16>)
|
||||
// One entry per color animation slot; batch.colorIndex indexes directly into this.
|
||||
// Value 0=transparent, 1=opaque. Independent from textureWeights.
|
||||
std::vector<float> colorAlphas;
|
||||
|
||||
// Attachment points (for weapon/effect anchoring)
|
||||
std::vector<M2Attachment> attachments;
|
||||
std::vector<uint16_t> attachmentLookup; // attachment ID → index
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue