Rendering Selection Outline in Hydra w/ Storm?

Are we able to render selection outlines with Hydra and, specifically, Storm?

From the HdTaskController API, it seems like that should be possible with SetSelectionEnableOutline, but no matter what I do I can only see the selection as an overlaying color instead of the outline.

I set it as follows:

    task_controller->SetSelectionColor(pxr::GfVec4f(34.f / 255.f, 203.f / 255.f, 131.f / 255.f, .3f));
    task_controller->SetSelectionEnableOutline(true);
    task_controller->SetSelectionOutlineRadius(1);

but the selection still shows no outline, just the color itself:

Am I missing some setting or is it actually not possible?

Oof, it looks like it’s supported for renderers that apply selection highlighting as part of a 2d pass (using HdxColorizeSelectionTask), but not for Storm, which draws selection highlighting as part of the forward pass. It’s relatively straightforward to extend Storm to draw wireframe highlighting, but I don’t think you can do outline highlighting in the 3d pass, and reworking task controller to make Storm draw selection in a 2d pass is a bit more work (though still quite doable).

So: doable with a bit of tinkering, but it doesn’t work out of the box. Github issues and PRs happily accepted for this.

1 Like

Hi Tom, thanks a lot for the reply!

Yeah after digging a bit more that’s the answer I was coming up with as well after I realized Storm didn’t seem to use HdxColorizeSelectionTask but rather HdxSelectionTask.

”reworking task controller to make Storm draw selection in a 2d pass is a bit more work (though still quite doable)”

Is this what you would recommend to get this to work, then? I might look into it soon, though I admit it’s a little out of my depth :laughing: so any further tips or suggestions are appreciated.

I also wanted to implement colored outlines for hydra/HdStorm. The Solution was to implement a RenderTask, which reads primID and Neye Aovs and uses a sobel shader. We also extended storm to support mrt, so we can render multiple aovs at once in the renderpasses. We modified also the RenderPass shaders, so that the encode primID and InstanceID in a 24 bit hash together with the color per prim, so we could have one 32 bit AOV for prim discontinuity data and color. If you chose to implement A Rendertask for this - you have to use Hgi directly like in VisualizeAOV task. Otherwise primID readback won’t work because int samplers are only supported in the code paths supplied by Hgi. However in our case we are using our own selection mechanism and picking, which just outputs an outline color per prim.

1 Like