no mipmap in irrlicht0.7 with directx9

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.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

ok!

Installed original Irr7 version. Things compiled ok, but with the mipmapping problem.

Tried to compile with Irr0.6 version of Cdirectx9Texture.cpp and got these 3 errors:
c:\irrlicht\source\irrlicht\cdirectx9texture.cpp(400) : error C2143: syntax error : missing ';' before 'tag::id'
c:\irrlicht\source\irrlicht\cdirectx9texture.cpp(400) : error C2501: 'EDriverType' : missing storage-class or type specifiers
c:\irrlicht\source\irrlicht\cdirectx9texture.cpp(400) : fatal error C1004: unexpected end of file found

Impossible to try the dll

waiting for instructions!!!!
Image
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

tried one more thing:
copied
CDirectX8Texture.cpp
CDirectX9Texture.cpp
and
COpenGLMaterialRenderer.h

from IrrlichtNX latest source to try, and the dll compiled and worked ok; opengl fix works properly (including 2 layer material blending) but the DX mipmapping problem persists.

I'm about to think it's a videocard issue, but then, why did it work before?
Image
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

Post by cmoibenlepro »

I tested your code...
0 && HardwareMipMaps && Texture made no difference (same thing as afecelis)

the other code you posted don't work. It compile fine, but then when I run a program there is a fatal windows error (same thing as afecelis again.)

I tried to use instead the CDirectX9Texture.cpp and .h files from 0.6
I got some comiplations error, because EDriverType changed to E_DRIVER_TYPE, I got it to compile without errors, but the dll don't work and I get windows fatal error.
So I can't run my program to see if mipmaps works. :(
But the dll is not corrupted because if I use instead directx8 it works.
So there is a problem with directx9.

I am not able to find the solution... sorry. :(

BTW I can't debug it because I use visualc++Toolkit and there is no debugger.
I don't have MSVC++6 or .NET unfortunately
I have also minGW but I doubt it would help because it doesn't support directx.

So I can't you help more.
You will need to help me to help you. :)
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

you can help Jox to help me so that I can help the project which helps me have fun helping me create helpful things for helpful people!!!! :lol: :lol: :lol:

ps. NP, I also got MSVC6 and 7 installed for comparing purposes. But I just love everything created with Relo and the Toolkit. Each exe is like a mindbirth!!! lol!

BTW, Benoit, can you help me out with Icon resources not compiling when I have to link my project with Audiere.h?

If you want I can send u the project.

finalPS: you're absolutely right, the mipmapping problem only occurs in DX9, I just compiled with DX8 and everything looks ok!

cheers!
Image
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Hmm. Ok, cmoibenlepro has same behavior. Thats not so bad actually. It makes the bug "stable".. ;)

Uh, sorry 'bout that 0.6 thing. Of course EDriverType changed to E_DRIVER_TYPE. Didn't think of that last night... But thats just a naming convention thing.

Please test the following. With all the changes (0.6 version + E_DRIVER_TYPE) in IrrCompileConfig.h change

Code: Select all

#define _IRR_COMPILE_WITH_DIRECTX_8_
#define _IRR_COMPILE_WITH_DIRECTX_9_
to

Code: Select all

//#define _IRR_COMPILE_WITH_DIRECTX_8_
#define _IRR_COMPILE_WITH_DIRECTX_9_
and compile...
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Good news!

Post by afecelis »

Hi Jox! This time beta tester AFC546768hg896987457b has got some good news!
Here's what I did:
1. Used Irr 0.6 version of CDirectXTexture9.cpp
2. Added the required underscores for edrivertype
3. Commented the line that says to use directx 8 to compile

and:
Image

good news, huh?

The bad news, if I try to compile with DirectX8 I get the following error:
Image

@Cmoibelenpro: about the resources; nevermind, all I had to do was copy audiere.h into Irrlicht's source; this way the Icon resource compiles ok and doesn't get confused looking for external folders. (typoical solution you get while you sleep) :D

thnx!
Image
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

oh, one last thing I forgot to mention; the new dll gained about 70k.

from 836 to 904 kb
Image
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Ok, so DX8 implementation messes up DX9. This is what niko is saying also in that comment:
Niko wrote: // The D3DXFilterTexture function seems to get linked wrong when
// compiling with both D3D8 and 9, causing it not to work in the D3D9 device.
But before it was not a problem with DX9... Maybe its an Issue with the new DirectX9c?

Hm, what about trying to find the crash point with my debugging instructions?
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

just arrived from work. gonna debug it now!!!
Image
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

done! check the log here:
http://www.danielpatton.com/afecelis/files/dx8debug.txt

hope it helps
Image
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Hehe, thanks afecelis, but this doesn't help that much... :)

You compiled the dll without DX8 and then you tried to run it with DX8. Very early in your report it says "DirectX Driver was not compiled into this dll. Try OpenGL." ;)

We need to debug the DX9 crash! It would be especially helpful to find out in what file and which line of code it crashes. Unfortunately I cannot reproduce the bug.

Pleaser read my debug instructions again carefully. Have you been able to find the "Context" drop down? Have you noticed in the error message that you get: it says "Click CANCEL to debug the program". Did you actually try that? :)
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

lol! sorry for that. I guess it's because I still got the comment on IrrCompileConfig.h

//#define _IRR_COMPILE_WITH_DIRECTX_8_

shall I remove it?

that's why DX8 is not in the dll and it crashes
Image
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

Yea remove it, compile with both DX and run with DX9

then, we didn't try one thing:

Take original 0.7 CDirextXTexture.cpp and change this

Code: Select all

if (HardwareMipMaps && Texture)
{
	// generate mipmaps in hardware

	Texture->GenerateMipSubLevels();
	return true;
}
to

Code: Select all

if (HardwareMipMaps && Texture)
{
	// generate mipmaps in hardware

	printf("Generating mipmaps by hardware...\n");

	Texture->GenerateMipSubLevels();
	return true;
}
printf("Generating mipmaps by software...\n");
compile with both DX8 and DX9. And run, and make the console output available. (Best with MSVC6 like you did before (the txt files))
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

ok, I'm one step behind. This is the first part (DX9 removing the comment). The project runs but everything is dark as hell and there's a circular zone with light around the camera.

Image

this is the debug I got for it:
http://www.danielpatton.com/afecelis/fi ... _debug.txt

now I'm gonna try your other changes

ps. when you say: CDirextXTexture.cpp (the 0.7 original), you mean
CDirectX9Texture.cpp?
Image
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

So the dark screenshot is result of the MSVC6 dll? Does this mean it doesn't crash this time, but everything is dark? It does behave differently in MSVC6 and your other dev environment?

Yes, I mean of course CDirextX9Texture.cpp, sorry...

Please try as soon as possible the last code change (2 posts ago).

Btw, the circle with "light" seems to be the area where no mipmaps are used, the "dark" area might be messed up mipmaps...
Post Reply