diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-08-11 23:05:19 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-08-11 23:05:19 +0000 |
| commit | 7fc2ee7a7a6b09b4445da334af403872b41a9f63 (patch) | |
| tree | 61b73d771ac4a1563f4f6bc9f152cbd9c2fe0776 /src | |
| parent | Fix rendering failures caused by markers with markerUnits="strokeWidth" (diff) | |
| download | inkscape-7fc2ee7a7a6b09b4445da334af403872b41a9f63.tar.gz inkscape-7fc2ee7a7a6b09b4445da334af403872b41a9f63.zip | |
Fix light vector computation for lighting filters
(bzr r9508.1.57)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/nr-filter-diffuselighting.cpp | 4 | ||||
| -rw-r--r-- | src/display/nr-filter-specularlighting.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/display/nr-filter-diffuselighting.cpp b/src/display/nr-filter-diffuselighting.cpp index d48b6d690..fa925ceae 100644 --- a/src/display/nr-filter-diffuselighting.cpp +++ b/src/display/nr-filter-diffuselighting.cpp @@ -94,7 +94,7 @@ struct DiffusePointLight : public DiffuseLight { guint32 operator()(int x, int y) { NR::Fvector light; - _light.light_vector(light, _x0 + x, _y0 + y, alphaAt(x, y)/255.0); + _light.light_vector(light, _x0 + x, _y0 + y, _scale * alphaAt(x, y)/255.0); return diffuseLighting(x, y, light, _light_components); } private: @@ -114,7 +114,7 @@ struct DiffuseSpotLight : public DiffuseLight { guint32 operator()(int x, int y) { NR::Fvector light, light_components; - _light.light_vector(light, _x0 + x, _y0 + y, alphaAt(x, y)/255.0); + _light.light_vector(light, _x0 + x, _y0 + y, _scale * alphaAt(x, y)/255.0); _light.light_components(light_components, light); return diffuseLighting(x, y, light, light_components); } diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp index 758b28979..8ea99562e 100644 --- a/src/display/nr-filter-specularlighting.cpp +++ b/src/display/nr-filter-specularlighting.cpp @@ -103,7 +103,7 @@ struct SpecularPointLight : public SpecularLight { guint32 operator()(int x, int y) { NR::Fvector light, halfway; - _light.light_vector(light, _x0 + x, _y0 + y, alphaAt(x, y)/255.0); + _light.light_vector(light, _x0 + x, _y0 + y, _scale * alphaAt(x, y)/255.0); NR::normalized_sum(halfway, light, NR::EYE_VECTOR); return specularLighting(x, y, halfway, _light_components); } @@ -125,7 +125,7 @@ struct SpecularSpotLight : public SpecularLight { guint32 operator()(int x, int y) { NR::Fvector light, halfway, light_components; - _light.light_vector(light, _x0 + x, _y0 + y, alphaAt(x, y)/255.0); + _light.light_vector(light, _x0 + x, _y0 + y, _scale * alphaAt(x, y)/255.0); _light.light_components(light_components, light); NR::normalized_sum(halfway, light, NR::EYE_VECTOR); return specularLighting(x, y, halfway, light_components); |
