[2.1] CompositorWorkspaceListener & Shadow Nodes

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Kaylx
Greenskin
Posts: 123
Joined: Sun May 22, 2011 10:45 pm
Location: Scotland
x 7

[2.1] CompositorWorkspaceListener & Shadow Nodes

Post by Kaylx »

Hi everyone,

I have some compositor workspace listeners setup that I only want to execute on passes that aren't part of a compositor shadow node.
I currently check the parent node name (pass->getParentNode()->getName() == ...) to see if it's the main render node but it doesn't feel right.
Is there better more generic way of checking for this?

Thanks,
Kaylx
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: [2.1] CompositorWorkspaceListener & Shadow Nodes

Post by dark_sylinc »

Hi!

Aside from the name, CompositorNodeDef contains mCustomIdentifier which is an arbitrary value to individually identify nodes.

Additionally/alternatively, you can look at CompositorPassDef::mExecutionMask which is used to prevent a pass from being executed (the mask is provided in CompositorManager2::addWorkspace).
You could theoretically pass a mask of 0xff addWorkspace (i.e. always execute) and use mExecutionMask to identify your passes.
User avatar
Kaylx
Greenskin
Posts: 123
Joined: Sun May 22, 2011 10:45 pm
Location: Scotland
x 7

Re: [2.1] CompositorWorkspaceListener & Shadow Nodes

Post by Kaylx »

Thanks for the help Matias,

I'll use mCustomIdentifier in CompositorNodeDef as I already do something similar with mIdentifier in CompositorPassDef. :)

Regards,
Kaylx
Post Reply