Ejemplo n.º 1
0
	EDBVH* EDBVH::Load(const char* pInFileName)
	{
		string temp = ContentManager::theContentPath;
		temp += pInFileName;
		const char* fileName = temp.c_str();

		ContentHandle<GDMeshStreamBinary> meshHandle = ContentManager::Load<GDMeshStreamBinary>(fileName);
			
		ContentHandle<GDAttribute<Point>> pointHandle = meshHandle.GetContent()->ReadAttribute<Point>();
		size_t numVerts = pointHandle.GetContent()->size();

		ContentHandle<GDAttribute<TriVertIndices>> indicesHandle = meshHandle.GetContent()->GetIndicesHandle();

		return BuildBVH( &pointHandle.GetContent()->operator[](0), (unsigned int)numVerts, indicesHandle.GetContent()->operator[](0).indices, (unsigned int)indicesHandle.GetContent()->size() );
	}
Ejemplo n.º 2
0
	void PostProcessWater::LoadXML(const char* xmlFileName)
	{
		ContentHandle<RenderMaterial> materialHandle = ContentManager::LoadXML<RenderMaterial>( xmlFileName );

		if(materialHandle.GetContent() != NULL)
			renderMaterialHandle = materialHandle;
	}
Ejemplo n.º 3
0
void RenderController::Initialize(UINT viewPorts)
{
	CreateContexts();
	CreateLights();
	CreateGBuffers();
	CreateDepthBuffers();
	CreateSceneTargetsAndViewPorts(viewPorts);
	CreatePostProcessEffects();
	InitializeConsoleCommands();

	// Set up an initial shape to be used for visibility queries
	ContentHandle<RenderForm> occlusionFormHandle = ContentManager::GetInstance()->LoadXML<RenderForm>(
		"GDForm/unitcube/pCube1/pCubeShape1/frm_Occlusion_Box.xml" );
	VisibilityQueryInterface::theShapePtr = occlusionFormHandle.GetContent()->GetNewRenderShape();
	vector< ContentHandle<RenderForm> > formHandles;
	formHandles.push_back(occlusionFormHandle);
	VisibilityQueryInterface::theShapePtr->Initialize(formHandles);

	InputManager::GetReference().AddKeyTrigger('1', INPUT_PRESSED, "RenderDepths");
	EventManager::GetInstance()->RegisterForEvent("RenderDepths", 0, OnRenderDepthCallback);
	InputManager::GetReference().AddKeyTrigger('2', INPUT_PRESSED, "RenderDiffuse");
	EventManager::GetInstance()->RegisterForEvent("RenderDiffuse", 0, OnRenderDiffuseCallback);
	InputManager::GetReference().AddKeyTrigger('3', INPUT_PRESSED, "RenderNormals");
	EventManager::GetInstance()->RegisterForEvent("RenderNormals", 0, OnRenderNormalCallback);
	InputManager::GetReference().AddKeyTrigger('4', INPUT_PRESSED, "RenderSpecular");
	EventManager::GetInstance()->RegisterForEvent("RenderSpecular", 0, OnRenderSpecularCallback);
	InputManager::GetReference().AddKeyTrigger('5', INPUT_PRESSED, "RenderShadow");
	EventManager::GetInstance()->RegisterForEvent("RenderShadow", 0, OnRenderDirShadowCallback);
}