Fixed shadows warnings

This commit is contained in:
Robert Osfield
2016-05-26 11:13:56 +01:00
parent 80e318ce15
commit dbce12842e
12 changed files with 50 additions and 56 deletions

View File

@@ -500,9 +500,9 @@ osg::Image* createSpotLightImage(const osg::Vec4& centerColour, const osg::Vec4&
{
float dx = (float(c) - mid)*div;
float dy = (float(r) - mid)*div;
float r = powf(1.0f - sqrtf(dx*dx + dy*dy), power);
if (r < 0.0f) r = 0.0f;
osg::Vec4 color = centerColour*r + backgroudColour*(1.0f - r);
float pr = powf(1.0f - sqrtf(dx*dx + dy*dy), power);
if (pr < 0.0f) pr = 0.0f;
osg::Vec4 color = centerColour*pr + backgroudColour*(1.0f - pr);
*ptr++ = (unsigned char)((color[0])*255.0f);
*ptr++ = (unsigned char)((color[1])*255.0f);
*ptr++ = (unsigned char)((color[2])*255.0f);