Issue with Tutorial 21 vs. my code

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.
Post Reply
Aptos
Posts: 7
Joined: Sat May 15, 2010 6:39 pm

Issue with Tutorial 21 vs. my code

Post by Aptos »

So I was using tutorial 21 (Quake 3 Explorer) to view some levels before I used them in my game. I found one I liked and loaded it up in my game only to find that none of the cool effects (shaders) were loaded. So, I figured out I needed the shaders so I copied he q3factory.h/cpp and used the same code in the tutorial and got the shaders working, but I'm still missing torches on the walls :(

Here is my code:

Code: Select all

Q3LevelLoadParameter loadParam;
loadParam.defaultLightMapMaterial = EMT_LIGHTMAP;
loadParam.defaultModulate = EMFN_MODULATE_1X;
loadParam.defaultFilter = EMF_ANISOTROPIC_FILTER;
loadParam.verbose = 2;
loadParam.mergeShaderBuffer = 1;
loadParam.cleanUnResolvedMeshes = 1;
loadParam.loadAllShaders = 1;
loadParam.loadSkyShader = 0;
loadParam.alpharef = 1;

smgr->getParameters()->setAttribute(ALLOW_ZWRITE_ON_TRANSPARENT, true);

device->getFileSystem()->addZipFileArchive(level_manager->getArchive());

IQ3LevelMesh* q3levelmesh = (IQ3LevelMesh*) smgr->getMesh(level_manager->getLevel());
IMesh* geometry = q3levelmesh->getMesh(quake3::E_Q3_MESH_GEOMETRY);
ISceneNode* q3node = smgr->addOctreeSceneNode(geometry, 0, -1, 2048);
ITriangleSelector* mapSelector = smgr->createOctreeTriangleSelector(geometry, q3node, 128);
q3node->setTriangleSelector(mapSelector);
q3node->setMaterialFlag(EMF_LIGHTING, true);
q3node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
IMetaTriangleSelector* meta->addTriangleSelector(mapSelector);
Q3ShaderFactory(loadParam,device,q3levelmesh, E_Q3_MESH_ITEMS, 0, meta, false);
Q3ShaderFactory(loadParam,device,q3levelmesh, E_Q3_MESH_UNRESOLVED, 0, meta, false);
Q3ShaderFactory(loadParam,device,q3levelmesh, E_Q3_MESH_FOG, 0, meta, false);
Q3ModelFactory(loadParam,device,q3levelmesh,0,false);
Even with all that I still don't get the cool torches on the walls.

I also tried commenting out Tutorial 21's Q3ShaderFactory() calls, and for some reason it still loaded the torches (albeit without fire), like it was just a part of the mesh. However, if I just load the geometry (no shaders) in my game I don't have the torches, and if I use Tutorial 16 (Quake 3 Map Shader) it doesn't load the torches either!!!!

What is the difference between Tutorial 16/my game and Tutorial 21?
Post Reply