2D GPU Particles working..

This commit is contained in:
Juan Linietsky 2017-06-21 16:25:45 -03:00
parent 3c1fd26bb0
commit 95560e02c5
21 changed files with 1039 additions and 1340 deletions

View file

@ -612,6 +612,7 @@ public:
TYPE_POLYGON,
TYPE_MESH,
TYPE_MULTIMESH,
TYPE_PARTICLES,
TYPE_CIRCLE,
TYPE_TRANSFORM,
TYPE_CLIP_IGNORE,
@ -707,6 +708,16 @@ public:
CommandMultiMesh() { type = TYPE_MULTIMESH; }
};
struct CommandParticles : public Command {
RID particles;
RID texture;
RID normal_map;
int h_frames;
int v_frames;
CommandParticles() { type = TYPE_PARTICLES; }
};
struct CommandCircle : public Command {
Point2 pos;
@ -844,6 +855,15 @@ public:
r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
} break;
case Item::Command::TYPE_PARTICLES: {
const Item::CommandParticles *particles_cmd = static_cast<const Item::CommandParticles *>(c);
if (particles_cmd->particles.is_valid()) {
Rect3 aabb = RasterizerStorage::base_singleton->particles_get_aabb(particles_cmd->particles);
r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
}
} break;
case Item::Command::TYPE_CIRCLE: {