Page 1 of 1

[SOLVED] Strange render behaviour

Posted: Wed Apr 23, 2014 2:07 pm
by Transporter
Hi,

I've built a simple geometry to render in a test application.
Ogre render window
Ogre render window
screenshot04232014_140658265.png (43.63 KiB) Viewed 1195 times
Now I try to include the render in a subwindow of an application.

Code: Select all

		Ogre::NameValuePairList vpl;
		vpl["left"] = "0";
		vpl["top"] = "0";
		//vpl["parentWindowHandle"] = Ogre::String(buffer);
		vpl["externalWindowHandle"] = Ogre::String(buffer);
		mRenderWindow = mRoot->createRenderWindow("Test", rect.Width(), rect.Height(), false, &vpl);
The result is awful!
Ogre integrated in Win32 window
Ogre integrated in Win32 window
Untitled.png (36.94 KiB) Viewed 1195 times
Any idea how to fix it?

Re: Strange render behaviour

Posted: Wed Apr 23, 2014 3:33 pm
by dark_sylinc
This is Ogre 2.0 right?

It appears some problem with the camera (i.e. extremely far far plane or extremely close near plane) or just wrong selection of the depth buffer. Your log says there was a d3d device reset, if this always happens we could somehow end up sending a dangling depth buffer or similar.
Is the Log around to see?

Re: Strange render behaviour

Posted: Thu Apr 24, 2014 8:10 am
by Transporter
dark_sylinc wrote:This is Ogre 2.0 right?
Of course :D
dark_sylinc wrote:Your log says there was a d3d device reset, if this always happens we could somehow end up sending a dangling depth buffer or similar.
Yes, this always happens if the window is resized.

Code: Select all

09:07:00: Resize window to 1172x713
09:07:00: D3D9 Device 0x[0583E2E0] entered lost state
09:07:00: !!! Direct3D Device successfully restored.
09:07:00: D3D9 device: 0x[0583E2E0] was reset
Edit: I fixed it. You are right, this is a camera problem. If I use setNearClipDistance and setFarClipDistance it's working.