Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: PixelArt - Clouds

  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

  7. #7
    Thank you Petr , certainly this is a scientific subject.
    your last program gives 61 fps on i5 desktop with Geforce GT 640 , windows xp /32
    but in a slow laptop Asus X553MA with windows 10 it is only 21 fps. its graphics card is built intel HD.
    regards

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

    thanks for testing - the low framerate could be caused by multiple factors, one of them could be alpha blending.
    To verify this theory, try to comment out "tbgl_pushState %TBGL_BLEND" and "tbgl_popState" in drawCloud,and run the demo again on your ASUS.


    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

  9. #9
    Hi Petr
    i have commented out "tbgl_pushState %TBGL_BLEND" and "tbgl_popState" , but the 21 fps stay the same as before. with ugly shaped clouds. i have opened the tool OpenGL_GetInfo.tbasic , it works but can't save the info when we click on the button (save report) in the latest thinbasic version 1.9.16.17 so i have tried it with TB version 1.8.9 and it can save the report. i attach the report for asus.
    i am happy more with my i5 desktop because of the big monitor and it is relatively speedy machine.
    Attached Files Attached Files

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

    thank you for your reply - I checked why OpenGL_GetInfo does not work and I was ashamed to see my old codebase
    So I recoded the tool from the scratch, and published the source code at GitHub. Check the clean code, huhuhuuu.

    You can grab ZIP with the latest version here as opengl_report.zip:
    https://github.com/petrSchreiber/opengl_report/releases

    My apologies for the trouble with the tool, now please let me think what could be the main performance issue with the demo.


    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 3 123 LastLast

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
  •