[2.1] access workspace in HlmsListener's preparePassBuffer

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
rujialiu
Goblin
Posts: 242
Joined: Mon May 09, 2016 8:21 am
x 24

[2.1] access workspace in HlmsListener's preparePassBuffer

Post by rujialiu » Fri Nov 16, 2018 5:03 am

Hi!

I added some additional infomation in PassBuffer via HlmsListener's preparePassBuffer() function. It works, but I need to write different information for different workspaces. I don't think I can distinguish workspaces in my app's logic because those workspaces are executed in the same frame (e.g. one for displaying, one for background video recording but with a different camera).

Ideally, I need to read a unique identifier of the workspace (is there any?), but if I can't distinguish all workspaces for the same WorkspaceDef, it's ok to read workspacedef's name in preparePassBuffer(), because I can duplicate the workspacedef in the .compositor file, and use different workspacedefs when creating those workspaces.

What is the recommended way to do this? Thanks!
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4153
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 274
Contact:

Re: [2.1] access workspace in HlmsListener's preparePassBuffer

Post by dark_sylinc » Fri Nov 16, 2018 5:56 am

You should have access to CompositorPass via SceneManager::getCurrentCompositorPass.
From there you should be able to obtain everything (ie. parent pointers, associated definition, etc).

Cheers
0 x

rujialiu
Goblin
Posts: 242
Joined: Mon May 09, 2016 8:21 am
x 24

Re: [2.1] access workspace in HlmsListener's preparePassBuffer

Post by rujialiu » Fri Nov 16, 2018 6:37 am

dark_sylinc wrote:
Fri Nov 16, 2018 5:56 am
You should have access to CompositorPass via SceneManager::getCurrentCompositorPass.
From there you should be able to obtain everything (ie. parent pointers, associated definition, etc).
Thanks!
0 x

Post Reply