![]() |
|
Shared tag between SceneNode and RenderablePrimitiveBase - Printable Version +- AB4D Forum (https://forum.ab4d.com) +-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4) +--- Forum: Ab3d.DXEngine (https://forum.ab4d.com/forumdisplay.php?fid=11) +--- Thread: Shared tag between SceneNode and RenderablePrimitiveBase (/showthread.php?tid=4275) |
Shared tag between SceneNode and RenderablePrimitiveBase - janovrom - 08-20-2021 Hi, I've started writing my own rendering step to show normals using geometry shader and an OverrideEffect. It's working fairly well, except that I need to filter the objects. For that I am using FilterObjectsFunction in the rendering step. There I need to recognize the objects to show normals on (currently it's all using PBMaterial or MultiMapMaterial). That is easy to check, but I've noticed that RenderablePrimitiveBase has a property "Tag". This tag is always null so I was wondering how to populate this with a value (then it would be possible to filter the objects by anything I want - name, animations, selection etc.). I am using MeshObjectNode to render most of the objects and they also have property Tag (which I am using to set some data for raycasts and selection). Is it possible to somehow inherit the Tag from SceneNode to RenderablePrimitiveBase? I cannot use RenderQueue filtering since I cannot set an object into multiple queues and I cannot override MeshObjectNode to extend the method CollectRenderableObjects (it's sealed). Writing custom collection seems as an overkill as well. Thanks, Roman Janovsky RE: Shared tag between SceneNode and RenderablePrimitiveBase - abenedik - 08-20-2021 You can check the Tag on the MeshObjectNode inside your FilterObjectsFunction - for example: Code: private static bool FilterObjectsByTagFunction(RenderablePrimitiveBase renderablePrimitiveBase)RE: Shared tag between SceneNode and RenderablePrimitiveBase - janovrom - 08-23-2021 For some reason, the OriginalObject property is SceneNode only for lines, i.e. ScreenSpaceLineNode that is created from wire grid. All objects created from meshes have OriginalObject set to SimpleMesh<T>. |