My3D Tools v.3.1 released (with Gile[s] exporter)
Well, I found a bug in Irrlicht 0.8 (in OpenGL driver)!
It appears when you are using in the same scene EMT_LIGHTMAP and EMT_TRANSPARENT_VERTEX_ALPHA materials. In this case diffuse texture simply disappearing.
This bug not appears in Irrlicht 0.7, so to eliminate it from Irrlicht 0.8 you must simply replace function OnSetMaterial in class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA (in file COpenGLMaterialRenderer.h).
Copy this function from Irrlicht 0.7 and paste it into Irrlicht 0.8, and recompile all.
Thats all - the bug must be eliminated after this.
It appears when you are using in the same scene EMT_LIGHTMAP and EMT_TRANSPARENT_VERTEX_ALPHA materials. In this case diffuse texture simply disappearing.
This bug not appears in Irrlicht 0.7, so to eliminate it from Irrlicht 0.8 you must simply replace function OnSetMaterial in class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA (in file COpenGLMaterialRenderer.h).
Copy this function from Irrlicht 0.7 and paste it into Irrlicht 0.8, and recompile all.
Thats all - the bug must be eliminated after this.
Last edited by ZDimitor on Fri Mar 18, 2005 1:07 am, edited 1 time in total.
I upload new version of My3DTools (3.11) on my site
http://my3dproject.nm.ru/
Changes:
1) Add new method to Loader, getChildNodes(), to getting access to the nodes (with transparent material), creating while loading .my3d file
2) Made some changes in My3D Example
2Afecelis and 2All:
Use new method (see example), to set Parent to the transparent child nodes in .my3d scene.
After that elements that have a level of opacity must show up at the places where they're supposed to be.
2Afecelis:
Try now you scene.
Good luck programmers!
http://my3dproject.nm.ru/
Changes:
1) Add new method to Loader, getChildNodes(), to getting access to the nodes (with transparent material), creating while loading .my3d file
2) Made some changes in My3D Example
2Afecelis and 2All:
Use new method (see example), to set Parent to the transparent child nodes in .my3d scene.
After that elements that have a level of opacity must show up at the places where they're supposed to be.
2Afecelis:
Try now you scene.
Good luck programmers!
Its a bug in Irrlicht 0.8 so we must patch it:
Irrlicht 0.7 source:
Open file COpenGLMaterialRenderer.h in Irrlicht 0.7, find declaration
of the class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA, find function
OnSetMaterial, it looks like this:
Copy it in buffer
Irrlicht 0.8 source:
Open file COpenGLMaterialRenderer.h in Irrlicht 0.8, find declaration
of the class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA, find function
OnSetMaterial, it looks like this:
Comment or delete it and paste the text from buffer.
After this you must recompile Irrlicht 0.8 and use new Irrlich.dll and Irrlich.lib in your project.
Thats all.
Irrlicht 0.7 source:
Open file COpenGLMaterialRenderer.h in Irrlicht 0.7, find declaration
of the class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA, find function
OnSetMaterial, it looks like this:
Code: Select all
virtual void OnSetMaterial(SMaterial& material, const SMaterial& lastMaterial,
bool resetAllRenderstates, IMaterialRendererServices* services)
{
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates)
{
glDisable(GL_ALPHA_TEST);
Driver->setTexture(1,0);
if (Driver->hasMultiTextureExtension())
Driver->extGlActiveTextureARB(GL_TEXTURE0_ARB);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable(GL_BLEND);
}
material.ZWriteEnable = false;
services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
}
Irrlicht 0.8 source:
Open file COpenGLMaterialRenderer.h in Irrlicht 0.8, find declaration
of the class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA, find function
OnSetMaterial, it looks like this:
Code: Select all
virtual void OnSetMaterial(SMaterial& material, const SMaterial& lastMaterial,
bool resetAllRenderstates, IMaterialRendererServices* services)
{
if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates)
{
glDisable(GL_ALPHA_TEST);
Driver->setTexture(1,0);
if (Driver->hasMultiTextureExtension())
Driver->extGlActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_ALPHA_TEST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_REPLACE);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_PRIMARY_COLOR_EXT);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PRIMARY_COLOR_EXT);
glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
}
material.ZWriteEnable = false;
services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
}
After this you must recompile Irrlicht 0.8 and use new Irrlich.dll and Irrlich.lib in your project.
Thats all.
Last edited by ZDimitor on Fri Mar 18, 2005 1:08 am, edited 1 time in total.
thnx for the elaborated explanation, I also agree we should report niko about it.
Ok guys, new version of My3d tools (3.11) mirrored here:
http://www.danielpatton.com/afecelis/Zd ... binary.zip
http://www.danielpatton.com/afecelis/Zd ... 1.full.zip
http://www.danielpatton.com/afecelis/Zd ... .light.zip
and I tried the new modifications and adding the new child nodes stuff but I'm getting the following errors:
I'm checking what's wrong now, but any shortcut help will be appreciated!!
Ok guys, new version of My3d tools (3.11) mirrored here:
http://www.danielpatton.com/afecelis/Zd ... binary.zip
http://www.danielpatton.com/afecelis/Zd ... 1.full.zip
http://www.danielpatton.com/afecelis/Zd ... .light.zip
and I tried the new modifications and adding the new child nodes stuff but I'm getting the following errors:
Code: Select all
CMY3DMeshFileLoader.obj : error LNK2019: unresolved external symbol "class irr::ILogger * logger" (?logger@@3PAVILogger@irr@@A) referenced in function "public: virtual class irr::scene::IAnimatedMesh * __thiscall irr::scene::CMY3DMeshFileLoader::createMesh(class irr::io::IReadFile *)" (?createMesh@CMY3DMeshFileLoader@scene@irr@@UAEPAVIAnimatedMesh@23@PAVIReadFile@io@3@@Z)
LIBC.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
C:\Irrlicht\Projects_Relo\Laguito\laguito.exe : fatal error LNK1120: 2 unresolved externals