To make the entity color semi-transparent you need simply to set its color Alpha component to a value lower than 255. The entity color depends on two factors:
- Color method (
- Viewport display mode (
If you are using
Rendered display mode for example, the entity color is determined by the relevant
Material.Diffuse.A value while the relevant material can be the
Entity.Material, the referenced
Eyeshot features blended transparency, a very fast and inaccurate transparency method. An additional accurate transparency method is available but it has a number of limitations:
- Slow speed
- Doesn't propagate inside block/blockReference
- May crash on invalid triangles
- Need to be recomputed every time one object/layer is hidden
- Textured objects are not supported
- Wires are not supported
Accurate transparency can be activated using:
viewportLayout1.AccurateTransparency = true;
Accurate transparency is based on Binary Space Partitioning, this requires a geometry pre-processing stage that could take some time. To improve the speed of the pre-processing stage you can try decreasing the
MaxCandidates represents the number of samplings the pre-processing stage takes to simplify the semi-transparent geometry. Increasing it, you'll get a better frame rate (fps) when you display the model while decreasing it you improve the speed of the pre-processing stage.
Another option to increase your scene frame rate is to set
ViewportLayout.Entities.FrontFacingOnly = true, in this case only front facing semi-transparent triangles will be drawn. Combined with visible sharp edges can be a great compromise between speed and accuracy of your scene.
Finally, you may also consider calling
) to reduce the total number of triangles involved in transparency.
When you set
Entity.Visible to false for a semi-transparent entity you need to call manually
ViewportLayout.Entities.UpdateBoundingBox()to ensure the geometry pre-processing stage takes place again.
UpdateBoundingBox()will also update the shadow and the model bounding box (removing entities just hidden).