[fixed]Tiling problem with COLLADA

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
lucifervrn
Posts: 3
Joined: Tue Mar 13, 2012 2:20 pm

[fixed]Tiling problem with COLLADA

Post by lucifervrn »

Hi, all!
I have a problem with loading object with tiling texture in irrlicht from dae file.

The sample file -
Image

sample code:

Code: Select all

#
#include "irrlicht.h"
 
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
 
int main()
{
 
    IrrlichtDevice *device =
            createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, 0);
//createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16, false, false, false, 0);
 
    if (!device)
            return 1;
 
    device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
 
    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();
 
    IAnimatedMesh* mesh = smgr->getMesh("D:/3Dscene/tail/test.dae");
   //IAnimatedMesh* mesh = smgr->getMesh("D:/3Dscene/tail/test.3ds");
    if (!mesh)
    {
        device->drop();
        return 1;
    }
 
     IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
    if (node)
    {
        node->setMaterialFlag(EMF_LIGHTING, false);
   }
 
    smgr->addCameraSceneNode(0, vector3df(0,50,0), vector3df(0,0,0));
 
 
    while(device->run())
    {
            driver->beginScene(true, true, SColor(255,100,101,140));
            smgr->drawAll();
 
            driver->endScene();
    }
 
    device->drop();
 
    return 0;
}
 
When i export model from 3dsmax to 3ds i got:

Image

When i export model from 3dsmax to dae with openCollada i got:

Image

but with software render i got correct:

Image

You can also check it using example 09.Meshviewer from irrlicht.
Try to load my dae file with software, burningvideo and opengl driver.
dae file - http://rghost.ru/37002696
directX driver works same as opengl.

all of that i try to do with irrlicht 1.7.2 with CColladaFileLoader from 1.8.0 (from svn-4093)
previous versions of irrlicht simply do not load textures from dae files.
and also i try on irrlich from svn-4093 and have same result.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Re: Tiling problem with COLLADA

Post by ACE247 »

:? That is strange...
I loaded the mesh in blender and it loads fine, Meshviewer it looks buggered, so to me it seems that somehow the texture repetition is clamped in the y axis.
EDIT: The problem possibly lies somewhere with the way Irrlichts OpenGL and DirectX driver together with Collada, handle texture repeat in Y axis just not sure where yet.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Tiling problem with COLLADA

Post by CuteAlien »

Large amount of troubles...

First the material type it uses is video::ETC_CLAMP - which is correctly displayed in OpenGL and probably not supported in the software renderer (so it uses repeat instead and gives you the result you want).

edit: OK, sorry - seems I've read documentation wrong there. Wrap mode NONE is same as ETC_CLAMP_TO_BORDER - but NONE is not default when no wrap mode is set as I expected. Didn't see this at first as it wasn't documented in the fx_sampler_wrap_common section, but only in the collada_reference_card. So default is "WRAP", so we can fix this in Irrlicht (and maybe also add support for the other modes which seems to be missing so far). I'll change it.
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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Tiling problem with COLLADA

Post by CuteAlien »

Fixed in latest trunk version (r4103). We still set the wrapping modes for all textures in a material together (to the same value) - could be that's another missing feature, but for you case it should work now.
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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: [fixed]Tiling problem with COLLADA

Post by hybrid »

Yeah, multi-texture support needed another level of indirection IIRC. Some things were fixed already, but since most materials don't need special texture setup for layers 2+ it was not the important stuff to fix for collada files. I guess adding clamp in SW renderer would also be easy :-)
lucifervrn
Posts: 3
Joined: Tue Mar 13, 2012 2:20 pm

Re: [fixed]Tiling problem with COLLADA

Post by lucifervrn »

yeah! it is fixed!
thank you very much!
Post Reply