コード例 #1
0
bool mrGeomShaderObject::UpdateDisplay(
	const MaxSDK::Graphics::MaxContext& maxContext, 
	const MaxSDK::Graphics::UpdateDisplayContext& displayContext)
{
	// create a mesh to display (leave it in cache)
	UpdateMesh(displayContext.GetDisplayTime());

	using namespace MaxSDK::Graphics;

	GenerateMeshRenderItemsContext generateRenderItemsContext;
	generateRenderItemsContext.GenerateDefaultContext(displayContext);

	m_mesh.GenerateRenderItems(mRenderItemHandles,generateRenderItemsContext);
	return true;
}
コード例 #2
0
ファイル: tripatch.cpp プロジェクト: artemeliy/inf4715
bool TriPatchObject::UpdateDisplay(
	const MaxSDK::Graphics::MaxContext& maxContext, 
	const MaxSDK::Graphics::UpdateDisplayContext& displayContext)
{
	// create a mesh to display (leave it in cache)
	PrepareMesh(displayContext.GetDisplayTime());
	Mesh& mesh = patch.GetMesh();
	if(mesh.getNumVerts()>0)
	{
		using namespace MaxSDK::Graphics;

		GenerateMeshRenderItemsContext generateRenderItemsContext;
		generateRenderItemsContext.GenerateDefaultContext(displayContext);

		mesh.GenerateRenderItems(mRenderItemHandles,generateRenderItemsContext);
		return true ;
	}

	return false;
}
コード例 #3
0
bool GPUParticle::PrepareDisplay(const MaxSDK::Graphics::UpdateDisplayContext& displayContext)
{
	if (nullptr == mpParticleItem)
	{
		MaxSDK::Graphics::DeviceCaps caps;
		GetIDisplayManager()->GetDeviceCaps(caps);
		if (caps.FeatureLevel != Level5_0)
		{
			return false;
		}
		mpParticleItem = new ParticleRenderer;
	}

	TimeValue t = displayContext.GetDisplayTime();
	pblock2->GetValue(GPUParticle_radius, t, mRadius, ivalid );
	pblock2->GetValue(GPUParticle_count, t, mCount, ivalid );

	mpParticleItem->Radius(mRadius);
	mpParticleItem->Count(mCount);

	return true;
}
コード例 #4
0
ファイル: tripatch.cpp プロジェクト: innovatelogic/ilogic-vm
bool TriPatchObject::PrepareDisplay(const MaxSDK::Graphics::UpdateDisplayContext& prepareDisplayContext)
{
	PrepareMesh(prepareDisplayContext.GetDisplayTime());
	Mesh& mesh = patch.GetMesh();
	if(mesh.getNumVerts()>0)
	{
		using namespace MaxSDK::Graphics;

		mRenderItemHandles.ClearAllRenderItems();		
		IMeshDisplay2* pMeshDisplay = static_cast<IMeshDisplay2*>(mesh.GetInterface(IMesh_DISPLAY2_INTERFACE_ID));
		if (NULL == pMeshDisplay)
		{
			return false;
		}

		GenerateMeshRenderItemsContext generateMeshRenderItemsContext;
		generateMeshRenderItemsContext.GenerateDefaultContext(prepareDisplayContext);
		pMeshDisplay->PrepareDisplay(generateMeshRenderItemsContext);

		return true ;
	}

	return false;
}