RTT Problems in OSX
-
- Kobold
- Posts: 33
- Joined: Tue May 01, 2007 11:21 am
RTT Problems in OSX
I watched this problem the first time i tried to use the pagedgeomtry source on OSX. But I think this problem is a general OSX-Problem.
In this source there a parts of scene rendered to a texture. The texure is then written to an image - file.
The problem is. Those files appear to be corrupted by total noise.
I insprected the code and I couldnt find an error. The renderTarget should get cleared (by autocleareveryframe) and then the scen is rendered (by update)
I know there are working examples of rendering to a texture on OSX. And they work for me as well. But they are all using a projective camera.
maybe somone knows a hint?
In this source there a parts of scene rendered to a texture. The texure is then written to an image - file.
The problem is. Those files appear to be corrupted by total noise.
I insprected the code and I couldnt find an error. The renderTarget should get cleared (by autocleareveryframe) and then the scen is rendered (by update)
I know there are working examples of rendering to a texture on OSX. And they work for me as well. But they are all using a projective camera.
maybe somone knows a hint?
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Whether the RTT is used by a projective camera later or not doesn't affect the actual rendering of them. So if you have examples that work there must be some difference.
Check what RTT mode you're using. 'Copy' mode for example can't render to RTTs that are bigger than the main render window in any dimension, only PBO or FBO can.
Check what RTT mode you're using. 'Copy' mode for example can't render to RTTs that are bigger than the main render window in any dimension, only PBO or FBO can.
-
- Kobold
- Posts: 33
- Joined: Tue May 01, 2007 11:21 am
-
- OGRE Expert User
- Posts: 975
- Joined: Thu Aug 04, 2005 4:14 am
- Location: Santa Clara, California
- x 4
I'm not sure what's going on, but since the PagedGeometry impostor renderer works fine in all DX9 and OpenGL (all RTT modes), I assumed it's either a driver or an OS issue.
The problem could be related to the fact that PagedGeometry renders about 32 different times to the same render texture, using different viewport coordinates (to produce several rows and columns of images, all rendered from various angles).
The problem could be related to the fact that PagedGeometry renders about 32 different times to the same render texture, using different viewport coordinates (to produce several rows and columns of images, all rendered from various angles).
-
- Halfling
- Posts: 56
- Joined: Wed Jan 24, 2007 7:06 pm
- Location: Germany
-
- Kobold
- Posts: 33
- Joined: Tue May 01, 2007 11:21 am
-
- Kobold
- Posts: 32
- Joined: Mon Nov 19, 2007 6:24 pm
- x 1
-
- OGRE Retired Moderator
- Posts: 2060
- Joined: Thu Feb 26, 2004 12:11 am
- Location: Toronto, Canada
- x 3
-
- Kobold
- Posts: 32
- Joined: Mon Nov 19, 2007 6:24 pm
- x 1
-
- Kobold
- Posts: 32
- Joined: Mon Nov 19, 2007 6:24 pm
- x 1
I'm calling the update() method when the user click on a window (Those RTT is used for knowing the world coordinate of the point that the user mades the click, using a simple shader that writes the x,y,z coords on each texel).
I must have to call the update() method on the framestarted method?
Thanks
I must have to call the update() method on the framestarted method?
Thanks
-
- Kobold
- Posts: 32
- Joined: Mon Nov 19, 2007 6:24 pm
- x 1
-
- Kobold
- Posts: 32
- Joined: Mon Nov 19, 2007 6:24 pm
- x 1
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
-
- Kobold
- Posts: 32
- Joined: Mon Nov 19, 2007 6:24 pm
- x 1
I have tried the code witouth the Qt GUI on OSX and it also crashes. But, the Render To Texture Ogre Demo works fine for me.
Here I have modified the CameraTrack demo, after the scene creation I create the texture :
And .. When I want to update the texture I execute :
And in the update method it crashes.
In windows the same code works. There are something wrong in the code?
I think it would be a OSX problem... Probably this week I will try on Linux.
Thanks,
AdriÃ
Here I have modified the CameraTrack demo, after the scene creation I create the texture :
Code: Select all
PixelFormat pixfmt = PF_FLOAT32_RGB;
TexturePtr depthTexture = TextureManager::getSingleton().createManual("coord", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,TEX_TYPE_2D,mWindow->getViewport(0)->getActualWidth(), mWindow->getViewport(0)->getActualHeight(),0, pixfmt, TU_RENDERTARGET);
RenderTarget *rrTex = depthTexture->getBuffer()->getRenderTarget();
rrTex->setAutoUpdated(false);
Camera* massDropletCam = mSceneMgr->createCamera("debugMassDropletCam");
massDropletCam->setNearClipDistance(mCamera->getNearClipDistance());
massDropletCam->setFarClipDistance(mCamera->getFarClipDistance());
massDropletCam->setAspectRatio((Real)mWindow->getViewport(0)->getActualWidth()/(Real)mWindow->getViewport(0)->getActualHeight());
massDropletCam->setNearClipDistance(mCamera->getNearClipDistance());
massDropletCam->setOrientation(mCamera->getOrientation());
massDropletCam->setPosition(mCamera->getPosition());
Viewport *v = rrTex->addViewport(massDropletCam);
v->setClearEveryFrame(true);
v->setBackgroundColour(Ogre::ColourValue::Black);
v->setOverlaysEnabled (false);
Code: Select all
rrTex -> update();
In windows the same code works. There are something wrong in the code?
I think it would be a OSX problem... Probably this week I will try on Linux.
Thanks,
AdriÃ
-
- Halfling
- Posts: 56
- Joined: Wed Jan 24, 2007 7:06 pm
- Location: Germany
Code: Select all
TexturePtr depthTexture = TextureManager::getSingleton().createManual("coord", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,TEX_TYPE_2D,mWindow->getViewport(0)->getActualWidth(), mWindow->getViewport(0)->getActualHeight(),0, pixfmt, TU_RENDERTARGET);
As far as I know Ogre should convert texture sizes to 2^x if non-power-of-two textures are not supported, but somehow it doesn't do this on OSX.
-
- Gnoblar
- Posts: 18
- Joined: Tue Oct 03, 2017 11:26 pm
Re: RTT Problems in OSX
Hey, I'm still able to reproduce this crash on OSX. Has anyone solved this issue or is it still a bug?
Thanks
Thanks