[ok] All textures are flipped

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
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

[ok] All textures are flipped

Post by stefbuet »

I'm using Irrlicht 1.7.1, OpenGL driver. This bug is not present under Software driver.

Bug: With the simpliest XEffect use, that is to say no effects, juste initing it and replacing the smgr->drawAll by xeffect->update, all Irrlicht textures are flipped, even when not using xeffect anymore to render the scene.

Here is the code to reproduce the bug.

Code: Select all

#include <cstdlib>
#include <iostream>
#include "XEffects/XEffects.h"

using namespace irr;
using namespace scene;
using namespace video;

EffectHandler *effect;
IrrlichtDevice *device;
IVideoDriver* driver;
ISceneManager* smgr;

ITexture *tex;

int main(int argc, char *argv[]) {
    
    
    device =createDevice( video::EDT_OPENGL, core::dimension2d<u32>(640, 480), 16,false, false, false, 0);
    
    driver = device->getVideoDriver();
    smgr = device->getSceneManager();
    effect = new EffectHandler(device, driver->getScreenSize(), true, true, true);
    
    tex=driver->getTexture("irr_logo.png");
    
    ICameraSceneNode *cam=smgr->addCameraSceneNode();
    
     while(device->run()) {
    
        driver->beginScene(true, true, SColor(255,100,101,140));
       
        effect->update();
        
        driver->draw2DImage(tex, core::rect<s32>(100,100,200,200), core::rect<s32>(0,0,100,100),0,0,true);
         
        driver->endScene();
    
    }
    
}
Thank you.

Stef.
Last edited by stefbuet on Sun Mar 07, 2010 1:21 pm, edited 1 time in total.
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Textures are not flipped if I reset the driver current material.

Code: Select all

driver->setMaterial(irr::video::SMaterial());
     
driver->draw2DImage(tex, core::rect<s32>(100,100,200,200), core::rect<s32>(0,0,100,100),0,0,true);
Now, I don't know where this problem is coming from XEffect.
I don't know if it's a bug in Irrlicht or XEffect...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess that it's a renderstate change which is not properly reflected in the driver state cache. Don't know if XEffect makes certain low-level calls or why this happens. But I'm pretty sure that it happens somewhere inside XEffect. However, could also be fixed in a state update in Irrlicht. I guess we should simply wait for BlindSide's new effect version for Irrlicht.
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Yep, so I'll wait for Irrlicht 1.8 :p
By the way if someone have the same problem, juste add the previous line at the end of the update function in EffectHandler.cpp from XEffect.
Post Reply