Aspose.3D for .NET 18.3 - March 2018

Other Improvements and Changes

KeySummaryCategory
THREEDNET-364Order-independent transparencyEnhancement
THREEDNET-3593DS to GLTF export throws an out of index errorBug
THREEDNET-358Cannot render model transparencyBug

Public API and Backwards Incompatible Changes

See the list of any changes made to the public API such as added, renamed, removed or deprecated members as well as any non-backward compatible change made to Aspose.3D for .NET. If you have concerns about any change listed, please raise it on the Aspose.3D support forum.

Adds GetBoundingBox method to Aspose.ThreeD.Entity class

Definition - C#

 /// <summary>

/// Gets the bounding box of current entity in its object space coordinate system.

/// </summary>

public Aspose.ThreeD.Utilities.BoundingBox GetBoundingBox()

Developers can get the bounding box of the entity in its own object-space coordinate system.

Code example - C#

 var box = new Box();

BoundingBox bbox = box.GetBoundingBox(); 

Console.WriteLine(bbox);

Adds enum type Aspose.ThreeD.Shading.AlphaSource

Definition - C#

 /// <summary>

/// Defines whether the texture contains the alpha channel.

/// </summary>

public enum AlphaSource

{

    /// <summary>

    /// No alpha is defined in the texture

    /// </summary>

    None,

    /// <summary>

    /// The alpha is defined by pixel's alpha channel

    /// </summary>

    PixelAlpha,

    /// <summary>

    /// The Alpha is a fixed value which is defined by <see cref="TextureBase.Alpha"/> 

    /// </summary>

    FixedValue

}

Adds Alpha and AlphaSource members to Aspose.ThreeD.Shading.TextureBase class

C#

 /// <summary>

/// Gets or sets the default alpha value of the texture

/// This is valid when the <see cref="AlphaSource"/> is <see cref="Aspose.ThreeD.Shading.AlphaSource.PixelAlpha"/>

/// Default value is 1.0, valid value range is between 0 and 1

/// </summary>

public double Alpha{ get;set;}

/// <summary>

/// Gets or sets whether the texture defines the alpha channel.

/// Default value is <see cref="Aspose.ThreeD.Shading.AlphaSource.None"/>

/// </summary>

public Aspose.ThreeD.Shading.AlphaSource AlphaSource{ get;set;}

These members are added to make it compatible with texture-transparency in 3D files like U3D/FBX, these are also supported in Aspose.3D’s renderer. Since Aspose.ThreeD.Shading.LambertMaterial/ Aspose.ThreeD.Shading.PhongMaterial/ Aspose.ThreeD.Shading.PbrMaterial has a TransparencyFactor, but it is far not enough for some complex transparency materials, after 18.3, material can use per-pixel alpha channel defined in the diffuse/albedo texture.

C#

 // define a box node with alpha channel defined in albedo texture:

var node = new Node()

{

    Material = new PbrMaterial()

    {

        AlbedoTexture = new Texture()

        {

            AlphaSource = AlphaSource.PixelAlpha,

            FileName = "window.tga"

        }

    },

    Entity = new Box()

};