Skip to content

Commit a6809b8

Browse files
authored
Fix Casting error that occurred on certain GPUs (#2274)
Fix Casting error that occurred on certain GPUs
1 parent 2c877fe commit a6809b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jme3-terrain/src/main/resources/Common/MatDefs/Terrain/AdvancedPBRTerrain.frag

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void main(){
259259
alphaBlend = alphaBlend_2;
260260
}
261261

262-
texChannelForAlphaBlending = int(mod($i, 4.0)); //pick the correct channel (r g b or a) based on the layer's index
262+
texChannelForAlphaBlending = int(mod(float($i), 4.0)); //pick the correct channel (r g b or a) based on the layer's index
263263
switch(texChannelForAlphaBlending) {
264264
case 0:
265265
finalAlphaBlendForLayer = alphaBlend.r;

jme3-terrain/src/main/resources/Common/MatDefs/Terrain/PBRTerrain.frag

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void main(){
246246
alphaBlend = alphaBlend_2;
247247
}
248248

249-
texChannelForAlphaBlending = int(mod($i, 4.0)); //pick the correct channel (r g b or a) based on the layer's index
249+
texChannelForAlphaBlending = int(mod(float($i), 4.0)); //pick the correct channel (r g b or a) based on the layer's index
250250
switch(texChannelForAlphaBlending) {
251251
case 0:
252252
finalAlphaBlendForLayer = alphaBlend.r;

0 commit comments

Comments
 (0)