0

The coin3d offscreen rendering class SoOffscreenRenderer is capable of rendering big images (e.g. 4000 x 2000 pixels), that don't fit on the screen or in a rendering buffer. This is done by partitioning the image into tiles that are rendered one after the other, where the default size of these tiles is 1024 x 1024.

I looked at the code of SoOffscreenRenderer and CoinOffscreenGLCanvas and found environment variables COIN_OFFSCREENRENDERER_TILEWIDTH COIN_OFFSCREENRENDERER_TILEHEIGHT. I could change the tile size using these variables, but only to sizes smaller than 1024. I could create tiles with 512 x 512 pixels, and also 768 x 768. When I used values bigger than 1024, the resulting tiles were always of size 1024 x 1024.

Is it possible to use bigger tile sizes like 2048 x 2048 or 4096 x 4096, and how would I do that?

Sacha Guyer
  • 151
  • 17

1 Answers1

0

It is possible to use larger tiles and coin does it automatically. It will find out which tile sizes work by querying the graphics card driver.

From CoinOffscreenGLCanvas.cpp:

// getMaxTileSize() returns the theoretical maximum gathered from // various GL driver information. We're not guaranteed that we'll be // able to allocate a buffer of this size -- e.g. due to memory // constraints on the gfx card.

The reason why it did not work was that the environment variable COIN_OFFSCREENRENDERER_MAX_TILESIZE was set somewhere in our application using coin_setenv("COIN_OFFSCREENRENDERER_MAX_TILESIZE", "1024", 1);. Removing this call allowed bigger tile sizes to be used.

In CoinOffscreenGLCanvas::getMaxTileSize(void), the variable COIN_OFFSCREENRENDERER_MAX_TILESIZE is read and the tile size clamped accordingly.

On my older computer it generated tiles of size 1024, but on a newer machine the tiles were of size 4096.

Sacha Guyer
  • 151
  • 17