Jump to content

Performance with many buffers


Gandi
 Share

Recommended Posts

Hi!

 

I'm currently working on a GUI-system and don't really know how LE would perform with a lot of buffers (a buffer for each component)

 

If that aint a good idea i think i'll have to write a litte shader for what im planning.

 

Another question: Is there a minimum size for buffers (i think i read something some time ago)

Link to comment
Share on other sites

Another question: Is there a minimum size for buffers (i think i read something some time ago)

 

well since like 2.32 or so, it was changed to where the buffer has to match at least the same size as the framework buffers or you get weird results and sometimes significant slowdowns when rendering those buffers... but if you are not using framework then you should be ok...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

the advantage would be, that components which are to big for its parents components dont get rendered out of the bounds of the parent.

 

a little picture:

black: parent

red: child

 

top: how i dont want it to be

bottom: how i want it to be

 

zeichnung836.jpg

 

and yes that would be a bunch of buffers.. thats why im asking :D

 

€ @macklebee: ok.. that sucks^^ as i wanted to render the text into buffers ( with freetype) because always rendering it with freetype seems to slow down everything a bit..

 

€2: or do you know a way for rendering an image to a specific size without stretching it?

Link to comment
Share on other sites

€ @macklebee: ok.. that sucks^^ as i wanted to render the text into buffers ( with freetype) because always rendering it with freetype seems to slow down everything a bit..

 

yeah i wasnt too happy about it either when it happened... especially since it was done just so someone could take a farking screenshot... :D

 

you can get around it if you use a non-framework render(), which might not effect what you are doing at all...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

€2: or do you know a way for rendering an image to a specific size without stretching it?

 

yeah just draw the image at the same fraction of the buffer dimensions for both width and height but it means that what you want your image to look like must have the same relative scale as the width and height of the buffer...

 

EDIT--- I mean the image must have the same width to height ratio as the buffer's width to height ratio...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

yeah just draw the image at the same fraction of the buffer dimensions for both width and height but it means that what you want your image to look like must have the same relative scale as the width and height of the buffer...

 

EDIT--- I mean the image must have the same width to height ratio as the buffer's width to height ratio...

 

i think you kinda missunderstood my problem :D

 

look at the picture. When my child component is badly placed, so it doesnt fit into the parent-component i want it to be rendered same size as usual, just it gets cut at the edge of the parent-container.

Link to comment
Share on other sites

ah ok... you would still have to use the same ratio as the texture itself to prevent it from stretching...

 

it doesn't appear to be too bad of a hit resource wise for the extra buffer... but its hard to say how many it will take until it affects you:

require("Scripts/constants/keycodes")
RegisterAbstractPath("")
Graphics(800,600)
fw=CreateFramework()
fw.main.camera:SetPositionf(0,0,-2)
SetBackgroundColor(Vec4(1,1,1,1))
material=LoadMaterial("abstract::cobblestones.mat")
mesh=CreateCube()
mesh:Paint(material)
ground=CreateCube()
ground:SetScalef(10.0,1.0,10.0)
ground:SetPositionf(0.0,-2.0,0.0)
ground:Paint(material)
light=CreateDirectionalLight()
light:SetRotationf(45,45,45)

parenttexture = LoadTexture("abstract::oildrum.dds")
childtexture = LoadTexture("abstract::locker.dds")
parentbuffer = CreateBuffer(TextureWidth(parenttexture),TextureHeight(parenttexture),1+2+4)

currentbuffer = CurrentBuffer()

function FlipHook() 
SetBuffer(parentbuffer)
DrawImage(parenttexture,0, 0, TextureWidth(parenttexture),TextureHeight(parenttexture))
DrawImage(childtexture,400, 100, TextureWidth(childtexture)/3,TextureHeight(childtexture)/3)
parentimage = GetColorBuffer(parentbuffer, 0)
SetBuffer(currentbuffer)
DrawImage(parentimage,200, 200, TextureWidth(parentimage)/1.5,TextureHeight(parentimage)/1.5)
end

while AppTerminate()==0 do

mesh:Turnf(AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5)

fw:Update()
fw:Render()

Flip(0)
end

 

EDIT-- changed to allow for the textures to not be stretched...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Atm im rendering every frame.. the system aint far atm..

 

but i got a problem now ..

 

I'm creating a .dll and .lib file and when including my classes from the dll i cant run any LE-commands anymore (guess it's another thread?)

anyone got an idea how i can get all my classes from the dll into main project??

Link to comment
Share on other sites

yeah i wasnt too happy about it either when it happened... especially since it was done just so someone could take a farking screenshot... <_<you can get around it if you use a non-framework render(), which might not effect what you are doing at all...

 

What's this about buffers and screenshots?

 

I have around 6 512x512 buffers for instruments and about to move to 2.40. This is not something I want to hear.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

What's this about buffers and screenshots?

 

I have around 6 512x512 buffers for instruments and about to move to 2.40. This is not something I want to hear.

 

... the renderer uses the current buffer instead of the back buffer to see if the rendering dimensions have changed. if Render() is called when the current buffer does not match the dimensions of the stored dimensions, the renderer will re-create the buffers at the new size. The reason this was done was so that the engine can render to buffers bigger than the desktop resolution.

 

This will effect you if you are using framework's render when you are using a camera to render to that custom buffer to be set as a model's material texture. You can get around it by setting the buffer to the same size as the graphics window or you can use a non-framework render() but then you lose out on any framework effects you were hoping to get on the display. This played havoc on mine and MG's cctv screen that was working just fine before this change.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

OK, I think I follow. I'm using one buffer to render a non framework camera to, and another camera which does a framework render. The other buffers use OpenGL commands. If it's something that's in Framework then maybe it can be 'retro fixed' since the BMX (always makes me think of bikes) is provided.

 

I'll have a go and see what happens anyway.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

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...