Follows are my code example
dwarf.x alpha channel in win32 OpenGL is Good
but in ios android OGLES-1 not good
{ninja.b3d} can show transparent alpha in OGLES-1 and use MyAlpha to adjust high low
why the {dwarf.x} can not show transparent effect in OGLES-1?
1.
is the file format not support alpha channel for .x in OGLES-1?
2.
what formats support?
///////////////
//mesh = smgr->getMesh( (GetBaseAppPath()+"game/ninja.b3d").c_str() );
mesh = smgr->getMesh( (GetBaseAppPath()+"game/dwarf.x").c_str() );
node = smgr->addAnimatedMeshSceneNode( mesh );
//////////////////////////////texture/////////////////////////////////////////////////
node->setMaterialTexture( 0, driver->getTexture((GetBaseAppPath()+"game/nskinrd.jpg").c_str()) );
node->setMaterialFlag(EMF_LIGHTING, true);
node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
u32 MyAlpha = 100;
u32 MaterialCount = node->getMaterialCount();
for(u32 i=0; i<MaterialCount; i++)
{
video::SMaterial& tex_mat = node->getMaterial(i);
tex_mat.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
tex_mat.MaterialTypeParam = 0.1;
tex_mat.MaterialTypeParam2 = 0.1;
tex_mat.AmbientColor.setAlpha(MyAlpha);
tex_mat.DiffuseColor.setAlpha(MyAlpha);
tex_mat.SpecularColor.setAlpha(MyAlpha);
tex_mat.EmissiveColor.setAlpha(MyAlpha);
}
//use it or not by platform
for(u32 i=0; i<mesh->getMeshBufferCount(); i++)
{
scene::IMeshBuffer* buffer = mesh->getMeshBuffer(i);
video::S3DVertex* vertex = (video::S3DVertex*)buffer->getVertices();
for(u32 j=0; j<buffer->getVertexCount(); j++)
{
//vertex[j].Color = video::SColor(MyAlpha,255,255,255);
vertex[j].Color.setAlpha(MyAlpha);
}
}
File format support alpha channel?
Re: File format support alpha channel?
If the X file loader has not been rewritten then, yes, it does not support alpha. The OBJ loader supports a single value of alpha for a material (d < 1) but not an alpha map. I had an argument with CuteAlien about it but just got "oh, well". The alpha map is mapped to EMT_TRANSPARENT_ADD_COLOR and replaces the diffuse texture
Re: File format support alpha channel?
He told me he has a busy game project~~~ so myabe this problem answer oh well
Do you have any idea for .X support alpha channel
any code example?
Do you have any idea for .X support alpha channel
any code example?
mongoose7 wrote:If the X file loader has not been rewritten then, yes, it does not support alpha. The OBJ loader supports a single value of alpha for a material (d < 1) but not an alpha map. I had an argument with CuteAlien about it but just got "oh, well". The alpha map is mapped to EMT_TRANSPARENT_ADD_COLOR and replaces the diffuse texture
Re: File format support alpha channel?
No, I do not know the X file format. If you do, you can go into the loader, find the relevant section and set the material parameters. But the proper support of transparency requires new shaders. I don't know what shaders are being written for GLES but in "trunk" there is only one, and it doesn't handle transparency.
Re: File format support alpha channel?
thanks man
if anyone have idea please let me know
if anyone have idea please let me know
mongoose7 wrote:No, I do not know the X file format. If you do, you can go into the loader, find the relevant section and set the material parameters. But the proper support of transparency requires new shaders. I don't know what shaders are being written for GLES but in "trunk" there is only one, and it doesn't handle transparency.
Re: File format support alpha channel?
Guys, if it works with the same code and model on Win32 then this is obviously not a mesh-format problem but a driver problem! The mesh-loaders have no platform specific code.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: File format support alpha channel?
in windows .x need use vertex alpha as follow code
but .b3d do not need~~~
for(u32 i=0; i<mesh->getMeshBufferCount(); i++)
{
scene::IMeshBuffer* buffer = mesh->getMeshBuffer(i);
video::S3DVertex* vertex = (video::S3DVertex*)buffer->getVertices();
for(u32 j=0; j<buffer->getVertexCount(); j++)
{
//vertex[j].Color = video::SColor(MyAlpha,255,255,255);
vertex[j].Color.setAlpha(MyAlpha);
}
}
does OGLES1 and OGLES2 support vertex alpha texture?
but .b3d do not need~~~
for(u32 i=0; i<mesh->getMeshBufferCount(); i++)
{
scene::IMeshBuffer* buffer = mesh->getMeshBuffer(i);
video::S3DVertex* vertex = (video::S3DVertex*)buffer->getVertices();
for(u32 j=0; j<buffer->getVertexCount(); j++)
{
//vertex[j].Color = video::SColor(MyAlpha,255,255,255);
vertex[j].Color.setAlpha(MyAlpha);
}
}
does OGLES1 and OGLES2 support vertex alpha texture?
CuteAlien wrote:Guys, if it works with the same code and model on Win32 then this is obviously not a mesh-format problem but a driver problem! The mesh-loaders have no platform specific code.
Re: File format support alpha channel?
Sorry, I also only know what is supported and what not by trying it out - I didn't write those drivers.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: File format support alpha channel?
its ok u help a lot for me
CuteAlien wrote:Sorry, I also only know what is supported and what not by trying it out - I didn't write those drivers.