Smooth scrolling using directx (have huge scrollable area)

Started by
1 comment, last by msbasanth 15 years, 4 months ago
Hi all, I am developing a tile based application. In worst case each tile may use diferent textures. I am using point sprites to show tile (using texture). I have to show about 1000 x 800 tiles in a frame. I would use tiles of size 4 x 4. Now i am doing a scrollable window in DirectX using DXUT. I am trying to show tiled pattern inside this scrollable window. it scrolls in all directions. For giving a feel of scrolling i am redrawing the pattern using the vertex buffer information we have. It will have scrollable areas more than 60,000 x 10,000. ie. we cannot pre-render the entire scrollable area and then blit the viewable area to the screen. I tried by copying the content of offscreen surface (already rendered portion of scrollable area ) to backbuffer and the presenting it. Still i am not getting the smooth scrolling. When i profiled, it seems device.Present() function is the bottleneck. I am using a dynamic vertex buffer since the vertex information we have to keep is huge. How to achieve a smooth scrolling, considering i will have to show huge scrollable area? How can i implement double buffering? Expecting Reply Bachu
Advertisement
Your best bet is to simply track which tiles are visible in the viewport and then render only those tiles. This is only going to be an extremely light load on the GPU and should be easy to scroll through.

My free book on Direct3D: "The Direct3D Graphics Pipeline"
My blog on programming, vintage computing, music, politics, etc.: Legalize Adulthood!

Thanks for the reply,

Now i am drawing the tiles which are visible in the view port. The number tiles to be shown in a frame is about 1000 x 800. The data to be shown next is calculated dynamically. Smoother scrolling is not happening even we have the surface already drawn and copying it to back buffer dynamically.

I am not using any extra buffer. I am working with DXUT.

bachu

This topic is closed to new replies.

Advertisement