[fixed]mipmap problem

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
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

[fixed]mipmap problem

Post by Randajad »

Hello!
I uses 24 bit textures and make transparent key on 255, 0, 255 color.

Code: Select all

 
    static const SColor transp_col(0xFF, 0xFF, 0x00, 0xFF);
    g->driver->makeColorKeyTexture(tex, transp_col, true);
 
When i viewing my "tree" at far, then it's display me that color like:
Image

But when i make my camera near everything is ok:
Image

Also i tested and found, that there is NO problem with opengl device.
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Direct3d device problem

Post by hendu »

Mipmaps, the smaller versions aren't 255, 0, 255, they are some blend with green and that.

Use proper alpha channels.
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

Re: Direct3d device problem

Post by Randajad »

Sorry, but i can't. Then why opengl works ok?
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Direct3d device problem

Post by hendu »

Sorry, I was wrong. Colorkey textures are proper alpha textures inside irr.

This is a dx device bug then. Maybe it's mipmaps not properly updating.
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

Re: Direct3d device problem

Post by Randajad »

My fix:
cnulldevice.cpp:1070, add:

Code: Select all

 
    texture->regenerateMipMapLevels();
 
I think it is right way to fix it.
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Direct3d device problem

Post by CuteAlien »

Moving this to bugreports
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
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Direct3d device problem

Post by hendu »

Yeah, there's one after createNormalMapTexture too, so seems correct.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Direct3d device problem

Post by hybrid »

Ok, fixed as suggested. I think these methods will sooner or later be moved to image converter methods, which only work on the basic CImage. This is far more efficient than doing this conversion on the textures. But that has to wait some more.
Post Reply