Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

Hi! I have almost the same routine, except I create all buffers befor main loop. And then in main loop I only set them and render. Maybe that is your problem.

Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64

3ds max / photoshop CS3 / C++

http://www.arbuznikov.com

Posted

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.

Posted

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.

Posted

There must be some way of speeding this up! >.<

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.

Posted

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.

Posted

I mean you can use one buffer for all windows. And try not to create and free buffer for each window. Just create it once and draw windows there. And clear it between window drawing (not free).

Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64

3ds max / photoshop CS3 / C++

http://www.arbuznikov.com

Posted

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.

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.

×
×
  • Create New...