Add initial support for per-tile nonlinear warping and edge blending #179
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.
Please review these changes as an initial working solution for doing per-tile warping and edge blending, to support projector based tiled displays.
The implementation resides mostly within DisplayContext, implemented with the RenderCorrection class interface and applies a warp and/or edge blending globally to the final frame buffers without affecting any cameras or renderer instances.
This is not as clean as I would like, but it seemed the safest path, rather than attempting to override the CameraOutput or Renderer listener interfaces which seem reserved for applications.
Also, the GpuBuffer class interfaces aren't used anywhere within the codebase, so I couldn't tell if these are legacy or stubs, since all proper applications seem to use OSG for geometry, etc. There seems to be widespread OpenGL calls throughout the codebase, even though there's some level of abstraction that seems to be designed to modularise the graphics API calls. So, I have to cringe, but practically, I found it necessary to call OpenGL directly within the RenderCorrection interfaces.
I haven't been able to do extensive testing on the various stereoscopic 3d modes, so apologies if the interlaced modes don't work as expected. Please take a look at these closely.
To test, please try the included test-warpblend.cfg config file, which shows the newly introduced config options:
To use, try:
./omegalib/build/bin/orun -L v -c system/test-warpblend.cfg ./sandbox/modules/sprite/demo.py
./omegalib/build/bin/oimg -c system/test-warpblend.cfg -L v -M stretch -f testimage.png