Jump to content

Buffer speed.


Thareh
 Share

Recommended Posts

Hi!

I'm creating a user interface and I'm using a render to texture routine on all "gadgets" so it'll be faster to draw.

When I'm creating a new window there's a 200-300 ms delay, and I've traced this down to the buffer creation or buffer => texture conversion. (I'm using GetColorBuffer to convert)

So I'm asking: Are buffers slow or am I doing something wrong?

Thanks! :)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Here's an example: CLICK ME!.

When you create a new window 5 'render to texture' routines happens (Window, Window Panel, Min/max and close button, the label) and this causes a delay.

On my laptop the delay is about 400 ms which isn't good enough for me >.<

 

The 'render to texture' routine is just this:

Create & Set a new buffer.

Draw some stuff using 2d commands.

Use GetColorBuffer to get the TTexture.

Free the buffer.

 

Is there any faster way of doing 'render to texture' than this?

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Well, I can't create the buffers before since I don't know how many windows etc there's gonna be :)

Does GetBufferColor save the buffers current state as a texture or does the texture change if I change the buffer afterward?

If it saves the current state then perhaps I can just use 1 buffer and resize it, if that's possible.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Local Buffer:TBuffer = CreateBuffer( W, H, BUFFER_COLOR )
SetBuffer( Buffer )
SetColor( Vec4( 1, 1, 1, 0 ) )
ClearBuffer()
SetColor( Vec4( 1 ) )

'DRAW STUFF HERE!

Texture = GetColorBuffer( Buffer )
SetBuffer( BackBuffer() )
Buffer = Null

 

Here's the 'Render to Texture' routine I'm using.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

I free the buffer as soon as I've used GetColorBuffer to get the texture, well atleast I nullify it.

I'm just using the buffer for the render to texture, and then I draw the Texture so I'm not using alot of buffers :)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

The problem is that the windows are of different sizes etc, if there's a way to resize a buffer it'd be possible! ^^

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...