incorrect cubic texture sampling on iphone

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

incorrect cubic texture sampling on iphone

Post by blackmonster »

Hi all.
I have discovered the strange behaviour of ogre's cubic texture generation.

Code: Select all

OgreFramework::getSingletonPtr()->m_pSceneMgr->setSkyBox(true, "Examples/MorningCubeMap");
When i run that code on iphone Simulator i got the propper skybox:
Screen shot 2011-06-07 at 12.10.53 AM.png
But in case of running on the device the skybox textures seems to be scaled and repeated:
IMG_0550.PNG
I noticed that when was applying image-based ligting effect.
Could anybody please explain me how to fix it?

Regards, Victor
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

What version of Ogre is this? What device? What OS?
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

Re: incorrect cubic texture sampling on iphone

Post by blackmonster »

Ipod 4G, iOS4.3.3, ogre 1.8, Render == OpenGL ES 2.0
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

Did you turn on the viewport orientation support by any chance?
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

Re: incorrect cubic texture sampling on iphone

Post by blackmonster »

Yes, the orientation change is supported. But the problem is that cubemap works differently on device and sim in both orientations
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

Yeah, turn off that option. It is no longer needed in 1.8.
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

Re: incorrect cubic texture sampling on iphone

Post by blackmonster »

You mean to disable the notification observer for orientation changing notifications or something else?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

I mean, the option OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATION in CMake.
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

Re: incorrect cubic texture sampling on iphone

Post by blackmonster »

It is already disabled

Code: Select all

An exception has occurred: OGRE EXCEPTION(9:UnimplementedException): Setting Viewport orientation mode is not supported in setOrientationMode at /Users/heavy/SDK/ogre_last/ogre/OgreMain/src/OgreViewport.cpp (line 226)
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

ok. can you write up a bug? Maybe with some example code to repro the issue?
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

Re: incorrect cubic texture sampling on iphone

Post by blackmonster »

i have created a project from ogre's template for iphone in xcode.

Code: Select all

OgreFramework::getSingletonPtr()->m_pSceneMgr->setSkyBox(true, "Examples/MorningCubeMap",10000);
and only changed the material for skybox to "Examples/MorningCubeMap"

I changed the render to GLES 2.0 and set up the shader system

Then I run the project on sim and on the device. Got the images posted above
blackmonster
Halfling
Posts: 55
Joined: Tue May 17, 2011 11:20 am
x 1

Re: incorrect cubic texture sampling on iphone

Post by blackmonster »

I found the strange relation between default mitmap level value and appearence of cubemap. The images i posted above are nothing else than full mipmapped texture streched and scaled to fit the side if a skybox.

When I disabled the mipmapping by

Code: Select all

Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(0);
the skybox began to render correctly on the device too. But disabling the mipmapping could not be the solution in case of great memory overhead
I think that filtering param in material script that manages the mipmapping level seems to be ignored by the script compiller.
I used

Code: Select all

filtering point point none
to set the point filtration and to disable the mipmapping of curernt texture, but got the point-filtered thextures and full mipmap texture. I'm continuing the investigation. Could anybody help me with it?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

It's strange. I tried to reproduce this using the CameraTracking sample but was unable to. Maybe it's something specific to the template demo.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: incorrect cubic texture sampling on iphone

Post by d000hg »

I was trying to find out what OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATION was for and found this thread. I see it's not needed any more but is it supported or will it be removed completely in future?

What did it do?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: incorrect cubic texture sampling on iphone

Post by masterfalcon »

It was a stopgap feature to enable orientation changes. The reason being that at the time Apple did not recommend using a view controller for performance reasons, but have since resolved the issue. It's staying in for now in case it's useful on other platforms.
Post Reply