Esempio n. 1
0
//*******************************************************************************
void CWaterEnvMap::renderTestMesh(IDriver &driver)
{
	doInit();
	CMaterial testMat;
	testMat.setLighting(false);
	testMat.texEnvOpRGB(0, CMaterial::Modulate);
	testMat.texEnvArg0RGB(0, CMaterial::Texture, CMaterial::SrcColor);
	testMat.texEnvArg0RGB(1, CMaterial::Diffuse, CMaterial::SrcColor);
	testMat.texEnvOpAlpha(0, CMaterial::Replace);
	testMat.texEnvArg0Alpha(0, CMaterial::Constant, CMaterial::SrcAlpha);
	testMat.texConstantColor(0, CRGBA(255, 255, 255, 255));
	testMat.setDoubleSided(true);
	testMat.setZWrite(false);
	testMat.setZFunc(CMaterial::always);
	// tmp : test cubemap
	driver.activeVertexProgram(&testMeshVP);
	driver.activeVertexBuffer(_TestVB);
	driver.activeIndexBuffer(_TestIB);
	driver.setConstantMatrix(0, IDriver::ModelViewProjection, IDriver::Identity); // tmp
	_MaterialPassThruZTest.setTexture(0, _EnvCubic);
	driver.setConstantMatrix(0, IDriver::ModelViewProjection, IDriver::Identity);
	driver.setConstant(4, 2.f, 1.f, 0.f, 0.f);
	//driver.renderTriangles(testMat, 0, TEST_VB_NUM_TRIS);
	driver.renderTriangles(_MaterialPassThruZTest, 0, TEST_VB_NUM_TRIS);
	driver.activeVertexProgram(NULL);
}