Gandi Posted September 12, 2010 Share Posted September 12, 2010 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) Quote Link to comment Share on other sites More sharing options...
Rick Posted September 12, 2010 Share Posted September 12, 2010 What are you planning and why do you want to use a different buffer for each component? That seems like it could end up being a ton of buffers. I'm just wondering what advantage you would gain from that? Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 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... Quote 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 More sharing options...
Gandi Posted September 12, 2010 Author Share Posted September 12, 2010 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 and yes that would be a bunch of buffers.. thats why im asking € @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? Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 € @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... you can get around it if you use a non-framework render(), which might not effect what you are doing at all... Quote 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 More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 €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... Quote 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 More sharing options...
Gandi Posted September 12, 2010 Author Share Posted September 12, 2010 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 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. Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 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... Quote 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 More sharing options...
Gandi Posted September 12, 2010 Author Share Posted September 12, 2010 I'm just gonna give it a try.. also gonna try to Free the buffers everytime after painting all childs gonna get interresting Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 I'm just gonna give it a try.. also gonna try to Free the buffers everytime after painting all childs gonna get interresting yeah that will work as long as you dont need those buffers any more... Quote 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 More sharing options...
Gandi Posted September 12, 2010 Author Share Posted September 12, 2010 Ok, i think i got a pretty nice solution now (i hope creating and freeing buffers aint take too much performance) I create the buffer, render the component, render the buffer to the main window and then free the buffer. Quote Link to comment Share on other sites More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 I assume that you are using a separate render and not the main loop's render()... does the buffer get created each time you create a new component? curious if you are seeing any pausing when doing this... Quote 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 More sharing options...
Gandi Posted September 12, 2010 Author Share Posted September 12, 2010 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?? Quote Link to comment Share on other sites More sharing options...
Flexman Posted September 12, 2010 Share Posted September 12, 2010 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. Quote 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 More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 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. Quote 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 More sharing options...
Flexman Posted September 12, 2010 Share Posted September 12, 2010 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. Quote 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 More sharing options...
macklebee Posted September 12, 2010 Share Posted September 12, 2010 Let me know how it ends up working for you... I am curious what you end up using as a workaround. Quote 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 More sharing options...
Recommended Posts
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.