RTT Problems in OSX

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
hagenkaiser
Kobold
Posts: 33
Joined: Tue May 01, 2007 11:21 am

RTT Problems in OSX

Post by hagenkaiser » Sun Oct 14, 2007 11:51 am

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?
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Sun Oct 14, 2007 5:10 pm

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.
0 x

hagenkaiser
Kobold
Posts: 33
Joined: Tue May 01, 2007 11:21 am

Post by hagenkaiser » Sun Oct 14, 2007 7:01 pm

Well johnj who is devloping pagedgeometry told me he thinks that this must be an osx problem. As hes not supporting OSX directly anymore, I wanted to find the possible bug myself.
will work a little bit with it and tell if i find something
0 x

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Sun Oct 14, 2007 10:11 pm

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).
0 x

starbug
Halfling
Posts: 56
Joined: Wed Jan 24, 2007 7:06 pm
Location: Germany

Post by starbug » Fri Oct 19, 2007 8:47 am

When I tried PagedGeometry about two months ago everything worked fine, so it must be something with the changes made since then, or maybe the latest OSX update (10.4.10).

Don't know if this information is worth anything though :wink:
0 x

hagenkaiser
Kobold
Posts: 33
Joined: Tue May 01, 2007 11:21 am

Post by hagenkaiser » Fri Oct 19, 2007 4:32 pm

could anyone else reproduce this problem now?
0 x

Paladi
Kobold
Posts: 32
Joined: Mon Nov 19, 2007 6:24 pm

Post by Paladi » Wed Dec 12, 2007 8:01 pm

I'm trying a simple RTT on OSX 10.5.1 and always when I run the rendertarget->update() the program crashes.

It could be that problem?
0 x

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Wed Dec 12, 2007 8:06 pm

Paladi, does it work in the Ogre examples?
0 x

Paladi
Kobold
Posts: 32
Joined: Mon Nov 19, 2007 6:24 pm

Post by Paladi » Wed Dec 12, 2007 8:11 pm

The render to texture demo on the samples works fine.

But, that samples doesn't update the target manually, they load the texture on a material.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Wed Dec 12, 2007 8:29 pm

The RTT is still updated with the update() method, it's just done automatically. At what point are you calling this update() method?
0 x

Paladi
Kobold
Posts: 32
Joined: Mon Nov 19, 2007 6:24 pm

Post by Paladi » Thu Dec 13, 2007 11:37 am

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
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Thu Dec 13, 2007 10:56 pm

You need to make sure it's not happening in parallel with some other render, if this is a threaded system.
0 x

Paladi
Kobold
Posts: 32
Joined: Mon Nov 19, 2007 6:24 pm

Post by Paladi » Fri Dec 14, 2007 6:52 pm

This is not a threaded system.

I will try the code in a linux or wndows system.
0 x

Paladi
Kobold
Posts: 32
Joined: Mon Nov 19, 2007 6:24 pm

Post by Paladi » Sat Dec 15, 2007 12:01 am

I have tried the same program (except the Qt GUI) in windows and it works!

is possible that the Qt interface produces problems on the RTT function? or... it's a OSX problem?

Thanks,
Adrià
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Sun Dec 16, 2007 7:04 pm

I'm involved in a project which uses Qt right now and makes extensive use of render textures, and we don't have this problem, but this is on Windows right now. So it sounds like it's the combination of Qt and OSX?
0 x

Paladi
Kobold
Posts: 32
Joined: Mon Nov 19, 2007 6:24 pm

Post by Paladi » Sun Dec 16, 2007 7:29 pm

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 :

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); 
And .. When I want to update the texture I execute :

Code: Select all

rrTex -> update();
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à
1 x

starbug
Halfling
Posts: 56
Joined: Wed Jan 24, 2007 7:06 pm
Location: Germany

Post by starbug » Sun Dec 30, 2007 3:08 pm

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); 
You can't use screen-size textures in OSX, or at least I have never seen it work. Dimensions always have to be 2^x.

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.
0 x

golgobot
Gnoblar
Posts: 18
Joined: Tue Oct 03, 2017 11:26 pm

Re: RTT Problems in OSX

Post by golgobot » Thu Oct 19, 2017 9:33 pm

Hey, I'm still able to reproduce this crash on OSX. Has anyone solved this issue or is it still a bug?

Thanks
0 x

Post Reply