liaocheng / away3d-particles-system Goto Github PK
View Code? Open in Web Editor NEWA particle system based on Stage3D for Away3D engine
A particle system based on Stage3D for Away3D engine
Hi liaocheng,
How I can make the Particles move freely? I mean, I'm using the smoke class, and write:
var smoke:Smoke = new Smoke();
myCar.addChild(smoke);
But the particles "follow" the car, instead of follow their local velocity.
I do not know if I explained well
Thanks and good work!
Hi,
How can I start and stop a Particle Effect in only one Container. Think about a First Person Shooter were Bullets hit a Target. I dont want to create new Particle Containers each Time the Bullet hits.
What Param defines that the Animation has finished? Sorry for my poor English.
Thx
There is no dispose function for the EffectGroup or any other of the classes.
The result is, that when I spawn a particle system multiple times and then remove it, after some time I get a flash exception "Vertex Buffer Resource Limit exceeded".
Hi Liao,
Great work on this particle system, it is the best.
If I add RandomRotateLocal, my particles disappear. I tried many different values for param["RandomRotateLocal"] but I don't see the particles.
I have very simple Plane particles for testing. I would like these particles to start at different x, y, z rotations.
It is based on your "fire example":
var material:ParticleColorMaterial = new ParticleColorMaterial();
var planeGeo:PlaneGeometry = new PlaneGeometry(30, 20,1,1,false,true);
var planeGeo2:PlaneGeometry = new PlaneGeometry(15, 10,1,1,true,true);
sample1 = new ParticleSample(planeGeo.subGeometries[0], material);
sample2 = new ParticleSample(planeGeo2.subGeometries[0], material);
//step 2:we create a generater which will group the samples.
var generater:MutiWeightGenerater = new MutiWeightGenerater([sample1, sample2], [5, 1], 1000);
//step 3: we create a container and set some attributes.
particle = new ParticlesContainer();
particle.loop = true;
particle.hasDuringTime = true;
var action5:RandomRotateLocal = new RandomRotateLocal();
particle.addAction(action5);
Hi liaocheng,
I want to know if it would be possible to pause the generation of particles, but not stop the update of the particles that are already generated. For example, when I stop the particles in the smoke example, it freezes, and if I use removeChild, the effect is strange.
Thanks!
a3dparticle\animators\ParticleAnimationtor.as,34 行 1024: 正在覆盖未标记为 override 的函数。
...
public function get absoluteTime():Number
{
return _absoluteTime;
}
...
then in TransformFollowAnimator.as I find:
63-67
...
override public function set absoluteTime(value:Number):void
{
_lastTime = absoluteTime;
super.absoluteTime = value;
}
...
so, I am not so good at as3,can you help me how to fix this?Thank you very much!
A few animation classes are changed in the newest Away3D so now the particle system isn't working anymore
If a TransformFollowContainer is used with both offset and rotation, the resulting particle system position is not at the correct location even if all eulers of the rotation part are set to zero.
If all eulers are zero, I expected the container to work as if it had offset only, the resulting position should remain the same.
Hi, Liaocheng. Good job.
The exmple/index.html works well. But I just cannot build any of the swfs myself. Could you share your steps to do it?
Thanks.
When using the "fire.xml" example and exchanging the ParticleContainer to a TransformFollowContainer, the register limit is exceeded.
Before A3D4 Release changes, this worked like a charm.
Error: Register overflow!
at RegisterPool/requestFreeVectorReg()[away3d\materials\utils\RegisterPool.as:46]
at away3d.materials.utils::ShaderRegisterCache/getFreeVertexAttribute()[away3d\materials\utils\ShaderRegisterCache.as:173]
at a3dparticle.animators.actions::TransformFollowAction/getOffsetCode()[a3dparticle\animators\actions\TransformFollowAction.as:80]
at a3dparticle.animators.actions::TransformFollowAction/getAGALVertexCode()[a3dparticle\animators\actions\TransformFollowAction.as:73]
at a3dparticle.animators::ParticleAnimation/getAGALVertexCode()[a3dparticle\animators\ParticleAnimation.as:308]
at away3d.materials.passes::MaterialPassBase/updateProgram()[away3d\materials\passes\MaterialPassBase.as:344]
at a3dparticle.core::SimpleParticlePass/updateProgram()[a3dparticle\core\SimpleParticlePass.as:65]
at away3d.materials.passes::MaterialPassBase/activate()[away3d\materials\passes\MaterialPassBase.as:261]
at a3dparticle.core::SimpleParticlePass/activate()[a3dparticle\core\SimpleParticlePass.as:59]
at away3d.materials::MaterialBase/activatePass()[away3d\materials\MaterialBase.as:353]
at away3d.core.render::DefaultRenderer/drawRenderables()[away3d\core\render\DefaultRenderer.as:152]
at away3d.core.render::DefaultRenderer/draw()[away3d\core\render\DefaultRenderer.as:103]
at away3d.core.render::RendererBase/executeRender()[away3d\core\render\RendererBase.as:288]
at away3d.core.render::DefaultRenderer/executeRender()[away3d\core\render\DefaultRenderer.as:62]
at away3d.core.render::RendererBase/render()[away3d\core\render\RendererBase.as:252]
at away3d.containers::View3D/render()[away3d\containers\View3D.as:616]
Hi liaocheng,
I have an issue when use particles with alpha, that are draw ahead of objects of away3D (that have a texture with alpha). In this case, I see the away3D object instead my particles.
For example, if I have a smoke particles and a tree with a transparent texture, and I see the tree in front of the particles.
Any solution?
Thanks in advance
Particles disappeared after 180 rotation of camera and target in TransformFollowContainer.
Steps to reproduce the issue
Thanks
As I see it,, it is possible to change some settings of actions on the Fly.
for example:
public function ScaleByLifeGlobal(startScale:Number,endScale:Number)
{
priority = 3;
_startScale = startScale;
_endScale = endScale;
_delta = _endScale - _startScale;
}
startScale and _delta are only used @ setRenderState() and there it only sets it to an const.
override public function setRenderState(stage3DProxy : Stage3DProxy, pass : MaterialPassBase, renderable : IRenderable) : void
{
var context : Context3D = stage3DProxy._context3D;
context.setProgramConstantsFromVector(Context3DProgramType.VERTEX, scaleByLifeConst.index, Vector.<Number>([_startScale,_delta,0,0]));
}
shouldn't it be possible to change them? Or is there an reason why you don't allow that?
cheers Matse
PS: wuhuu Syntax highlighting ;)
ParticlesContainer.Clone doesn't copy the _alwaysInFrustum Boolean
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.