drarem Posted January 8, 2015 Share Posted January 8, 2015 I'm using this code in my App Start(), but not seeing particles when running. I can place a sphere in same spot with no problem. emit = Emitter::Create(1000); Material* material = Material::Create(); material->SetDepthTestMode(false); material->SetBlendMode(Blend::Alpha); material->SetShader(Shader::Load("Shaders/Particles/default.shader")); material->SetTexture(Texture::Load("Materials/Effects/smoke_particle.tex")); emit->SetMaterial(material); Vec3 gpos = ents->getpos(player); //place emitter at set position (down below, also placing a sphere at same position to confirm placement) emit->SetPosition(gpos.x+5, gpos.y+5, gpos.z+5, true); emit->SetEmissionVolume(Vec3(0.5,0.5,0.5)); emit->SetDuration(26000); emit->SetVelocity(0,-.5,0,0);//sets negative y velocity emit->SetVelocity(0,1,0,1);//changes the random velocity emit->SetRotationSpeed(15); //the particle will now rotate at 15 degrees per second emit->AddScaleControlPoint(1,1); //sets inital scale to 1 emit->AddScaleControlPoint(5,5); //sets final scale to 3 emit->AddAlphaControlPoint(0,0); //sets inital alpha to 0 emit->AddAlphaControlPoint(1,1); //sets final alpha to 1 emit->SetColor(.87,1,.9,.6,0); emit->SetColor(.81,.85,.87,1,1); //place sphere is same spot that smoke would be, but the sphere will fall to the ground when run. ents->setpos(bx, Vec3(gpos.x+5, gpos.y+5, gpos.z+5)); Quote Link to comment Share on other sites More sharing options...
drarem Posted January 8, 2015 Author Share Posted January 8, 2015 I can add via the editor, then it asks me to allow real time rendering and now the one I created in the editor is visible. This manual one still isn't visible. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 8, 2015 Share Posted January 8, 2015 Try placing the particle in front of the player first. That makes is a little easier to debug. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.