Have not observed that. Is the object in front totally transparent or only partially in overlapping areas?Anonymous wrote:Not much luck ... if i set a grey texture (R 128 G 128 B 128) then i get a better result but not ok. And if an object gets in front of the "transparent" mesh it also gets transparent.
With the opengl driver the effect is much better but it stays at 50% transparent no matter what the alpha value is.
Probleme with transparency
-
- Posts: 63
- Joined: Thu Aug 05, 2004 9:40 am
- Location: Germany
Here is a little example ... i have enabled the vertex color alpha (due to hireacial objects in .x file not all objects even get affected with the alpha value but thats another issue) and the render order seems all messed up. Anyway on the right you se a small round object and on the left i have rotated the view a bit so it gets in front of the rest of the mesh and it dissapears (probably renders behind), The same thing happens if i have a water plane running in the middle of the mesh. When vertex col. aplha is set then the waterplane always renders in front of the mesh.
//POi
//POi
I seem that transparency is does not work.
I not even can create box with 20% transparency.
This box is 50% transparent. How to set 5% transparent for example?
I not even can create box with 20% transparency.
Code: Select all
C#:
ITexture texWall = device.VideoDriver.GetTexture(@"..\..\media\wall.bmp");
ISceneNode node = device.SceneManager.AddCubeSceneNode(15,
null, -1, new Vector3D(30, -15, 0));
Material mat = new Material();
mat.Lighting = false;
mat.BackfaceCulling = false;
mat.Texture1 = texWall;
mat.Type = MaterialType.TRANSPARENT_ADD_COLOR;
mat.EmissiveColor.Alpha = 10;
mat.DiffuseColor.Alpha = 10;
mat.AmbientColor.Alpha = 10;
mat.SpecularColor.Alpha = 10;
node.SetMaterial(0, mat);
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Please don't cross post your questions all over, and only raise such old threads if this is really useful!
TRANSPARENT_ADD_COLOR takes the texel color and makes the texel transparent based on the color value (thus black becomes completely transparent, while white is completely opaque). You can also use vertex color alpha and texture alpha channel for the transparency by choosing the correct material. I don't know about light alpha settings to do anything useful.
TRANSPARENT_ADD_COLOR takes the texel color and makes the texel transparent based on the color value (thus black becomes completely transparent, while white is completely opaque). You can also use vertex color alpha and texture alpha channel for the transparency by choosing the correct material. I don't know about light alpha settings to do anything useful.
Code: Select all
smgr->getMeshManipulator()->setVertexColors( mesh, video::SColor( color, color, color, color ) );
But it would be useful to have a real transparency for any scene node to fade things...
Regards - Xaron
I am create new code:
This code build full scene:
But my model is not transparent
Please fix this code.[/code]
This code build full scene:
Code: Select all
IMesh * mesh=smgr->getMesh("../storage/AquaBox/AquqBox.x")->getMesh(0);
smgr->getMeshManipulator()->setVertexColors( mesh, video::SColor( 25, 255, 255, 255 ) );
ISceneNode *Aqua = smgr->addMeshSceneNode(mesh);
Aqua->setMaterialFlag(EMF_LIGHTING, false);
Aqua->setAutomaticCulling(false);
Aqua->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
smgr->addCameraSceneNodeMaya();
Please fix this code.[/code]
Many thanks!!!!
I am not set material type to EMT_TRANSPARENT_VERTEX_ALPHA
My object is transparent by this code:
I am not set material type to EMT_TRANSPARENT_VERTEX_ALPHA
My object is transparent by this code:
Code: Select all
IMesh * mesh=smgr->getMesh("../storage/AquaBox/AquqBox.x")->getMesh(0);
smgr->getMeshManipulator()->setVertexColors( mesh, video::SColor( 100, 100, 100, 100 ) );
ISceneNode *Aqua = smgr->addMeshSceneNode(mesh);
Aqua->setMaterialFlag(EMF_LIGHTING, false);
Aqua->setAutomaticCulling(false);
Aqua->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
Aqua->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA );
smgr->addCameraSceneNodeMaya();