Textures gets messed up depending how closed you are

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.
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Textures gets messed up depending how closed you are

Post by MasterM »

Hey all, i was going to start a demo of my first game and i loaded the mesh and applied a texture to it but when i quickly ran it to see if everything is fine i noticed that the texture on the mesh gets screwed when i go far and when i close in it fixes itsself.

Here are the tree pictures i have taken to show the possibly bug :
close
Image

medium far
Image


further
Image

and my code is simple, it looks like this :

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(int argc, char** argv)
{


    IrrlichtDevice *device =
        createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 16,
            false, false, false, 0);


    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();
    IGUIEnvironment* guienv = device->getGUIEnvironment();


    IMesh* mesht = smgr->getMesh("board.obj");
    IMeshSceneNode*node = smgr->addMeshSceneNode( mesht );
    node->setMaterialFlag(EMF_LIGHTING, false);
   ITexture *text=driver->getTexture("lolgf.PNG");
   node->setMaterialTexture( 0, text);



    smgr->addCameraSceneNodeFPS();


    while(device->run())
    {
        driver->beginScene(true, true, SColor(0,200,200,200));

        smgr->drawAll();
        guienv->drawAll();

        driver->endScene();
    }


    device->drop();

    return 0;
}

Last edited by MasterM on Sun Jul 12, 2009 1:20 am, edited 2 times in total.
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

What version of Irrlicht are you using?
TheQuestion = 2B || !2B
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

looks like mip map artifacts, weird
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

I am using Irrlicht version 1.5
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

[edit]I have the Nvidea ati radeon 9550
Image
I think that's the problem cause its also doing it with the standard irrlicht tutorial 1
[edit]and it only does it with opengl(cant use directx cause its gcc), software render doesnt flip like that :/
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Code: Select all

createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 16,false, false, false, 0); 
Hmmm. Is your mesh a very slim box? Are we seeing the reverse side because of 16bit depth precision?

Try a 32bit depth buffer instead of 16. Or better values for near/far planes (push Near out as far as possible and move Far in as close as poss).
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Well i tried tutorial 1 with 3d bit depth and my graphics card set at factory defaults and it still looks screwed :(, here's a pic to demonstrate Image
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

Code: Select all

driver->setTextureCreationFlag(E_TEXTURE_CREATION_FLAG::ETCF_CREATE_MIP_MAPS, false); 
Try that, also try to disable biliniear filtering
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Thanks Twilight17, that worked...For everyone else having this problem tried what Twilight17 said.
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Wow. Not quite "solved" yet, as I think something is strangely broken there. Is your texture a power-of-two?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

sio2 wrote:Wow. Not quite "solved" yet, as I think something is strangely broken there. Is your texture a power-of-two?
Yes, I agree. I don't think it's not solved yet. And that's what the problem appears to be, a NPOT texture.
TheQuestion = 2B || !2B
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Sorry but whats a power of two texture?
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

Halifax wrote: And that's what the problem appears to be, a NPOT texture.
No, it's not that because the sydney example also has this problem. I'm guessing it's just something with his graphics card, incompatibility of some sort. Try updating your drivers by the way!
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

if mip maps false is true and its fixed it might be something way deeper, it might even be an engine issue. Though, it seems pretty driver specific to me (i had meshes in a game that for some reason had missing polys on an ati)
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

twilight17 wrote:No, it's not that because the sydney example also has this problem.
Don't forget, that's using the software renderer.

Either way, we really need more information, and he should really try Direct3D 9 to see if there is a difference. I have always heard that ATI's OpenGL support is rather shoddy.
TheQuestion = 2B || !2B
Post Reply