Problem with quake3map example.
Problem with quake3map example.
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
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
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:
Is it means no groups and no materials inserted for Milkshape models?
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;
Partial Fix
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.
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.
Got the rest of it fixed now
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
The HOWTO guide
In the file CVideoOpenGL.cpp about line 140, make this happen:
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:
In the examples directory, edit the Makefile to this, notice the addition of -lGLU on line 2
Recompile the library and then compile the example, and all should be well
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
}
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