Commit db6ef665 authored by Allison Vacanti's avatar Allison Vacanti

Teach EDLShading about viewports.

parent cd9a3df5
......@@ -52,6 +52,8 @@ Ph.D. thesis of Christian BOUCHENY.
// ----------------------------------------------------------------------------
vtkDepthImageProcessingPass::vtkDepthImageProcessingPass()
{
this->Origin[0] = 0;
this->Origin[1] = 0;
this->Width = 0;
this->Height = 0;
this->W = 0;
......@@ -172,12 +174,15 @@ void vtkDepthImageProcessingPass::ReadWindowSize(const vtkRenderState* s)
vtkRenderer *r = s->GetRenderer();
if(fbo==nullptr)
{
r->GetTiledSize(&this->Width,&this->Height);
r->GetTiledSizeAndOrigin(&this->Width, &this->Height,
&this->Origin[0], &this->Origin[1]);
}
else
{
int size[2];
fbo->GetLastSize(size);
this->Origin[0] = 0;
this->Origin[1] = 0;
this->Width=size[0];
this->Height=size[1];
}
......
......@@ -101,6 +101,7 @@ public:
*/
void ReadWindowSize(const vtkRenderState* s);
int Origin[2]; // Viewport origin
int Width; // parent window width
int Height; // parent window height
int W; // this width
......
......@@ -647,11 +647,15 @@ bool vtkEDLShading::EDLCompose(const vtkRenderState *,
// IMPORTANT : so that depth information is propagated
glDisable(GL_SCISSOR_TEST);
this->EDLHighShadeTexture->CopyToFrameBuffer( 0, 0,
this->W - 1 - 2 * this->ExtraPixels,
this->H - 1 - 2 * this->ExtraPixels, 0, 0,
this->Width, this->Height,
prog, this->EDLComposeProgram.VAO );
int blitSize[2] = { this->W - 1 - 2 * this->ExtraPixels,
this->H - 1 - 2 * this->ExtraPixels };
this->EDLHighShadeTexture->CopyToFrameBuffer(
this->ExtraPixels, this->ExtraPixels,
blitSize[0], blitSize[1],
this->Origin[0], this->Origin[1],
this->Origin[0] + blitSize[0], this->Origin[1] + blitSize[1],
prog, this->EDLComposeProgram.VAO);
// FREE ALL
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment