Problem with quake3map example.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Guest

Problem with quake3map example.

Post by Guest »

Hello !

I compiled with success irrlicht engine on my Linux Box.
When I execute the second example Quake3Map, There are no texture, all is white !

This is my log :

[util02@station5 2.Quake3Map]$ ./example
Creating X window...
Starting windowed mode...
Connecting glx context to window...
Window created.
Warning: This driver is not available in Linux. Trying OpenGL.
Warning: Could not find texture in Q3 .bsp:textures/common/caulk
[...]
Warning: Could not find texture in Q3 .bsp:models/mapobjects/gratelamp/gratetorch2b
Loaded mesh:20kdm2.bsp
Needed 112ms to create OctTree SceneNode.(297 nodes, 7306 polys)
Warning: Could not find win32 key for x11 key.

I have got the same problem with the collision example.

There is no problem with the others examples.

Thanks in advance

Samuel



--
Gondouin Samuel
gondouin.samuel@wanadoo.fr
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

About how much warnings are there that the textures could not be found? 10-20 is ok (these textures are in the quake main .pk3), but more means that it found no texture. Otherwise it means, that mulittexturing is disabled. That'S a problem I would have to fix. :)
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

So it means that there is no way in Irrlicht to load multitextured models at all? I found the line in source, module CAnimatedMeshMS3D.cpp:

Code: Select all

	//skip groups
	for (i=0; i<numGroups; ++i)
	{
		pPtr += 33; // name and 1 byte flags
		u16 triangleCount = *(u16*)pPtr;
		pPtr += sizeof(u16);
		pPtr += sizeof(u16) * triangleCount; // triangle indices
		
		pPtr += sizeof(c8); // material index
	}
	
	// skip materials
	u16 numMaterials = *(u16*)pPtr;
	pPtr += sizeof(u16);
	MS3DMaterial *materials = (MS3DMaterial*)pPtr;
	pPtr += sizeof(MS3DMaterial) * numMaterials;
Is it means no groups and no materials inserted for Milkshape models?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Groups and materials of ms3d models are not loaded yet, but this has nothing to do with the multitexturing bug with quake 3 maps in linux, i think.
Guest

Post by Guest »

I have including the missing textures in the pk3.
But the world is always all white.
How to enable the multitexturing ?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

That would envolve some changing of the code of the engine. But you could try if the problem really is multitexturing, try to disable the lightmaps on your quake 3 map: call YourQuake3MapSceneNode->setMaterialType(video::EMT_SOLID);
Guest

Post by Guest »

I modify the code with your tip but the wall are always in white . :cry:
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Strange. I'll check the problem on some linux computers of my friends. Hope I'll find the problem.
Guest

Post by Guest »

Any Idea ?

No Linux user has not this problem ? :cry:

Sam.
Guest

Post by Guest »

I have this same problem, it gives me same warnings when running the example.

- Mandrake 9.1
- GF2MX
- Nvidia drivers 4496

I have no idea what causes it. :(

--tuomas
Jonpry

Post by Jonpry »

I have the same problem :-)

Mandrake 9.0
Geforce 3, driver ver: 4496
Jonpry

Partial Fix

Post by Jonpry »

After going through it irrlicht source i found that CVideoOpenGL::loadExtensions() is never called in the "#ifdef LINUX" code, although you don't need to get a proc address in linux, the version checking code is useful and at the very least it is the code that sets CVideoOpenGL::MultiTextureExtension to true.
This did manage to get me a non white bsp, however it only has lightmaps and no textures, i was able to confirm that the loader did load all of the textures except for a select few so i doubt the texture load warnings are the cause of this, and after checking through the code i didn't find and obvious problem in the use to the texturing units.
I am starting to really like this engine and can envision many improvements i may be able to make to it in the future when i have a better idea of how all of the pieces work. Great job all.
Jonpry

Got the rest of it fixed now

Post by Jonpry »

The reason for the level textures not working was that Q3 Textures are mipmapped, and the COpenGLTextures code has a hack for the usual lack of glu in linux, i didn't try to fix it however, i just installed Mesa3d, which includes a glu library, and included <GL/glu.h> at the top and removed the #ifdef _WIN32, added -lGLU to the example makefile, and all was well :-)
Guest

Post by Guest »

In which file we must remove #ifdef _WIN32 ?

Sam.
jonpry
Posts: 3
Joined: Thu Sep 11, 2003 9:47 am
Location: USA
Contact:

The HOWTO guide

Post by jonpry »

In the file CVideoOpenGL.cpp about line 140, make this happen:

Code: Select all

#ifdef LINUX
//! Linux constructor and init code
CVideoOpenGL::CVideoOpenGL(const core::dimension2d<s32>& screenSize, bool fullscreen, bool doublebuffer, Window window, Display* display, io::IFileSystem* io)
: CVideoNull(io, screenSize),
	CurrentRenderMode(ERM_NONE), ResetRenderStates(true),
	Transformation3DChanged(true), LastSetLight(-1), MultiTextureExtension(false),
  MaxTextureUnits(1), DoubleBuffered(doublebuffer), XWindow(window), XDisplay(display)
{	

        loadExtensions();        //---------Added this-----------
	#ifdef _DEBUG
	setDebugName("CVideoOpenGL");
	#endif
}
You will need to have Mesa3d installed for this to work
In the file COpenGLTexture.cpp:

1. Add the following line to the top of the file:
#include <GL/glu.h>

2. The following snippet has the unwanted pieces removed, about line 74:

Code: Select all

	if (hasMipMaps)
	{
		s32 ret = 0;
		
		// TODO: make this work in linux too
		ret = gluBuild2DMipmaps(GL_TEXTURE_2D, 4, nSurfaceSize.Width, nSurfaceSize.Height,
 		            GL_BGRA_EXT, GL_UNSIGNED_BYTE, imageData );


		if (ret)
		{
			os::Warning::print("Could not create OpenGL texture mip maps.",
				(c8*)gluErrorString(ret));

		}
		else
		{
			glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
			glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
		}
	}	

In the examples directory, edit the Makefile to this, notice the addition of -lGLU on line 2

Code: Select all

CPP = g++
OPTS =  -I"../../include" -I"/usr/X11R6/include" -L"/usr/X11R6/lib" -L"../../lib/Linux" -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lz -ljpeg -lGLU

all:
	$(CPP) main.cpp -o example $(OPTS)

clean:
	rm example
Recompile the library and then compile the example, and all should be well
Post Reply