Add support for tiled rendering. #1646
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added support for tiled rendering. It is controlled by 4 new fields in the renderer.
They are:
The default values are
true,optimized_tiles,1024and1024.The image tiling works by tiling the image with tiles using the specified tiling type.
When using square tiles, the tiles are all square with the last tiles in each row and in the bottom row being padded to fill the square tile. When using rectangular tiles, the tiles are all the same size with the last tiles in each row and the bottom row being padded fill the tile. When using horizontal strips, the strips fill the row and the last strip is padded to fill the strip. When using vertical strips, strips fill the column and the last strip is padded to fill the strip. When using optimized tiles, the width and height are used as a maximum and the size is chosen to minimize the amount of padding.
Viskores did not support pan or zoom in the ray tracer so I modified
build_ascent.shto add a patch to viskores that implements pan and zoom. Pan and zoom were implemented with the 3d axes annotations so I made the pan and zoom in the ray tracer match what was done with the 3d axes.I have tested tiling with the following pan and zoom values, which should cover the general case of pan and zoom values.
I tested this in all 5 modes with combinations of image widths and tile sizes that should cover all the different cases.
I currently have the tiled rendering explicitly turned off in my tests that I checked in since they would currently fail with the existing containers. Viskores needs to be rebuilt with the
ascent_build.shso that it is built with my patch applied. I need help with doing that with the docker container and then I can re-enable tiled rendering in the tests.I'm not sure about the defaults I've chosen. If you have thoughts on different ones, let me know. I think a larger tile width and height may be appropriate.
Here is a sample tiled image at 600x400 with a 256 tile size.
