Skip to content

Commit 3161b94

Browse files
committed
[opencl] Global transparency
1 parent 5129dcf commit 3161b94

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

resources/opencl_programs/hillshade.cl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ __kernel void processNineCellWindow( __global float *scanLine1,
66
__global float *scanLine3,
77
__global uchar4 *resultLine, // This is an image BGRA !
88
__global float *rasterParams // [ mInputNodataValue, mOutputNodataValue, mZFactor, mCellSizeX, mCellSizeY,
9-
// azimuthRad, cosZenithRad, sinZenithRad ]
9+
// azimuthRad, cosZenithRad, sinZenithRad, mOpacity ]
1010

1111
) {
1212

@@ -31,7 +31,7 @@ __kernel void processNineCellWindow( __global float *scanLine1,
3131
float res;
3232
if ( derX == rasterParams[1] || derY == rasterParams[1] )
3333
{
34-
res = rasterParams[1];
34+
res = 255.0f;
3535
}
3636
else
3737
{
@@ -49,6 +49,9 @@ __kernel void processNineCellWindow( __global float *scanLine1,
4949

5050
}
5151

52-
resultLine[i] = (uchar4)(res, res, res, 255);
52+
// Opacity
53+
res = res * rasterParams[7];
54+
55+
resultLine[i] = (uchar4)(res, res, res, 255 * rasterParams[7]);
5356

5457
}

0 commit comments

Comments
 (0)