Eyeshot 11 Documentation
WinForms Control / Tutorials / Transparency explained
In This Topic
    Transparency explained
    In This Topic

    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:

    1. Color method (byEntity, byLayer, byParent)
    2. Viewport display mode (Shaded, Rendered)

    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 Layer.Material or BlockReference.Material.

     

    Accurate Transparency

    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:

    1. Slow speed
    2. Doesn't propagate inside block/blockReference
    3. May crash on invalid triangles
    4. Need to be recomputed every time one object/layer is hidden
    5. Textured objects are not supported
    6. Wires are not supported

    Accurate transparency can be activated using:

    viewportLayout1.AccurateTransparency = true;
    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 ViewportLayout.Entities.MaxCandidates value. 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 ViewportLayout.Entities.RegenAllCurved(<biggest_acceptable_tolerance>) 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).