4 * Copyright (C) 2021 Leonid Kostrykin
8 uniform sampler3D mask;
9 uniform mat4 modelTexture;
10 uniform bool ignoreColor;
13 in vec4 modelSpaceCoordinates;
15 out vec4 gl_FragColor;
18 // ----------------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------------
24 if( abs( modelSpaceCoordinates.x ) > 0.5 || abs( modelSpaceCoordinates.y ) > 0.5 || abs( modelSpaceCoordinates.z ) > 0.5 )
29 vec4 textureCoordinates = modelTexture * modelSpaceCoordinates;
30 float intensity = texture( mask, textureCoordinates.xyz ).r;
35 gl_FragColor = vec4( intensity, 0, 0, 1.0 );
39 gl_FragColor = vec4( color );