Results 1 to 10 of 22

Thread: PixelArt - Clouds

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    PixelArt - Clouds

    Hi friends,

    playing through the Kingdom: New lands, I was in continous awe how much dynamic detail the authors managed to squeeze to their pixel art.
    I was thinking about it a lot and came up with approach to achieve similar goal in thinBasic.
    Pixel art is typically based on little bitmaps, but I thought it would be more interesting to design pixel art with vector shapes (via TBGL), and then post process it to get the granular look.

    Approach taken
    In order to do this, I first modified my library for offScreenRendering, then prepared framework for pixelArt demos and finally, did a simple cloud demo I would like to share with you here.

    Get the code
    If you are advanced user (command line is your second home), get it from git and initialize submodules.
    If you just want to try it on your PC, get the complete zip package.


    Petr
    Attached Images Attached Images
    Last edited by Petr Schreiber; 29-04-2017 at 19:00.
    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

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Just by playing with the example, you can get completely different results.
    The elArt framework allows you to set virtual resolution independently for vertical and horizontal dimension, allowing anamorphic effect like the one on the image below.


    Petr
    Attached Images Attached Images
    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

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    That's a great idea and great code.

    When I executed I didn't get at first that clouds were changing, wow.
    Also the way you organize and write code is a pleasure to see: well written, great variables name self describing the code.

    A suggestion: CPU usage is high due to no time given to the OS to manage events.
    But if you add DoEvents command inside For/Next loop of drawCloud function in cloud.tBasic, CPU will always stay under 5%

    Thank you for this great example to study.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Eros,

    thank you very much for your kind words. ThinBASIC TYPEs make it easy to organize code to reusable units, which is great

    And also - thanks a ton for the advice! I was thinking about the CPU footprint, I think I will try to come up with general solution as part of the elArt framework (maybe timer based, not sure now) to address the CPU usage.
    Because on my PC, the DoEvents did kicked the framerate from 60 FPS to 4 FPS, which is sadly not acceptable.


    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 author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Can you please add FrameRate somewhere on screen so I can make some tests?
    Maybe an option in TBGL to automatically show frame rate on screen if a certain option is ON, so we can avoid to add lines on script.
    TBGL_FrameRateAutoShow(position, color) with position Upper left/right or bottom left/right

    Thanks
    Eros
    Last edited by ErosOlmi; 01-05-2017 at 17:45.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Eros,

    like in FRAPS? That would be cool, I will work on it
    In the meantime, I attach version with framerate being written to window title - just for debugging purposes.


    Petr
    Attached Files Attached Files
    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

Similar Threads

  1. cool article about imposter, clouds
    By kryton9 in forum TBGL General
    Replies: 1
    Last Post: 11-06-2007, 08:42

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
  •