How to change Silhouette Edges color?

I followed the tutorial Perimeter and Silhouette Edges — HOOPS Visualize HPS 2024 Documentation (techsoft3d.com).

myWindowKey.GetPostProcessEffectsControl().SetSilhouetteEdges(true, 10, true);

I confirmed that the Silhouette Edges (boundary edges) of objects are drawn in black color.
Can I change the Silhouette Edges color to another color?

Hello @vuhuyen128,

You can set the edge color (SetEdgeColor) through the MaterialMappingControl class, for example:

myWindowKey.GetMaterialMappingControl().SetEdgeColor(HPS::RGBAColor(1, 0, 0));

Thanks,
Tino

2 Likes

@tino Thank you so much for your help. It works perfectly.

1 Like

Sorry, I have a question.

After I imported some objects to my Model, I want to bring the silhouette edges of a object to the front.
Is it possible to bring the silhouette edges to the front? If it is possible, How can I do?

I tried to do by the following code:

myWindowKey.GetDrawingAttributeControl().SetDepthRange(0, 0);

But It seems does not work as I expected.

Hello @vitduc2020,

Welcome to the forum and to the Tech Soft 3D community!

It sounds like you want just the silhouette edges to be visible even if there are other models occluding it. This feature is currently not supported and I believe we have a feature request for this already.

With respect to using depth range, this setting is better suited for controlling the drawing of models to be on top all the time at the segment level. So it cannot be applied to just the silhouette edges.

Thanks,
Tino

1 Like

@tino

Thank you so much for your quick and very helpful answer.

It sounds like you want just the silhouette edges to be visible even if there are other models occluding it.

Yes, it is. I want to highlight the object with its the silhouette edges.
I understood that this function is currently is not supported.

With respect to using depth range, this setting is better suited for controlling the drawing of models to be on top all the time at the segment level . So it cannot be applied to just the silhouette edges.

Thank you for your useful information. I understood. :grinning:

1 Like