Skip to content

Commit

Permalink
[opencl] Global transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Aug 8, 2018
1 parent 5129dcf commit 3161b94
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions resources/opencl_programs/hillshade.cl
Expand Up @@ -6,7 +6,7 @@ __kernel void processNineCellWindow( __global float *scanLine1,
__global float *scanLine3,
__global uchar4 *resultLine, // This is an image BGRA !
__global float *rasterParams // [ mInputNodataValue, mOutputNodataValue, mZFactor, mCellSizeX, mCellSizeY,
// azimuthRad, cosZenithRad, sinZenithRad ]
// azimuthRad, cosZenithRad, sinZenithRad, mOpacity ]

) {

Expand All @@ -31,7 +31,7 @@ __kernel void processNineCellWindow( __global float *scanLine1,
float res;
if ( derX == rasterParams[1] || derY == rasterParams[1] )
{
res = rasterParams[1];
res = 255.0f;
}
else
{
Expand All @@ -49,6 +49,9 @@ __kernel void processNineCellWindow( __global float *scanLine1,

}

resultLine[i] = (uchar4)(res, res, res, 255);
// Opacity
res = res * rasterParams[7];

resultLine[i] = (uchar4)(res, res, res, 255 * rasterParams[7]);

}

0 comments on commit 3161b94

Please sign in to comment.