<div dir="ltr">Can anyone tell me how to proceed in a good way?<div><br></div><div>Report the bug? Where?</div><div><br></div><div>Kind Regards,</div><div>Benjamin<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 10, 2015 at 4:46 PM, Benjamin Hopfer <span dir="ltr"><<a href="mailto:greenb3ret@gmail.com" target="_blank">greenb3ret@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have a very weird problem with the render window. It only occurs if:<div><br><div> - vtkRenderer was set to display a background texture at least once since program start</div><div> - The background texture has a transformation (scaling for repeat)</div><div> - Depth peeling is enabled</div><div> - At least one transparent actor is displayed.</div><div><br></div><div>I'm pretty sure this is a bug, but I wanted to get your insight first, before reporting it.</div><div>I attached a minimal working example below. You can use any png file for texture.png. I used a 2x2 pixel PNG with (0,0) and (1,1) black and the other two white (checker board).</div><div><br></div><div>I have uploaded the output of the code: <a href="http://imgur.com/a/olUW2" target="_blank">http://imgur.com/a/olUW2</a></div><div><br></div><div> - The first image is the "expected" outcome, which I retrieved by disabling depth peeling ("renderer->SetUseDepthPeeling(1);" is commeted out)</div><div> - The second image is the outcome after running the example below unchanged</div><div> - The third image shows what happens if zooming is done. Basically, the scene is restricted to the left lower part.</div><div><br><div>It seems like the transformation of the texture is somehow also applied to the render window?</div><div><br></div><div>Any insights on this? (Im running vtk 6 on Windows 8.1)</div><div><br></div><div>Kind Regards,</div><div>Benjamin</div><div><br></div><div>8<--------------------------- Minimal example -----------------------------------------</div><div><div>#include <vtkActor.h></div><div>#include <vtkConeSource.h></div><div>#include <vtkNew.h></div><div>#include <vtkPNGReader.h></div><div>#include <vtkProperty.h></div><div>#include <vtkPolyData.h></div><div>#include <vtkPolyDataMapper.h></div><div>#include <vtkRenderer.h></div><div>#include <vtkRenderWindow.h></div><div>#include <vtkRenderWindowInteractor.h></div><div>#include <vtkSTLReader.h></div><div>#include <vtkTexture.h></div><div>#include <vtkTransform.h></div><div><br></div><div>int main(int argc, char** argv)</div><div>{</div><div> // Any texture will work. I use a 2 by 2 pixel checkerboard pattern</div><div> vtkNew<vtkPNGReader> pngReader;</div><div> pngReader->SetFileName("texture.png");</div><div> pngReader->Update();</div><div><br></div><div> // Setting up the texture</div><div> // IMPORTANT: Without a transformation on the texture, the bug will not occur.</div><div> // (You can turn of texture repeating, but I transform to have a repeating texture)</div><div> vtkNew<vtkTexture> texture;</div><div> texture->SetInputConnection(pngReader->GetOutputPort());</div><div> texture->SetRepeat(true);</div><div><br></div><div> vtkNew<vtkTransform> trans;</div><div> trans->Scale(2.0, 3.0, 1.0);</div><div> texture->SetTransform(trans.Get());</div><div><br></div><div> // Adding a transparent cone. Any geometry will work.</div><div> // IMPORTANT: If the geometry is not transparent, the bug will not occur</div><div> vtkNew<vtkConeSource> coneSrc;</div><div> vtkNew<vtkPolyDataMapper> coneMapper;</div><div> coneMapper->SetInputConnection(coneSrc->GetOutputPort());</div><div> vtkNew<vtkActor> coneActor;</div><div> coneActor->SetMapper(coneMapper.Get());</div><div> coneActor->GetProperty()->SetOpacity(0.5);</div><div><br></div><div> // Create the renderer</div><div> // IMPORTANT: If depth peeling is not enabled, the bug will not occur.</div><div> vtkNew<vtkRenderer> renderer;</div><div> renderer->SetUseDepthPeeling(1);</div><div> renderer->TexturedBackgroundOn();</div><div> renderer->SetBackgroundTexture(texture.Get());</div><div> renderer->AddActor(coneActor.Get());</div><div><br></div><div> // Create the render window</div><div> // IMPORTANT: If AlphaBitPlanes is off, the bug will not occur. (But no depth peeling either).</div><div> vtkNew<vtkRenderWindow> renderWindow;</div><div> renderWindow->AlphaBitPlanesOn();</div><div> renderWindow->AddRenderer(renderer.Get());</div><div><br></div><div> // Create the interactor and start up</div><div> vtkNew<vtkRenderWindowInteractor> renderInteract;</div><div> renderInteract->SetRenderWindow(renderWindow.Get());</div><div> renderWindow->Render();</div><div> renderInteract->Start();</div><div><br></div><div> return 0;</div><div>}</div></div></div></div></div>
</blockquote></div><br></div></div></div></div>