[osg-users] render to a texure bound to an FBO and re-generate mipmaps every frame

Robert Osfield robert.osfield at gmail.com
Tue Apr 10 13:06:10 PDT 2018


Hi Julius,

There isn't much we can do to help at this stage as you don't provide
any information about the hadware, OS, driver, OSG version, all we
know is that you are using a render to texture technique and there is
some issue with mipmapping and some unspecified hardware, OS and OSG
version.  We don't have your sofftware, data or hardware configuration
to test against.

It could be a driver bug, it could be a scene graph set up issue, it
could be a data problem, it could be an OSG  bug, at this stage that's
all anyone could say with the information provided.

The most productive way for others to help would be if you could
provide a small test program that illustrates the problem so that
others can run this test on their own systems to see if problem
appears, this then should shine more light on the nature of the
problem and give us a better chance of getting a solution.  Sometimes
issues like this turn out to hardware/driver/OS specific so wider
testing can show this.  If it's a OSG bug then we can then use this a
unit test for testing any fixes that will be made.

Failing a means to tests things ourselves, the only workaround I an
suggest is to not using mipmapping on the texture you are rendering
to.

Robert.



On 10 April 2018 at 20:45, Julius Ziegler <ziegler at atlatec.de> wrote:
> Dear OSG-friends,
>
> I currently have a scene graph set up where a pre-render camera renders
> content to a texture via an FBO, and the main camera uses this texture to
> texture a quad with it. This works, in principle.
>
> However I need mipmapping for that texture, and all but the 0th mipmap level
> of the texture are empty.
>
> With an apitracer, I found out that the glGenerateMipMap call happens
>
> 1. only in the first frame (but I want it to be called every frame).
> 2. before any draw calls towards the FBO (but I want it after the draw
> calls).
>
> I tried to inject a glGenerateMipMap via a DrawCallback which I attached to
> the quad, and which just extends the original draw implementation
> (glGenerateMipMap immediately before the original draw implementation).
>
> With the apitracer, I validated that, at the position where I injected the
> glGenerateMipMap
>
> a. the correct texture is bound
> b. the frame buffer is un-bound.
>
> But glGenerateMipMap just seg'faults. Because of the seg'fault (I mean we
> are all used to GL_ERRORS, but seg'faults?) I suspected a driver issue, but
> I tried it on an alternative platform (one is Intel Graphics, one is Nvidia,
> both on Linux). Both to the same result.
>
> Can you please help? Maybe I overlooked a simple osg-ish way to achieve this
> (maybe I just have to set something dirty()?)
>
> Thanks!
>
> Julius
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list