示例#1
0
plLayer& plLayer::InitToDefault()
{
    fState->Reset();

    *fTexture = nil;

    SetRuntimeColor(hsColorRGBA().Set(0.5f, 0.5f, 0.5f, 1.f));
    SetPreshadeColor(hsColorRGBA().Set(0.5f, 0.5f, 0.5f, 1.f));
    SetAmbientColor(hsColorRGBA().Set(0,0,0,1.f));
    SetOpacity(1.f);

    fTransform->Reset();

    SetUVWSrc(0);
    SetLODBias(-1.f);
    SetSpecularColor( hsColorRGBA().Set(0,0,0,1.f));
    SetSpecularPower(1.f);

    *fVertexShader = nil;
    *fPixelShader = nil;

    fBumpEnvXfm->Reset();

    return *this;
}
示例#2
0
distantLight::distantLight(const vector &d, const rgb &dc, const rgb &sc, const rgb &ac, bool shad)
{ 
	SetDirection(d); 
	SetAmbientColor(ac); 
	SetDiffuseColor(dc); 
	SetSpecularColor(sc); 
	canShadow = shad; 
}
示例#3
0
pointLight::pointLight(const point &p, const rgb &dc, const rgb &sc, const rgb &ac, 
					   double cAtten, double lAtten, double qAtten)
{ 
	hasPosition = true;
	SetPosition(p); 
	SetAmbientColor(ac); 
	SetDiffuseColor(dc); 
	SetSpecularColor(sc); 
	SetAttenuations(cAtten, lAtten, qAtten); 
}
示例#4
0
spotLight::spotLight(const point &p, const rgb &sc, const point &Target, 
					 double InnerThet, double OuterThet,
					 double cAtten, double lAtten, double qAtten)
{
	hasPosition = true;
	SetPosition(p);
	SetTarget(Target);
	SetSpecularColor(sc);
	SetAttenuations(cAtten, lAtten, qAtten);
	SetAngleLimits(InnerThet, OuterThet);
}
示例#5
0
	// Create.
	MapilVoid GLDirectionalLight::Create(	const ColorARGB < MapilFloat32 >& colorDiffuse,
											const ColorARGB < MapilFloat32 >& colorAmbient,
											const ColorARGB < MapilFloat32 >& colorSpecular,
											const Vector3 < MapilFloat32 >& vDir,
											MapilFloat32 attenuation0, MapilFloat32 attenuation1, MapilFloat32 attenuation2 )
	{
		SetDiffuseColor( colorDiffuse );
		SetAmbientColor( colorAmbient );
		SetSpecularColor( colorSpecular );
		SetDirection( vDir );
		SetAttenuation( attenuation0, attenuation1, attenuation2 );
	}
示例#6
0
mitk::Material::Material(  )
{
  InitializeStandardValues();
  SetColor( GetColor() );
  SetColorCoefficient( GetColorCoefficient() );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( GetSpecularCoefficient() );
  SetSpecularPower( GetSpecularPower() );
  SetOpacity( GetOpacity() );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
}
示例#7
0
mitk::Material::Material( mitk::Material::Color color, vtkFloatingPointType colorCoefficient, vtkFloatingPointType specularCoefficient, vtkFloatingPointType specularPower, vtkFloatingPointType opacity )
{
  InitializeStandardValues();
  SetColor( color );
  SetColorCoefficient( colorCoefficient );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( specularCoefficient );
  SetSpecularPower( specularPower );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
}
示例#8
0
mitk::Material::Material( vtkFloatingPointType red, vtkFloatingPointType green, vtkFloatingPointType blue, vtkFloatingPointType opacity )
{
  InitializeStandardValues();
  SetColor( red, green, blue );
  SetColorCoefficient( GetColorCoefficient() );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( GetSpecularCoefficient() );
  SetSpecularPower( GetSpecularPower() );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
  m_Name = "";
}
示例#9
0
文件: mitkMaterial.cpp 项目: 0r/MITK
mitk::Material::Material( Color color, double opacity )
{
  InitializeStandardValues();
  SetColor( color );
  SetColorCoefficient( GetColorCoefficient() );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( GetSpecularCoefficient() );
  SetSpecularPower( GetSpecularPower() );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
  m_Name = "";
}
示例#10
0
文件: mitkMaterial.cpp 项目: 0r/MITK
mitk::Material::Material( double red, double green, double blue,
    double colorCoefficient, double specularCoefficient,
    double specularPower, double opacity )
{
  InitializeStandardValues();
  SetColor( red, green, blue );
  SetColorCoefficient( colorCoefficient );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( specularCoefficient );
  SetSpecularPower( specularPower );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
  m_Name = "";
}
示例#11
0
void plLayer::CloneNoTexture( plLayerInterface *original )
{
    SetBlendFlags( original->GetBlendFlags() );
    SetClampFlags( original->GetClampFlags() );
    SetShadeFlags( original->GetShadeFlags() );
    SetZFlags( original->GetZFlags() );
    SetMiscFlags( original->GetMiscFlags() );
    SetState( original->GetState() );

    SetPreshadeColor( original->GetPreshadeColor() );
    SetRuntimeColor( original->GetRuntimeColor() );
    SetAmbientColor( original->GetAmbientColor() );
    SetSpecularColor( original->GetSpecularColor() );
    SetOpacity( original->GetOpacity() );
    SetTransform( original->GetTransform() );
    SetUVWSrc( original->GetUVWSrc() );
    SetLODBias( original->GetLODBias() );
    SetSpecularPower( original->GetSpecularPower() );

    SetVertexShader( original->GetVertexShader() );
    SetPixelShader( original->GetPixelShader() );
    SetBumpEnvMatrix( original->GetBumpEnvMatrix() );
}
示例#12
0
	// Create.
	MapilVoid D3DPointLight::Create(	const ColorARGB < MapilFloat32 >& colorDiffuse,
										const ColorARGB < MapilFloat32 >& colorAmbient,
										const ColorARGB < MapilFloat32 >& colorSpecular,
										const Vector3 < MapilFloat32 >& vPos,
										MapilFloat32 attenuation0, MapilFloat32 attenuation1, MapilFloat32 attenuation2 )
	{
		Assert( !m_IsUsed, CURRENT_POSITION, TSTR( "The point light was already created." ), -1 );

		m_LightIndex = AttachLightIndex();

		Assert(	m_LightIndex != -1, CURRENT_POSITION, TSTR( "Reached max light index." ), -2 );

		m_IsUsed = MapilTrue;

		//Type of light
		m_D3DLight.Type = ::D3DLIGHT_POINT;
		SetDiffuseColor( colorDiffuse );
		SetAmbientColor( colorAmbient );
		SetSpecularColor( colorSpecular );
		SetPosition( vPos );

		m_D3DLight.Range = 100.0f;
	}
示例#13
0
void FbxMaterial::AddProperty(const FbxProperty &property,
                           const FbxProperty &factor_property)
{




    /**
    *If we are dealing with an invalid properties, abort
    */
    if (!property.IsValid() || !factor_property.IsValid())
        return;




    /**
     *Get the name of the property
     */
    QString property_name = property.GetNameAsCStr();


    /**
    *Based on the property's name, load required stuff
    */
    if (property_name == FbxSurfaceMaterial::sDiffuse)
    {



        /**
         *Get the diffuse color and intensity
         */
        FbxDouble3 diffuse_color = property.Get<FbxDouble3>();
        FbxDouble diffuse_intensity = factor_property.Get<FbxDouble>();



        /**
         *Set diffuse color and intensity
         */
        SetDiffuseColor(aae::mesh_util::QVector3DFromFbxVector3D(diffuse_color));
        SetDiffuseIntensity(diffuse_intensity);




        /**
        *If there are no textures attached to the property, return
        */
        if(!property.GetSrcObjectCount<FbxFileTexture>() > 0)
            return;



        /**
         *Get the texture handler
         */
        FbxFileTexture * texture = property.GetSrcObject<FbxFileTexture>();
        if (!texture)
            return;



        /**
        *Add the diffuse texture name of the material
        */
        AddTexture(diffuse, texture->GetFileName());


    }
    else if (property_name == FbxSurfaceMaterial::sNormalMap)
    {


        /**
        *If there are no textures attached to the property, return
        */
        if(!property.GetSrcObjectCount<FbxFileTexture>() > 0)
            return;


        /**
         *Get the texture handler
         */
        FbxFileTexture * texture = property.GetSrcObject<FbxFileTexture>();
        if (!texture)
            return;


        /**
        *Set normal map texture of the material
        */
        AddTexture(normal, texture->GetFileName());


    }
    else if (property_name == FbxSurfaceMaterial::sSpecular)
    {


        /**
         *Get the specular color and intensity
         */
        FbxDouble3 specular_color = property.Get<FbxDouble3>();
        FbxDouble specular_intensity = factor_property.Get<FbxDouble>();



        /**
        *Set the specular color and intensity
        */
        SetSpecularColor(aae::mesh_util::QVector3DFromFbxVector3D(specular_color));
        SetSpecularIntensity(specular_intensity);



    }
    else if (property_name == FbxSurfaceMaterial::sShininess)
    {


        /**
         *Get and set specular hardness
         */
        FbxDouble specular_hardness = property.Get<FbxDouble>();
        SetSpecularHardness(specular_hardness);


    }





}