Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending Tundra mainwindow over multiple displays causes graphical glitches on d3d9. #545

Open
msantala opened this issue Oct 11, 2012 · 11 comments

Comments

@msantala
Copy link
Contributor

  1. Start Tundra windowized
  2. Drag Tundra mainwindow to extend it to cover a second monitor
  3. Part of the render window on the original monitor becomes unusable
  4. Recover by resizing the window so that it's only located on the origal monitor

See http://i.imgur.com/3kvDO.png for example (spanning becan from right to left).

This happens only when using D3D9.

@msantala
Copy link
Contributor Author

Probably related to #457

@msantala
Copy link
Contributor Author

Seems that this starts to happen when the window is resized to exceed the screen resolution of the original screen the window is/was located on.

e.g. place window on a screen that has 1920px horizontal resolution, resize window so that it's partly on the other screen and it's width exceeds 1920px. Anything beyond 1920px is left unrendered or filled with graphical glitches.

Part of Ogre log:
Debug: Viewport for camera 'EC_Camera_1', actual dimensions 8192L: 0 T: 0 W: 1920 H: 623
Warning: Renderer::Render: Dirty rect 0,0 1921x624 not inside view 0,0 1921x623, correcting.

@Stinkfist0
Copy link
Contributor

Can build Tundra when ENABLE_DIRECTX is set to 0 in the root CMakeLists.txt and see what happens?

@jonnenauha
Copy link
Member

ENABLE_DIRECTX basically controls if we do subrect blitting or full blitting of the UI. It might actually work better with 0 when you get full blitting. It's slower but the rect blitting might be causing the UI layer to dissapear, I dont know about the actual scene rendering glitches though, setting 0 should not affect it.

@Stinkfist0
Copy link
Contributor

Interestingly, I cannot find the "Renderer::Render: Dirty rect..." warning log print anywhere in Renderer::Render.

@cadaver
Copy link
Member

cadaver commented Oct 11, 2012

This bug is due to Ogre's broken Direct3D9 multi-display support and device loss handling. Disabling creation of D3D devices per display should fix the problem, but it has to be checked if eg. CAVE continues to work properly.

@jonnenauha
Copy link
Member

@Stinkfist0 https://github.com/realXtend/naali/blob/tundra2/src/Core/OgreRenderingModule/Renderer.cpp#L701 its in the blitting. I made that code at some point. It adjusts the rect if its bigger than the actual qt viewport, if i remember right it crashed Tundra occasionally if the rect was bigger when the blit went to DX functions. Cant remember exactly though why I made that code to be honest.

Edit: Seems to have comment about it "// If graphics items are moved/animated outside the scene rect some dirty rect(s) can be outside the scene rect, check for it." and yeah animating widgets off screen crashed Tundra occasionally, this fixed it.

@Stinkfist0
Copy link
Contributor

@jonnenauha Ah, ok. I was looking the code in the LudoCraft/Tundra HEAD.

@msantala
Copy link
Contributor Author

It seems that the ogre renderwindow won't report sizes over the screen resolution of the original device (https://github.com/realXtend/naali/blob/tundra2/src/Core/OgreRenderingModule/Renderer.cpp#L497).
So that when viewport is actually 1950xsomething renderwindow only reports size of 1920xsomething on a monitor of resolution 1920x1080p.

The size of the renderwindow is in turn used to resize the dirty rect in here (https://github.com/realXtend/naali/blob/tundra2/src/Core/OgreRenderingModule/Renderer.cpp#L641).

This might cause part of the window to incorrectly not be set as dirty?

@Stinkfist0
Copy link
Contributor

If this a bug within Ogre, as @cadaver mentioned, it might be hard to work around it in the Tundra code, but please give it a shot, if you have the time.

@antont
Copy link
Member

antont commented Nov 10, 2012

I also encountered this -- luckily OpenGL indeed works well for this on Windows as well.

Possibly the newer dx10 and dx11 renderers have fixed this too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants