Skip to content

Commit

Permalink
Fixed spotlight colour mixing
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Mar 24, 2018
1 parent 097d3ab commit 88b7526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/osgspotlight/osgspotlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ osg::Image* createSpotLightImage(const osg::Vec4& centerColour, const osg::Vec4&
float dy = (float(r) - mid)*div;
float pr = powf(1.0f-sqrtf(dx*dx+dy*dy),power);
if (pr<0.0f) pr=0.0f;
osg::Vec4 color = centerColour*r+backgroudColour*(1.0f-pr);
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);
Expand Down

0 comments on commit 88b7526

Please sign in to comment.