Example #1
0
void mitk::GPUVolumeMapper3D::GenerateDataRAY( mitk::BaseRenderer *renderer )
{
  LocalStorage *ls = m_LSH.GetLocalStorage(renderer);

  if( IsLODEnabled(renderer) && mitk::RenderingManager::GetInstance()->GetNextLOD( renderer ) == 0 )
    ls->m_MapperRAY->SetImageSampleDistance(4.0);
  else
    ls->m_MapperRAY->SetImageSampleDistance(1.0);

  // Check raycasting mode
  if(IsMIPEnabled(renderer))
    ls->m_MapperRAY->SetBlendModeToMaximumIntensity();
  else
    ls->m_MapperRAY->SetBlendModeToComposite();

  // Updating shadings
  {
    float value=0;
    if(GetDataNode()->GetFloatProperty("volumerendering.ray.ambient",value,renderer))
      ls->m_VolumePropertyRAY->SetAmbient(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.ray.diffuse",value,renderer))
      ls->m_VolumePropertyRAY->SetDiffuse(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.ray.specular",value,renderer))
      ls->m_VolumePropertyRAY->SetSpecular(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.ray.specular.power",value,renderer))
      ls->m_VolumePropertyRAY->SetSpecularPower(value);
  }

}
Example #2
0
	bool BMaxObject::UpdateModel(SceneState * sceneState /*= NULL*/)
	{
		if (!m_pAnimatedMesh)
			return false;
		int nIndex = (sceneState && IsLODEnabled()) ? m_pAnimatedMesh->GetLodIndex(sceneState->GetCameraToCurObjectDistance()/*, GetScaling()*/) : 0;
		CParaXModel* pModel = m_pAnimatedMesh->GetModel(nIndex);
		
		if (pModel == NULL)
			return false;
		// just a single standing animation is supported now and looped. 
		if (!m_CurrentAnim.IsValid())
			m_CurrentAnim = pModel->GetAnimIndexByID(0);
		if (m_CurrentAnim.IsValid() && IsAnimEnabled())
		{
			int nAnimLength = std::max(1, m_CurrentAnim.nEndFrame - m_CurrentAnim.nStartFrame);
			int nToDoFrame = (m_CurrentAnim.nCurrentFrame + (int)(sceneState->dTimeDelta * 1000)) % nAnimLength;
			m_CurrentAnim.nCurrentFrame = nToDoFrame;
		}
		pModel->m_CurrentAnim = m_CurrentAnim;
		pModel->m_NextAnim.nIndex = 0;
		pModel->m_BlendingAnim.MakeInvalid();
		pModel->blendingFactor = 0;
		pModel->animate(sceneState, NULL, GetAnimInstanceFields());
		return true;
	}
Example #3
0
void mitk::GPUVolumeMapper3D::GenerateDataGPU( mitk::BaseRenderer *renderer )
{
  LocalStorage *ls = m_LSH.GetLocalStorage(renderer);

  bool useCompression = false;
  GetDataNode()->GetBoolProperty("volumerendering.gpu.usetexturecompression",useCompression,renderer);
  ls->m_MapperGPU->SetUseCompressedTexture(useCompression);

  if( IsLODEnabled(renderer) && mitk::RenderingManager::GetInstance()->GetNextLOD( renderer ) == 0 )
    ls->m_MapperGPU->SetSampleDistance(2.0);
  else
    ls->m_MapperGPU->SetSampleDistance(1.0);

  // Updating shadings
  {
    float value=0;
    if(GetDataNode()->GetFloatProperty("volumerendering.gpu.ambient",value,renderer))
      ls->m_VolumePropertyGPU->SetAmbient(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.gpu.diffuse",value,renderer))
      ls->m_VolumePropertyGPU->SetDiffuse(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.gpu.specular",value,renderer))
      ls->m_VolumePropertyGPU->SetSpecular(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.gpu.specular.power",value,renderer))
      ls->m_VolumePropertyGPU->SetSpecularPower(value);
  }
}
void FAnimNode_SkeletalControlBase::Update(const FAnimationUpdateContext& Context)
{
	ComponentPose.Update(Context);

	ActualAlpha = 0.f;
	if (IsLODEnabled(Context.AnimInstanceProxy, LODThreshold))
	{
		EvaluateGraphExposedInputs.Execute(Context);

		// Apply the skeletal control if it's valid
		ActualAlpha = AlphaScaleBias.ApplyTo(Alpha);
		if (FAnimWeight::IsRelevant(ActualAlpha) && IsValidToEvaluate(Context.AnimInstanceProxy->GetSkeleton(), Context.AnimInstanceProxy->GetRequiredBones()))
		{
			UpdateInternal(Context);
		}
	}
}
void FAnimNode_ApplyMeshSpaceAdditive::Update(const FAnimationUpdateContext& Context)
{
	Base.Update(Context);

	ActualAlpha = 0.f;
	if (IsLODEnabled(Context.AnimInstanceProxy, LODThreshold))
	{
		// @note: If you derive this class, and if you have input that you rely on for base
		// this is not going to work	
		EvaluateGraphExposedInputs.Execute(Context);
		ActualAlpha = AlphaScaleBias.ApplyTo(Alpha);
		if (FAnimWeight::IsRelevant(ActualAlpha))
		{
			Additive.Update(Context.FractionalWeight(ActualAlpha));
		}
	}
}
void FAnimNode_AimOffsetLookAt::UpdateAssetPlayer(const FAnimationUpdateContext& Context)
{
    EvaluateGraphExposedInputs.Execute(Context);

    bIsLODEnabled = IsLODEnabled(Context.AnimInstanceProxy, LODThreshold);

    // We don't support ticking and advancing time, because Inputs are determined during Evaluate.
    // it may be possible to advance time there (is it a problem with notifies?)
    // But typically AimOffsets contain single frame poses, so time doesn't matter.

// 	if (bIsLODEnabled)
// 	{
// 		FAnimNode_BlendSpacePlayer::UpdateAssetPlayer(Context);
// 	}

    BasePose.Update(Context);
}
Example #7
0
void mitk::GPUVolumeMapper3D::GenerateDataCPU( mitk::BaseRenderer *renderer )
{
  LocalStorage *ls = m_LSH.GetLocalStorage(renderer);

  int nextLod = mitk::RenderingManager::GetInstance()->GetNextLOD( renderer );

  if( IsLODEnabled(renderer) && nextLod == 0 )
  {
    ls->m_MapperCPU->SetImageSampleDistance(3.5);
    ls->m_MapperCPU->SetSampleDistance(1.25);
    ls->m_VolumePropertyCPU->SetInterpolationTypeToNearest();
  }
  else
  {
    ls->m_MapperCPU->SetImageSampleDistance(1.0);
    ls->m_MapperCPU->SetSampleDistance(1.0);
    ls->m_VolumePropertyCPU->SetInterpolationTypeToLinear();
  }

  // Check raycasting mode
  if(IsMIPEnabled(renderer))
    ls->m_MapperCPU->SetBlendModeToMaximumIntensity();
  else
    ls->m_MapperCPU->SetBlendModeToComposite();

  // Updating shadings
  {
    float value=0;
    if(GetDataNode()->GetFloatProperty("volumerendering.cpu.ambient",value,renderer))
      ls->m_VolumePropertyCPU->SetAmbient(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.cpu.diffuse",value,renderer))
      ls->m_VolumePropertyCPU->SetDiffuse(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.cpu.specular",value,renderer))
      ls->m_VolumePropertyCPU->SetSpecular(value);
    if(GetDataNode()->GetFloatProperty("volumerendering.cpu.specular.power",value,renderer))
      ls->m_VolumePropertyCPU->SetSpecularPower(value);
  }
}