Offscreen rendering: doing a little better

Hi,

I would be happy to get a couple of opinions on my previous post, but in the act of desperation, I started everything from scratch working from the PBDemo posted by Ken Russell or GKW - sorry don’t remember.

It now kind of works (not really). Here are the problems.

  1. I seem to be limited to powers of 2 for sizes. I seem to recall from previous posts that this may not need to be the case. Is this so? Does it depend on my video card? Are there plans to change that? (Java3D - something I’ve been using, but grown to dread - does not have this limitation.)

  2. My second, more significant problem is summarized on the following page:

http://www.geocities.com/dolachin/offscreen.html

Basically, something goes very wrong at higher resolutions.

Once again, thank you for all the help.

Dola

You are limited to powers of two textures on all but nvidia cards. As soon as your video card supports the ARB nonpower of two textures, it can quickly be added to jogl. I don’t know what to tell you about your other problem. I have never had my offscreen images corrupted.

In the future, will there be a pure software solution? Seems like there ought to be one. (BTW, how does Java3D do it?)

The way to get arbitrarily sized textures on top of a pow-2 graphics card is to make a big pow-2 texture and to pack several (to save space) non pow-2 textures into it.

Search the web for “light map packing”. This link may be of some help: http://www.blackpawn.com/texts/lightmaps/default.html. I have implemented a similar scheme (in C++ DirectX, sorry).

Since you are dealing with a tree data structure, it can clutter code a bit. It is best to encapsulate this texture packing scheme so that you don’t have to worry about it after implementing it once.

from,
Stefan

There won’t be a software solution unless you can find a driver that supports it. Maybe mesa? I would expect ATI to provide the ARB extension in their next major driver release. In the mean time you can generate a pbuffer that is large enought to render your image and programatically eliminate the unused areas of you image.