Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

GL scenes seem ill formatted #36

Closed
renoust opened this issue Feb 21, 2018 · 1 comment
Closed

GL scenes seem ill formatted #36

renoust opened this issue Feb 21, 2018 · 1 comment

Comments

@renoust
Copy link

renoust commented Feb 21, 2018

Hi,

While investigating view.state() I stumbled upon some strange behavior, as I was unable to translate the XML to objects.
In the current setting, I have some graph loaded, I'm opening a new NLD view, and get its state's scene (from python: view.state()['scene'], the below indentation is manually edited, I've added comments to highlight the issues).

<scene>
  <data>
    <viewport>(0,0,1807,1347)</viewport>
    <background>(255,255,255,255)</background>
  </data>

  <children>  <!-- HERE -->
    <GlLayer name="Background">  <!-- HERE -->

      <data>
        <camera>
          <data>
            <center>(80.679,85.743,0)</center>
            <eyes>(80.679,85.743,171.486)</eyes>
            <up>(0,1,0)</up>
            <zoomFactor>1</zoomFactor>
            <sceneRadius>171.486</sceneRadius>
            <d3>0</d3>
            <sceneBoundingBox0>(0,0,0)</sceneBoundingBox0>
            <sceneBoundingBox1>(128,128,0)</sceneBoundingBox1>
          </data>
        </camera>
        <visible>0</visible>
      </data>

      <GlEntity type="GlComposite">  <!-- close? -->
      <children>
      </children>
    </children>  <!-- HERE -->
    </GlLayer>  <!-- HERE -->

There seems to be an inversion of </children> and </GlLayer> here.
Would it be better to 'close' <GlEntity type="GlComposite"/> inline '/' or is the closing forgotten?

  <GlLayer name="Main">  <!-- HERE -->
    <data>
      <camera>
        <data>
          <center>(80.679,85.743,0)</center>
          <eyes>(80.679,85.743,171.486)</eyes>
          <up>(0,1,0)</up>
          <zoomFactor>1</zoomFactor>
          <sceneRadius>171.486</sceneRadius>
          <d3>1</d3>
          <sceneBoundingBox0>(0,0,-0.5)</sceneBoundingBox0>
          <sceneBoundingBox1>(161.358,171.486,171.486)</sceneBoundingBox1>
        </data>
      </camera>
      <visible>1</visible>
    </data>

    <GlEntity type="GlComposite">   <!-- close? -->
    
    <children>
      <GlEntity name="graph" type="GlGraphComposite">
        <data>
            <visible>1</visible>
            <stencil>65535</stencil>
         </data>
        </GlEntity>  
      </children> 

    </children>   <!-- HERE -->
  </GlLayer>   <!-- HERE -->

Here also, there seems to be an inversion of </children> and </GlLayer>.
The second GLEntity is closed, but should also the first one be better closed?

  <GlLayer name="Foreground">

    <data>
      <camera>
        <data>
          <center>(80.679,85.743,0)</center>
          <eyes>(80.679,85.743,171.486)</eyes>
          <up>(0,1,0)</up>
          <zoomFactor>1</zoomFactor>
          <sceneRadius>171.486</sceneRadius>
          <d3>0</d3>
          <sceneBoundingBox0>(0,0,-0.5)</sceneBoundingBox0>
          <sceneBoundingBox1>(161.358,171.486,171.486)</sceneBoundingBox1>
        </data>
      </camera>
      <visible>1</visible>
    </data>

      <GlEntity type="GlComposite">    <!-- close? -->
      <children>
        <GlEntity name="labrilogo" type="Gl2DRect">
          <data>
            <visible>0</visible>
            <stencil>1</stencil>
            <top>35</top>
            <bottom>85</bottom>
            <left>5</left>
            <right>55</right>
            <inPercent>0</inPercent>
            <textureName>TulipBitmapDir/logolabri.jpg</textureName>
            <xInv>0</xInv>
            <yInv>0</yInv>
          </data>
        </GlEntity>
      </children>

    </children>   <!-- HERE -->
  </GlLayer>

</children> <!-- HERE -->
</scene>

Finally I don't see where these </children> are attached to.

Could it have some other consequence?
Cheers,

p-mary added a commit that referenced this issue Feb 21, 2018
…lXMLTools::endChildNode by a "GlEntity" GlXMLTools::endChildNode
@p-mary
Copy link
Contributor

p-mary commented Feb 21, 2018

Thanks for your report.
This is a very old bug, which seemed to have no effect on the scene settings because the xml parsing uses a dedicated parser.

@p-mary p-mary closed this as completed Feb 21, 2018
p-mary referenced this issue in anlambert/talipot Jan 3, 2020
QOpenGL module is marked as deprecated since a while now so it is time
to remove its use from the Talipot codebase and promote the use of
QOpenGL* classes directly integrated in the QtGui module.

The big difference between QOpenGL and QtOpenGL from Qt5 is that all
rendering is performed in framebuffer objects, there is no more direct
rendering in the underlying os windows with its own OpenGL context.

Talipot OpenGL rendering also follows that idiom, all renderings are performed
offscreen using a shared OpenGL context. This also means that there is no
more QGLWidget as viewport for QGraphicsView. Talipot OpenGL scene are
now converted to QImage in order to display them using the default Qt raster
rendering engine. This should fixes the numerous rendering glitches observed
on MacOS.

First thing observed after the migration is a consequent performance boost
in OpenGL rendering when using an Intel GPU on a Linux host machine (especially
when selecting elements, it is now 10 times faster on debian stable).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants