Bug: Compositor Texture References

Minor issues with the Ogre API that can be trivial to fix
Post Reply
donvitoni
Gnoblar
Posts: 1
Joined: Thu Mar 18, 2010 1:56 pm

Bug: Compositor Texture References

Post by donvitoni »

Hi everybody,

Problem: Textures that refer to other Textures in a CompositorsChain can not be fetch with CompositorInstance::getTargetForTex(const String &name)

Example (see below): Compositor CompA has a Texture CompATexture. Composior CompB has a Reference named RefToCompATexture to CompATexture.
CompositorInstance::getTargetForTex(const String &name) will throw an exception if i search for CompATexture in CompB, because it only looks after the name of the texture in reference compositors, not for the reference name

Code: Select all

compB->getTargetForTex("CompATexture"); // -> will succeed
compB->getTargetForTex("RefToCompATexture ");// -> throws exeption
Change: The changes for that where impl in Rev: 2f9cdde4bb45321ce6e2f8c3eca41aa990280efe . https://bitbucket.org/sinbad/ogre/chang ... 9cdde4bb45

A patch is here: https://sourceforge.net/tracker/?func=d ... tid=302997.

Code: Select all

compositor CompA
{
  technique
    {	
    texture CompATexture target_width target_height PF_R8G8B8A8 chain_scope

    target CompATexture
    {
      input none

      material_scheme some_fancy_stuff

      pass clear
      {
        clear
        {
          buffers colour depth
          colour_value 1 1 1 1
          depth_value 1.0
        }
      }

      pass render_scene
      {
      }
    }

    target_output
    {
      input none

      pass render_quad
      {
        material copy_buffer

        input 0 CompATexture
      }
    }
  }
}

compositor CompB
{
  technique
  {	
    texture_ref RefToCompATexture CompA CompATexture

    target_output
    {
      input none

      pass render_quad
      {
        material copy_buffer

        input 0 RefToCompATexture
      }
    }
  }
}
Post Reply