Multiple Techniques with iOS and Ogre 1.9

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Multiple Techniques with iOS and Ogre 1.9

Post by Carlyone » Mon Feb 03, 2014 8:58 pm

Hello,
I am currently attempting to make use of the schemes in the ogre materials.

I have setup the viewports to switch between the material schemes and added the scheme into the RTShaders handleSchemeNotFound method.
However the model just disappears when I switch it from the default to "Wireframe" as I've called it.

The material looks like this:

Code: Select all

material 1391436092_2_Translucent_Glass_Gold
{
  technique
  {
    scheme Default
    pass
    {
      scene_blend alpha_blend
      depth_check on
      depth_write off
      ambient 0.0 0.0 0.0 0.600000023841858
      diffuse 0.0313725490196078 0.788235294117647 0.945098039215686 0.600000023841858
      specular 0.0 0.0 0.0 0.600000023841858 0.0
      emissive 0.0 0.0 0.0 1.0
      // texture size: 24.0, 24.0
      texture_unit
      {
        texture 1391436092_1_Translucent_Glass_Tinted.jpg
      }
    }
  }
  technique
  {
    scheme Wireframe
    pass
    {
      ambient 0.8078431372549 0.86274509803922 0.15294117647059
      diffuse 0.8078431372549 0.86274509803922 0.15294117647059
      polygon_mode wireframe
    }
  }
}
It seems that the second technique is never parsed, I added a listener to the resources and on resourceComplete there is only one technique on the resource.

Have I missed something?

Hoping it's something simple

Carl
Last edited by Carlyone on Tue Feb 04, 2014 4:35 pm, edited 1 time in total.
0 x

Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Re: Multiple Techniques with iOS and Ogre 1.9

Post by Carlyone » Tue Feb 04, 2014 4:27 pm

Update:
Ok the resource does parse correctly, I checked it further up the chain in my Ogre::MaterialManager::Listener in the handleSchemeNotFound method and there are definitely two supported techniques.

The model is still completely disappearing when switched to the "Wireframe" viewport material scheme and that has me stumped.

Any ideas?

Kind Regards

Carl
0 x

simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm

Re: Multiple Techniques with iOS and Ogre 1.9

Post by simedj » Tue Feb 04, 2014 11:36 pm

If you're using RTSS have you logged what the created techniques look like? I use Ogre::MaterialSerializer so I can see what RTSS has done since it gets a bit confusing for me to keep track of :)
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Re: Multiple Techniques with iOS and Ogre 1.9

Post by Carlyone » Wed Feb 05, 2014 10:18 am

Hi,
Thanks for the response.
I have created a subclass of Ogre::MaterialSerializer::Listener but I'm not really sure how I go about adding it to the material serialiser, I read the comments in the code but it's still not really clear. Would you mind providing a bit of guidance on adding the listener?

Kind Regards

Carl
0 x

simedj
Goblin
Posts: 262
Joined: Fri Nov 18, 2011 6:50 pm

Re: Multiple Techniques with iOS and Ogre 1.9

Post by simedj » Sat Feb 22, 2014 2:57 pm

I don't use a Listener. I just iterate over the materials in the MaterialManager a bit like this:

Code: Select all

        Ogre::MaterialSerializer sNew;
        for(Ogre::MaterialManager::ResourceMapIterator it = Ogre::MaterialManager::getSingleton().getResourceIterator();it.hasMoreElements();)
        {
            Ogre::MaterialPtr m = it.getNext().staticCast<Ogre::Material>();
            sNew.queueForExport(m);
        }
        sNew.exportQueued(<your path>);
0 x
Looking to find experienced Ogre & shader developers/artists. PM me with a contact email address if interested.

Post Reply