Beispiel #1
0
void NormalBlendMap::ComputeAverage (const Vector3d& EPoint, Vector3d& normal, Intersection *Inter, const Ray *ray, TraceThreadData *Thread)
{
    SNGL Value;
    SNGL Total = 0.0;
    Vector3d V1,V2;

    POV_BLEND_MAP_ASSERT(Type == kBlendMapType_Normal);

    V1 = Vector3d(0.0, 0.0, 0.0);

    for(Vector::const_iterator i = Blend_Map_Entries.begin(); i != Blend_Map_Entries.end(); i++)
    {
        Value = i->value;

        V2 = normal;

        Perturb_Normal(V2,i->Vals,EPoint,Inter,ray,Thread);

        V1 += (DBL)Value * V2;

        Total += Value;
    }

    normal = V1 / Total;
}
Beispiel #2
0
void NormalBlendMap::Post(bool dontScaleBumps)
{
    POV_BLEND_MAP_ASSERT(Type == kBlendMapType_Normal);
    for(Vector::iterator i = Blend_Map_Entries.begin(); i != Blend_Map_Entries.end(); i++)
    {
        if (dontScaleBumps)
            i->Vals->Flags |= DONT_SCALE_BUMPS_FLAG;
        Post_Tnormal(i->Vals);
    }
}
Beispiel #3
0
void SlopeBlendMap::Post(bool dontScaleBumps)
{
    POV_BLEND_MAP_ASSERT(Type == kBlendMapType_Slope);
}
Beispiel #4
0
void SlopeBlendMap::ComputeAverage (const Vector3d& EPoint, Vector3d& normal, Intersection *Inter, const Ray *ray, TraceThreadData *Thread)
{
    POV_BLEND_MAP_ASSERT(false);
}
Beispiel #5
0
NormalBlendMap::~NormalBlendMap()
{
    POV_BLEND_MAP_ASSERT(Type == kBlendMapType_Normal);
    for (Vector::iterator i = Blend_Map_Entries.begin(); i != Blend_Map_Entries.end(); i++)
        Destroy_Tnormal(i->Vals);
}
Beispiel #6
0
SlopeBlendMap::~SlopeBlendMap()
{
    POV_BLEND_MAP_ASSERT(Type == kBlendMapType_Slope);
}
Beispiel #7
0
TextureBlendMapPtr Create_Blend_Map<TextureBlendMap> (BlendMapTypeId type)
{
    POV_BLEND_MAP_ASSERT(type == kBlendMapType_Texture);
    return TextureBlendMapPtr (new TextureBlendMap);
}
Beispiel #8
0
NormalBlendMapPtr Create_Blend_Map<NormalBlendMap> (BlendMapTypeId type)
{
    POV_BLEND_MAP_ASSERT(type == kBlendMapType_Normal);
    return NormalBlendMapPtr (new NormalBlendMap());
}
Beispiel #9
0
SlopeBlendMapPtr Create_Blend_Map<SlopeBlendMap> (BlendMapTypeId type)
{
    POV_BLEND_MAP_ASSERT(type == kBlendMapType_Slope);
    return SlopeBlendMapPtr (new SlopeBlendMap());
}
Beispiel #10
0
PigmentBlendMapPtr Create_Blend_Map<PigmentBlendMap> (BlendMapTypeId type)
{
    POV_BLEND_MAP_ASSERT((type == kBlendMapType_Pigment) || (type == kBlendMapType_Density));
    return PigmentBlendMapPtr (new PigmentBlendMap(type));
}
Beispiel #11
0
ColourBlendMapPtr Create_Blend_Map<ColourBlendMap> (BlendMapTypeId type)
{
    POV_BLEND_MAP_ASSERT(type == kBlendMapType_Colour);
    return ColourBlendMapPtr (new ColourBlendMap);
}