   Texturing best practices
  I've got a few questions regarding texturing in OpenGL about which I'd be more than happy to hear your opinions about:1) D3D has a RUNTIME that manages video memory. OpenGL doesn't have a runtime to transparently manage video memory so it's either the driver or the application's job to manage that. The advantage of VBOs over VAOs is that Vertex Buffer Objects put this burden on the driver and ease the job of application programmers. Do we have a similar concept in texturing? Does the driver already manage textures and gives them priorities and such without the need for any newer extension or is this feature enabled by using some extension? 2) How can I access mip levels of a texture without crossing the bus? Are PBOs the right tool here, or should I look into some other extensions?3) Any general advice on texturing best practices? Any lessons you learned the hard way that you wish you had known beforehand?Thanks in advance   
Quote:Original post by Ashkan1) D3D has a RUNTIME that manages video memory. OpenGL doesn't have a runtime to transparently manage video memory so it's either the driver or the application's job to manage that. The advantage of VBOs over VAOs is that Vertex Buffer Objects put this burden on the driver and ease the job of application programmers. Do we have a similar concept in texturing? Does the driver already manage textures and gives them priorities and such without the need for any newer extension or is this feature enabled by using some extension? The driver will always manage textures for you, unless you explicitely want to do it manually.Quote:Original post by Ashkan2) How can I access mip levels of a texture without crossing the bus? Are PBOs the right tool here, or should I look into some other extensions?Define 'access'. Read to CPU ? Render to ? Write from CPU ? Set as source ?Quote:Original post by Ashkan3) Any general advice on texturing best practices? Any lessons you learned the hard way that you wish you had known beforehand?Other than the usual things (always mipmap, don't use anisotropic if not needed, larger / higher bitdepth textures are slower, compress them if possible), basic texturing is very straightforward. There's not too much you can do wrong here.The harder texture related issues come in conjuction with shaders (projective access, seamless cubemaps, stable differential coordinates, etc).;  Thanks Yann, always a pleasure to get answers from you [wink]Quote:Define 'access'. Read to CPU ? Render to ? Write from CPU ? Set as source ?Read to CPU and Write to CPU needs bus crossing I guess. "Render to" and "source" I'm not sure what extensions to use to achieve the best performance. Doesn't hurt to know your opinions on all four though.Thanks again   ;Quote:Original post by AshkanRead to CPU and Write to CPU needs bus crossing I guess. Yep. PBOs are the best option for this. On PCIe, the performance is surpringly good even for readbacks.Quote:Original post by Ashkan"Render to" and "source" I'm not sure what extensions to use to achieve the best performance.For rendering to a texture, EXT_framebuffer_object is the best. You can use this extension to render to individual mipmap levels, if you want. It also defines a new entry point that will let you auto-generate mipmap  levels on demand.For rendering, well, use the standard rendering functions. There are several different ways if you want to manually access individual mipmap levels (Texture LOD control or texture2DLod in a GLSL shader from version 1.2 on, LOD bias is also an option but doesn't allow direct mipmap level control).;  Thanks.Quote:For rendering to a texture, EXT_framebuffer_object is the best. You can use this extension to render to individual mipmap levels, if you want. It also defines a new entry point that will let you auto-generate mipmap levels on demand.This question is not related to the original one, but I give it a shot. I'm wondering whether FBOs automatically take care of rescaling, since I remember seeing a piece of code that used FBOs to rescale textures as part of a copy operation in case source and destination were of different size. Is this possible with PBOs? Are there any copy operations that does the rescaling as a side effect?Regards   ;  Bump...Any helps regarding driver assisted "copy and rescale" functions?   