shader and object with ChildList

edited May 2013 in Help request
I have an object that consists of a list of other objects:

[Tank]

ChildList = TankRange
...

[TankRange]

Texture = pixel
...

At runtime I apply a shader when user clicks on the tank object (selection highlight). It works great when object is all by itself.

When I attached a range object to a ChildList I have found that shader is automatically applied to the range object as well. I can see how it can be useful in many cases. However in my case I would like not to apply the shader to the ChildList objects. Is there a way? Or should I consider some other path?


Thanks

Comments

  • edited May 2013
    Never mind. I think I figured it out.

    Scroll applies shader on object and its children:
    AddShader("SelectionShader");
    

    Orx applies shader only to the object specified:
    orxObject_AddShader(GetOrxObject(), "SelectionShader");
    
  • edited May 2013
    Indeed.

    There's no real connection per se at a shader level between objects in a hierarchy.
    However the ScrollObject method is recursive by default, as most of other ScrollObject methods are (SetAnim, SetColor, SetFlip, AddFX, ...):
    void AddShader(const orxSTRING _zShaderName, orxBOOL _bRecursive = orxTRUE);
    
Sign In or Register to comment.