itexture->lock()

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
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

itexture->lock()

Post by Klunk »

when using this to copy from one texture to another, if using any mipmapLevel other than zero the copied data comes out upside down and mirrored.
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: itexture->lock()

Post by Klunk »

in fact no copying is needed

Code: Select all

        
        driver->setTextureCreationFlag( ETCF_CREATE_MIP_MAPS,true);
        ITexture* detailMap = driver->getTexture(YOUR_TEXTURE_NAME_HERE);
        unsigned int* sdata = (unsigned int*)detailMap->lock(false,2);
        detailMap->unlock();
 
will mirror and flip the map at mip level 2 :D

this is in opengl btw
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: itexture->lock()

Post by Mel »

I had some similar troubles when i tried to perform some postproduction using OpenGL without shaders. For some reason, Open GL flips the textures and it seems it is the way GL works, not Irrlicht.

http://irrlicht.sourceforge.net/forum/v ... =9&t=39022
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: itexture->lock()

Post by Klunk »

i think in this case it's an irrlicht issue, if you change index of the lock to 0, it works fine.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: itexture->lock()

Post by hybrid »

Do you use an Intel gfx card? Please check if GL_MESA_pack_invert is supported by your card. Could be that this extension only works for topmost texture level.
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: itexture->lock()

Post by Klunk »

no it's an nvidia 8800 GTS, whether it supports it I have no idea,
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: itexture->lock()

Post by hybrid »

Hmm, don't think so. So I'll have to extend the test case to see for myself.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: itexture->lock()

Post by Nadro »

As I remember itexture->lock() doesn't work on AMD Radeon cards, when we try get level > 0, but this isn't Irrlicht issue, but drivers I think.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply