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

Thread: PixelArt - Clouds

Share/Bookmark
  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,776
    Blog Entries
    3
    Rep Power
    690

    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 Thumbnails Attached Thumbnails Click image for larger version. 

Name:	demo_pixelArtClouds.jpg 
Views:	15 
Size:	42.2 KB 
ID:	9672  
    Last edited by Petr Schreiber; 29-04-2017 at 19:00.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,776
    Blog Entries
    3
    Rep Power
    690
    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 Thumbnails Attached Thumbnails Click image for larger version. 

Name:	demo_pixelArtClouds2.jpg 
Views:	17 
Size:	53.4 KB 
ID:	9673  
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,106
    Blog Entries
    2
    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/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,776
    Blog Entries
    3
    Rep Power
    690
    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    50
    Posts
    8,106
    Blog Entries
    2
    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/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,776
    Blog Entries
    3
    Rep Power
    690
    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  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
    6,776
    Blog Entries
    3
    Rep Power
    690
    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

  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
    6,776
    Blog Entries
    3
    Rep Power
    690
    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 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

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

Posting Permissions

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