   Shaders and Engine
  Hi!Sorry for my english, but one question:How i must use shaders in engine?For example i created simple Diffuse Light, what next?I must create separated Class for this type of light?and have i need to create separeted class for each effect?Thanks a lot.   
  Is this in DirectX or OpenGL?   ;  DirectX and HLSL;  You have to create an ID3DXEffect, which you can do with the call:D3DXCreateEffectFromFile(mDevice, "VertexShader.fx",NULL, NULL, 0, NULL, &mEffect, &errorBuffer);where mEffect is an ID3DXEffect*, and "VertexShader.fx" is the name of your (in this case) vertex shader.Once the effect is created, you can use it like so:// Renders a indexed list of SVertex as trianglesbool CD3DObj::render(SVertex *vertList, int numVerts, WORD *indexList, int numIndices){assert(mEffect != NULL);unsigned int numPasses = 0; // Used to store the number of render passesint numTris = numIndices / 3; // Number of triangles to render// Set the technique to be usedmEffect->SetTechnique("DiffuseColor");// Begin the current technique// By paramter:// &numPasses -- Address to a unsigned int to be filled with the number of passes in the technique// 0 -- Flag that defines how the effect should save/restore render states.  By passing//zero we say "Save and restore ALL render states"mEffect->Begin(&numPasses, 0);for(unsigned int i = 0; i < numPasses; ++i){// Begin the 'ith' pass on the selected techniquemEffect->BeginPass(i);// Set the flexible vertex formatmDevice->SetFVF(SVertexType);// Render the trianglesmResult = mDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, numVerts, numTris, indexList,  D3DFMT_INDEX16, vertList, sizeof(SVertex));// End the 'ith' passmEffect->EndPass();// Error check -- Make sure that drawing the primitives succeededif(mResult != D3D_OK)return false;}// End the current techniquemEffect->End();return true; // We rendered well}This source code, and much more, can be found here.;  How to use shaders i know :), i didn't know how apply them in enginebecause i must pass different parameters to shader.   