Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Suggestion for Particles system.

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Age
    35
    Posts
    12
    Rep Power
    17

    Cool Suggestion for Particles system.

    I think it would be a good innovation, if there is support for particles (particle system).

  2. #2
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    59
    Posts
    3,300
    Rep Power
    349
    Hi Bagamut,

    how would you envision the support for particles?

    Michael

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Age
    35
    Posts
    12
    Rep Power
    17
    Quote Originally Posted by Michael Hartlef View Post
    Hi Bagamut,

    how would you envision the support for particles?

    Michael
    As standart functions like:
    TBGL_MakeParticles(Particle Number, Image Handle, Frequency, Radius);
    TBGL_PositionParticles(Particle Number, X, Y, Z).
    And similar.

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736
    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

  5. #5
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    59
    Posts
    3,300
    Rep Power
    349
    So you could use them in 2d too?

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736
    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

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736
    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:

    DIM myFlame AS DWORD
    
    myFlame = TBGL_CreateParticle(ImageHandle, Color, ...)
    TBGL_ParticleSetSize(myFlame, 1)
    TBGL_ParticleSetAlpha(myFlame, 255)
    TBGL_ParticlePush(myFlame, 1, 2, 3)
    
    It could go as:
    DIM myFlame AS Particle 
    myFlame = new Particle("c:\flame.bmp", 255, 255, 255)
    myFlame.Size = 1
    myFlame.Alpha = 255
    myFlame.Move(1,2,3)
    
    The same for ParticleEmitter and so on.

    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

  8. #8
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    59
    Posts
    3,300
    Rep Power
    349
    Hi Petr,

    sure the second version looks better and is easier to read.

    Michael

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736
    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

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. Lydia - Particles [SPLIT from original hunters thread]
    By lydia_sp in forum TBGL General
    Replies: 7
    Last Post: 22-08-2009, 23:12
  2. badmine bombs and particles
    By Lionheart008 in forum TBGL General
    Replies: 3
    Last Post: 21-03-2009, 19:50

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •