My3D Tools v.3.1 released (with Gile[s] exporter)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

I got it
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

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.
Last edited by ZDimitor on Fri Mar 18, 2005 1:07 am, edited 1 time in total.
Testur

Post by Testur »

afecelis wrote:thnx for replying Testur.

then what would the shadows map be used for?
Beats me, all it does is render the direct shadows caused by object, since the ligthingmaps have that plus all the shading there's no real need to use it.

Or as Zdimitor said, Forget about them. :)
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

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! 8)
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Must I have to replace OnSetMaterial fuction with v 0.7 in this case?
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

whoa Zdimitor, you're fast!!!

Many thanks for all the help. Gonna try the fixes right away!!!

:D
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

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:

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);
    }
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:

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);
    }
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.
Last edited by ZDimitor on Fri Mar 18, 2005 1:08 am, edited 1 time in total.
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

I think we should ask niko to fix this bug , it appear when you are using in the same scene EMT_LIGHTMAP and EMT_TRANSPARENT_VERTEX_ALPHA materials. In this case diffuse texture simply disappearing.

I am already post about this in Bug report.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

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:

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

I'm checking what's wrong now, but any shortcut help will be appreciated!! :D
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

Try My3D example. Is it works for you?

It looks like you forget about global declaration in main.cpp

ILogger* logger;
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

nope, it's there

still trying, gonna check your examle
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Ok, I used your main file and modify it and now it compiles ok. But I still got to fix the opengl renderer but I can't find any of the lines you mention in COpenGLShaderMaterialRenderer.h

meanwhile I'm going to try it with DX!

thnx for the help! :D
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Great! transparent meshes are showing up where they're supposed to :D

last bug to fix is th eopengl issue.
ZDimitor
Posts: 202
Joined: Fri Jul 16, 2004 3:27 am
Location: Russia

Post by ZDimitor »

Damn it! Small mistake in my post (fix OpenGL bug), the file to be corrected
COpenGLMaterialRenderer.h

I correct this posts now.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

hehehehe, small mistake, huh?

It fixed it!! yay hooray :D :D Opengl looks damn nice!!

Image


many thnx for all the help Dmitri!!

final question; why is my water showing up greenish? any ideas?
Post Reply