mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Render M2 glow batches as billboarded light sprites
Replace flat mesh rendering of additive/mod blend batches (blendMode >= 3) with camera-facing point sprites using a soft radial gradient texture and additive blending. Adds M2 particle emitter infrastructure (structs, shader, parsing stubs) but disables emitter parsing — the assumed 476-byte struct size is wrong for WotLK 3.3.5a, causing misaligned reads that explode RAM.
This commit is contained in:
parent
b9fdc3396d
commit
88241cbddc
5 changed files with 635 additions and 7 deletions
|
|
@ -48,6 +48,7 @@ struct M2AnimationTrack {
|
|||
std::vector<uint32_t> timestamps; // Milliseconds
|
||||
std::vector<glm::vec3> vec3Values; // For translation/scale tracks
|
||||
std::vector<glm::quat> quatValues; // For rotation tracks
|
||||
std::vector<float> floatValues; // For float tracks (particle emitters)
|
||||
};
|
||||
std::vector<SequenceKeys> sequences; // One per animation sequence
|
||||
|
||||
|
|
@ -129,6 +130,38 @@ struct M2Attachment {
|
|||
glm::vec3 position; // Offset from bone pivot
|
||||
};
|
||||
|
||||
// FBlock: particle lifetime curve (color/alpha/scale over particle life)
|
||||
struct M2FBlock {
|
||||
std::vector<float> timestamps; // Normalized 0..1
|
||||
std::vector<float> floatValues; // For alpha/scale
|
||||
std::vector<glm::vec3> vec3Values; // For color RGB
|
||||
};
|
||||
|
||||
// Particle emitter definition parsed from M2
|
||||
struct M2ParticleEmitter {
|
||||
int32_t particleId;
|
||||
uint32_t flags;
|
||||
glm::vec3 position;
|
||||
uint16_t bone;
|
||||
uint16_t texture;
|
||||
uint8_t blendingType; // 0=opaque,1=alphakey,2=alpha,4=add
|
||||
uint8_t emitterType; // 1=plane,2=sphere,3=spline
|
||||
M2AnimationTrack emissionSpeed;
|
||||
M2AnimationTrack speedVariation;
|
||||
M2AnimationTrack verticalRange;
|
||||
M2AnimationTrack horizontalRange;
|
||||
M2AnimationTrack gravity;
|
||||
M2AnimationTrack lifespan;
|
||||
M2AnimationTrack emissionRate;
|
||||
M2AnimationTrack emissionAreaLength;
|
||||
M2AnimationTrack emissionAreaWidth;
|
||||
M2AnimationTrack deceleration;
|
||||
M2FBlock particleColor; // vec3 RGB at 3 timestamps
|
||||
M2FBlock particleAlpha; // float (from uint16/32767) at 3 timestamps
|
||||
M2FBlock particleScale; // float (x component of vec2) at 3 timestamps
|
||||
bool enabled = true;
|
||||
};
|
||||
|
||||
// Complete M2 model structure
|
||||
struct M2Model {
|
||||
// Model metadata
|
||||
|
|
@ -161,6 +194,9 @@ struct M2Model {
|
|||
std::vector<M2Attachment> attachments;
|
||||
std::vector<uint16_t> attachmentLookup; // attachment ID → index
|
||||
|
||||
// Particle emitters
|
||||
std::vector<M2ParticleEmitter> particleEmitters;
|
||||
|
||||
// Flags
|
||||
uint32_t globalFlags;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue