In the loadSceneData function there is the following bit of code:
Code: Select all
core::matrix4 m;
m.setTranslation(core::vector3df(-1300,-70,-1249));
for ( i = 0; i!= scene::quake3::E_Q3_MESH_SIZE; ++i )
sm->getMeshManipulator()->transform(quakeLevelMesh->getMesh(i), m);
Code: Select all
quakeLevelNode->setPosition(core::vector3df(-1300,-70,-1249));
Later on in the function there is this bit of code:
Code: Select all
scene::IMesh * additional_mesh = quakeLevelMesh->getMesh ( scene::quake3::E_Q3_MESH_ITEMS );
for ( i = 0; i!= additional_mesh->getMeshBufferCount (); ++i )
{
scene::IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i );
const video::SMaterial &material = meshBuffer->getMaterial();
//! The ShaderIndex is stored in the material parameter
s32 shaderIndex = (s32) material.MaterialTypeParam2;
// the meshbuffer can be rendered without additional support, or it has no shader
const scene::quake3::IShader *shader = quakeLevelMesh->getShader ( shaderIndex );
if ( 0 == shader )
{
continue;
}
// Now add the MeshBuffer(s) with the current Shader to the Manager
sm->addQuake3SceneNode ( meshBuffer, shader );
}
I guess every fire and lava mesh has it’s own buffer so that is where the for loop comes into place. (is this true?)
I have no idea what the code after that does though. All I know is that if I mess with it the flames and lava don’t get rendered. shaderIndex stores a value (the shader ID?) from ‘material’, but why is MaterialTypeParam2 used instead of MaterialTypeParam? Or better, how do I know which one to use?
After that shader is made. But what does it do? I know that the highlights on the walls in the map are done with the editing of the texture, so the shader doesn’t do anything there. I’ve searched around on the internet and I found this: http://www.heppler.com/shader/, but that doesn’t really clear things up for me either. Do shaders simply say how the device should render the fire and lava meshes?
Any help is appreciated!