|
| Renderer Crash | |
| | Author | Message |
---|
DevilWithin
Messages : 16 Date d'inscription : 2011-01-30
| Subject: Renderer Crash Tue Jan 17, 2012 3:07 pm | |
| Hello,
I've updated my spark 2 to the latest from the SVN and I was testing it but i ran into problems..
I've created a simple system, with only one group with pretty much generic stuff.. and it works just fine, but after a certain number of particles are emitted, i get a crash and my debugger points at the render method of the Renderer..
I tried line renderer and point renderer, and they both work, but crash at the same time..
I am kinda lost with this.. What can i do?
Also, could you give more feedback about progress of SPARK 2? It is suposed to be usable and stable for a game right now? Thanks | |
| | | Darktib Committer
Messages : 389 Date d'inscription : 2009-07-20 Localisation : A coté de Paris
| Subject: Re: Renderer Crash Tue Jan 17, 2012 4:08 pm | |
| Hello, Can you post the code used ? Which render engine do you use (Irrlicht,OpenGL,DirectX,etc...)? For SPARK 2, it is usable now, but there will be some changes to the rendering process (I don't know more about this, I'm not the lead developer ). | |
| | | DevilWithin
Messages : 16 Date d'inscription : 2011-01-30
| Subject: Re: Renderer Crash Tue Jan 17, 2012 4:20 pm | |
| I will attempt to elucidate you on what i am doing, i will post the major lines i use of spark (not running code, just the relevant snippets)
gravity = SPK::Gravity::create(SPK::Vector3D(0.0f, 0.3,0.0f));
SPK::System::setClampStep(true,0.1f); SPK::System::useAdaptiveStep(0.001f,0.01f);
system = SPK::System::create(true); particleRenderer = SPK::GL::GLPointRenderer::create(10);
particleRenderer2 = SPK::GL::GLLineRenderer::create(2,1);
sphere = SPK::Sphere::create(SPK::Vector3D(),1.0f);
emitter = SPK::SphericEmitter::create(SPK::Vector3D(1.0f,1.0f,-1.0f),0.0f,3.14159f,sphere,true,-1,100.0f,0.2f,0.5f);
trailGroup = system->createGroup(1000);
trailGroup->setRenderer(particleRenderer2); trailGroup->setName("Trail"); trailGroup->setLifeTime(1.f,10.0f);
trailGroup->addEmitter(emitter); trailGroup->setColorInterpolator(SPK::ColorSimpleInterpolator::create(0xFF802080,0xFF000000)); trailGroup->addModifier(gravity);
That is pretty much it. Only adding the declarations as member variables and updateParticles/renderParticles.
Thanks- by the way, couldn't manage to display test.spk while loading it from the file.
| |
| | | Darktib Committer
Messages : 389 Date d'inscription : 2009-07-20 Localisation : A coté de Paris
| Subject: Re: Renderer Crash Tue Jan 17, 2012 5:22 pm | |
| What is the call stack when the crash occurs ? Has the effect reached a special point (first particle deletion, etc...)? Which operating system ? If your code is not too big (for ex, just a 'main.cpp'), you can post it here, thus I could test and help you more. - Quote :
- by the way, couldn't manage to display test.spk while loading it from the file.
Renderers are not serialized/deserialized for the moment (because it highly depends on which graphic engine you use); Juff is working on that I think. The solution is to manually (de)serialize renderers. | |
| | | Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: Renderer Crash Wed Jan 25, 2012 8:09 am | |
| Hi, I tried the code you provide and it runs perfectly with no crash for me. Your using OpenGL renderer but what do you use for windowing ? Are all libraries well compiled and compatible ?
If you can post a minimal code that reproduces the problem, that would help. | |
| | | DevilWithin
Messages : 16 Date d'inscription : 2011-01-30
| Subject: Re: Renderer Crash Tue Feb 28, 2012 9:53 pm | |
| Hello my friends, sorry for the late answer. I've tried to create a minimal example that reproduces the error for me. - Code:
-
sf::RenderWindow window; window.Create(sf::VideoMode(), "heye");
SPK::Ref<SPK::System> sparkSystem = SPK::System::create(true);
SPK::Ref<SPK::Group> effectgroup = sparkSystem->createGroup(400); effectgroup->setName("Cool"); effectgroup->setRenderer(SPK::GL::GLPointRenderer::create(10)); effectgroup->addEmitter(SPK::SphericEmitter::create(SPK::Vector3D(1.0f,1.0f,-1.0f),0.0f,3.14159f,SPK::Sphere::create(SPK::Vector3D(),1.0f),true,-1,100.0f,0.2f,0.5f)); effectgroup->addModifier(SPK::Gravity::create(SPK::Vector3D(0.0f, 0.3,0.0f))); effectgroup->addParticles(100, SPK::Vector3D(200,200,0), SPK::Vector3D());
while(window.PollEvent(sf::Event())){
}
sf::Clock c; while(window.IsOpen()){ window.Clear();
sparkSystem->updateParticles(c.GetElapsedTime().AsSeconds()); c.Restart();
SPK::GL::GLRenderer::saveGLStates(); sparkSystem->renderParticles(); SPK::GL::GLRenderer::restoreGLStates();
window.Display(); } Also, the Call Stack dies right there.. - Code:
-
Sandbox.exe!SPK::System::renderParticles() Line 206 + 0x16 bytes C++ Sandbox.exe!SPK::Group::renderParticles() Line 272 + 0x38 bytes C++ > Sandbox.exe!SPK::GL::GLPointRenderer::render(const SPK::Group & group, const SPK::DataSet * dataSet, SPK::RenderBuffer * renderBuffer) Line 132 + 0x15 bytes C++ Its the same crash I get from the other application, but in this case it doesn't even render one frame, while in the other i see the snow flocks a little time As you can see, i use the latest SFML 2 for windowing, we both know it is pretty good When i mean latest, i mean from yesterday! I fetched the most recent versions of all libraries i use yesterday, compiled them all, and even changed to vs2010 from vs2008. So, different conditions, same problem. Of course I can be compiling SPARK 2 wrong, but I pretty much compiled it with default settings.. | |
| | | DevilWithin
Messages : 16 Date d'inscription : 2011-01-30
| Subject: Re: Renderer Crash Thu Mar 01, 2012 11:15 pm | |
| I think its solved , with help of SFML 2 developer, Laurent.
GL_COLOR_ARRAY was enabled by default from SFML 2, causing spark to crash. Disabling it seems to solve the issue.
Thanks. | |
| | | Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: Renderer Crash Fri Mar 02, 2012 8:44 am | |
| Ok, Thanks
I think its more the GL_TEXTURE_COORD_ARRAY that must be enabled as well that caused the crash. I can make a guard in saveGLStates for that. | |
| | | Sponsored content
| Subject: Re: Renderer Crash | |
| |
| | | | Renderer Crash | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |