Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-08-31 21:27:08 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-08-31 21:27:08 +0400
commitf0d247748408bd10f49c54d3a28a925e37683c4b (patch)
treeb47851a73399e6b30c501550ec9024897d65c186 /intern/cycles/render/particles.h
parent5ecff7a240514e8f16e17aa163c6f0055b9edaf2 (diff)
Fix for #32184 and redesign of particle storage in Cycles.
The particle data used by the Particle Info node was stored in cycles as a list in each object. This is a problem when the particle emitter mesh is hidden: Objects in cycles are only intended as instances of renderable meshes, so when hiding the emitter mesh the particle data doesn't get stored either. Also the particle data can potentially be copied to multiple instances of the same object, which is a waste of texture space. The solution in this patch is to make a completely separate list of particle systems in the Cycles scene data. This way the particle data can be generated even when the emitter object itself is not visible.
Diffstat (limited to 'intern/cycles/render/particles.h')
-rw-r--r--intern/cycles/render/particles.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/intern/cycles/render/particles.h b/intern/cycles/render/particles.h
new file mode 100644
index 00000000000..e5481ad4c24
--- /dev/null
+++ b/intern/cycles/render/particles.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __PARTICLES_H__
+#define __PARTICLES_H__
+
+#include "util_types.h"
+#include "util_vector.h"
+
+CCL_NAMESPACE_BEGIN
+
+class Device;
+class DeviceScene;
+class Progress;
+class Scene;
+
+/* Particle System */
+
+struct Particle {
+ int index;
+ float age;
+ float lifetime;
+};
+
+class ParticleSystem {
+public:
+ ParticleSystem();
+ ~ParticleSystem();
+
+ void tag_update(Scene *scene);
+
+ vector<Particle> particles;
+};
+
+/* ParticleSystem Manager */
+
+class ParticleSystemManager {
+public:
+ bool need_update;
+
+ ParticleSystemManager();
+ ~ParticleSystemManager();
+
+ void device_update_particles(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
+ void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
+ void device_free(Device *device, DeviceScene *dscene);
+
+ void tag_update(Scene *scene);
+};
+
+CCL_NAMESPACE_END
+
+#endif /* __PARTICLES_H__ */
+