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
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    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

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,156
    Rep Power
    736

    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 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,156
    Rep Power
    736

    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 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

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

    Thanks Petr!

  5. #5
    Member
    Join Date
    Jan 2007
    Age
    76
    Posts
    426
    Rep Power
    61

    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
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

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

    No, works fine here.

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    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/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    Member
    Join Date
    Jan 2007
    Age
    76
    Posts
    426
    Rep Power
    61

    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
    7,156
    Rep Power
    736

    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 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

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

    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

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
  •