Game Development Community

TX3D 3.1.5 Beta - Billboard hard coded to translucent

by Henry Shilling · in Torque X 3D · 06/26/2010 (8:33 pm) · 2 replies

Build: 3.1.5 Beta

Platform: Windows 7-64 (specs i7 920, nVidia GTS250 6GB ram)

Target: VS2008 pro

Issues: Billboards hard coded to 25%.

Steps to Repeat:

Current code in T3DBillboardRenderComponent (line 220):
material = new SimpleMaterial();
material.IsTranslucent = true;
material.Opacity = 0.25f;
material.TextureFilename = Filename;
I changed it to:
material = new SimpleMaterial();
material.IsTranslucent = false;
material.Opacity = 1f;
material.TextureFilename = Filename;
I'd probably expose the IsTranslucent and the Opacity just for flexibility.


#1
06/30/2010 (7:46 pm)
Thanks Henry.

Logged as TRQX-131.
#2
07/08/2010 (2:40 pm)
TRQX-131 Fixed.

For those with source code access can implement the following changes now to get workin.

As Henry above stated, change T3DBillboardRenderComponent (line 220)to the following:

material = new SimpleMaterial();  
material.IsTranslucent = false;  
material.Opacity = 1f;  
material.TextureFilename = Filename;

To expose the properties as they will be in the next release change/add the following lines to your T3DBillboardRenderComponent.cs file.

Line 28:
public string Filename
        {
            get;
            set;
        }

changes into:
public string Filename
        {
            get { return Material.TextureFilename; }
            set { Material.TextureFilename = value; }
        }

Underneath line 50 (Underneath the Height property) Add the following:

public float Opacity
        {
            get { return Material.Opacity; }
            set { Material.Opacity = value; }
        }

Underneath(What should now be line 62, underneath the IsSphericalBillboard property) add the following:


public bool IsTranslucent
        {
            get { return Material.IsTranslucent; }
            set { Material.IsTranslucent = value; }
        }

Near line 110:
ri.Material = material;

Changes into :

ri.Material = material;

At the bottom of your CopyTo method (Near line 130) Add the following:
obj2.IsTranslucent = IsTranslucent;
            obj2.Opacity = Opacity;

Around line 232 Delete the following lines.

material = new SimpleMaterial();
            material.IsTranslucent = true;
            material.Opacity = 0.25f;
            material.TextureFilename = Filename;


And finally, underneath your _GetWorldBox method (Near line 242) paste the following code:

protected SimpleMaterial Material
        {
            get
            {
                if ( material == null )
                {
                    material = new SimpleMaterial();
                    material.IsTranslucent = false;
                    material.Opacity = 1f;
                    material.TextureFilename = Filename;
                }
                
                return material;
            }

That should do the job. :) Let me know if there are any problems.

And I apologize if it's a bit confusing. I just realized how many changes there were x.x