Hi Bagamut,
how would you envision the support for particles?
Michael
I think it would be a good innovation, if there is support for particles (particle system).
Hi Bagamut,
how would you envision the support for particles?
Michael
Hi guys,
I have some draft spec ready for the particles. Till 25th I am under heavy work load, but then I will arrange the file and post it here for your review.
So far it is in my mind as standalone system, which can be used as is or with entity system.
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
So you could use them in 2d too?
Hi Mike,
yes, I would like it to work that way.
Also some elemental setup of particle life time changes of color/alpha/size are planned - I want it very robust and universal.
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Bagamut, Mike,
to update you on the progress, there are two facts I am considering for particles:
- designing the particles system the OOP way Eros starts to implement to ThinBASIC module development (see this article)
- make it as separate module (but usable with TBGL, including entity system) - it seems there will be lot of functionality and the TBGL would become big collosus, where half of help file could end up being just about particles
It could lead to some more intuitive coding. Instead of:
It could go as:DIM myFlame AS DWORD myFlame = TBGL_CreateParticle(ImageHandle, Color, ...) TBGL_ParticleSetSize(myFlame, 1) TBGL_ParticleSetAlpha(myFlame, 255) TBGL_ParticlePush(myFlame, 1, 2, 3)
The same for ParticleEmitter and so on.DIM myFlame AS Particle myFlame = new Particle("c:\flame.bmp", 255, 255, 255) myFlame.Size = 1 myFlame.Alpha = 255 myFlame.Move(1,2,3)
Petr
Last edited by Petr Schreiber; 10-11-2010 at 15:29.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Hi Petr,
sure the second version looks better and is easier to read.
Michael
Thanks Mike,
yes, much easier on the eyes. I will try to follow this pattern.
In future, it could be great new approach even for scene-entity system as well...
Petr
Last edited by Petr Schreiber; 10-11-2010 at 19:36.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
One more idea from my confused draft, I hope you don't mind I put it here per partes, but it seems easier to discuss for me.
Resource management - in TBGL, it is my motivation to simplify this side of graphic coding as much as possible, which is already reflected by fact all TBGL objects are garbage collected.
With Particles, I would like to take it one step further. For example - unless needed for advanced tasks, there would be no need to manage texture handles at all! Only thing referenced will be the particle itself.
Once you define texture as particle property by filename for example, engine will store the texture handle internally and programmer will not have to care about it anymore. In case of multiple particles with the same texture, only one handle will be used internally (no repeated texture loading) to save GPU memory. Something similar is already present in m15 file handling.
Then the particle emitters and particles themself will be garbage collected as well, so programmer can focus on using them instead of scratching head where did he forget to release memory.
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB