Search Home Members Contacts
About Us
Bug #808: Color not cutted precisely from texture
TV3D SDK 6.5
Not Specified
Current State:
Created On:
December 24th, 2007
Last Modified:
January 1st, 2008
Reported By:
When I want to create an object which is partially transparent, I'm using a texture that consists of the colors I want, plus pure white for the transparent part, like this one:

Then I use the following code (in VB6) which should cut the white:

TexFactory.LoadTexture App.Path & "uildingsAirzoneairzone0.bmp", "Airzone0", , , TV_COLORKEY_WHITE, True

Set Airzone(1) = Scene.CreateMeshBuilder
Airzone(1).LoadXFile App.Path & "uildingsAirzoneAirzone33.x"
Airzone(1).SetScale 0.1, 0.05, 0.1
Airzone(1).SetPosition 40, 12, -50
Airzone(1).SetTexture GetTex("Airzone0")

The result is close to what is wished, but the texture is not precisely cutted out, there are black frames around the part which is not cutted. Example:

Even if I try to solve the problem with an Alpha Channel, or different colors, the black frame remains, the complexity of the texture does not influence the result aswell.


Posted by Insomnia on December 24th, 2007 at 11:32 AM
PS: I also ensured there are no artifacts in the texture which could cause the problem.
Posted by MrDisaster044 on December 26th, 2007 at 9:20 AM
Solution of the problem:

You should set the AutoTransperentColor of the Scene first (scene.SetAutoTransperentColor(globals.ARGB(1,1,1,1)))

You should set the Alpha reference Value to something different
You should set the Blending Mode to something different

(mesh.setalpharefvalue - standart is 128. range between 0 and 256, mesh.setblendingmode)

I hope this helps you
Posted by Insomnia on December 26th, 2007 at 12:39 PM
Ah very cool, changing the Mesh Blendmode worked already! Thanks a lot, with so many lines of code someone tends to lose sight of a few missing settings.
Thanks a lot!