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

Thread: Is it possible to draw this simple map faster?

  1. #1
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Leverkusen, Germany
    Age
    52
    Posts
    3,283
    Blog Entries
    2
    Rep Power
    340

    Is it possible to draw this simple map faster?

    Hi folks,

    attached is a sample code where I draw a map of tiles. I wonder if I have a significant bottle neck here as I think it is damn slow.
    If not, then I will try to work with entities on it, but I'm not sure if entities work in 2D mode.

    Cheers
    Michael
    Attached Files Attached Files
    Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200.

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,828
    Blog Entries
    3
    Rep Power
    696

    Re: Is it possible to draw this simple map faster?

    Mike,

    optimized version is in the works.

    The worst thing is that you set 2D rendering for EACH tile, better to:
    - set 2D mode
    - render all tiles
    - set 3D mode
    - render rest

    Plus some more tricks I am working on now, please wait


    Bye,
    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

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,828
    Blog Entries
    3
    Rep Power
    696

    Re: Is it possible to draw this simple map faster?

    Hi,

    here is optimization without entities ( in case you do not want to use them ),
    entity version in the works now

    Speed gain: 60FPS -> 100FPS on my box.


    Petr

    EDIT: Updated
    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

  4. #4
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Leverkusen, Germany
    Age
    52
    Posts
    3,283
    Blog Entries
    2
    Rep Power
    340

    Re: Is it possible to draw this simple map faster?

    Thanks Petr!
    Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200.

  5. #5

    Re: Is it possible to draw this simple map faster?

    Petr, I tried to download the file but it keeps telling me I am not authorized for this section. Has anyone else had this problem?

    Thanks
    Sandy


    Don't know what happened when I first tried to download but I tried again and got the file.

  6. #6
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Leverkusen, Germany
    Age
    52
    Posts
    3,283
    Blog Entries
    2
    Rep Power
    340

    Re: Is it possible to draw this simple map faster?

    No, works fine here.
    Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200.

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,335
    Blog Entries
    2
    Rep Power
    10

    Re: Is it possible to draw this simple map faster?

    I checked your permissions and they seem ok. If you can see attached files you should be able to download them.
    Seems a local problem. try to right-click attached file and choose "save as ...". It is a .tBasic extension file. Maybe some blocks on executing directly from the web page.

    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  8. #8

    Re: Is it possible to draw this simple map faster?

    Eros, I tried again and got the file without any trouble. Don't know what happened. It could be a glitch on my end as my server was down for a couple of day. They were putting in some new equipment and there's no telling when they will have their system settled down.

    Thanks
    Sandy

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,828
    Blog Entries
    3
    Rep Power
    696

    Re: Is it possible to draw this simple map faster?

    Hi,

    here is entity version attached, again should be faster.

    One thing, but I know it is Your script Mike - if you will go the 2D route, it will be again resolution dependant. If you plan it 1024x768 only, then no problem.

    Second thing - you originally had V-Sync on, this might hurt performance in some cases ( as says help file :P ). On other side it provides more stable image. You might want to try "Gears Of War" way, where V-Sync is enabled/disabled in dependence on current framerate.


    Bye,
    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

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    62
    Posts
    3,869
    Rep Power
    398

    Re: Is it possible to draw this simple map faster?

    My results:
    Original 100 fps

    Opti 1 150 fps

    Opti 2 175 fps

    All three ran fine, but this will be good code to study to see how done in different ways for sure. Thanks guys!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 3 123 LastLast

Similar Threads

  1. ellipse with angle canvas draw
    By zak in forum UI (User Interface)
    Replies: 1
    Last Post: 16-01-2011, 23:49

Posting Permissions

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