vec4 properties = texelFetch(propertiesSampler, ivec2(floor(pixelIndex)), 0);

int castedA = int(ceil(clamp(properties.a, 0., 1.) * 255.0));
#ifdef depthWriteIgnoresVisibilityProperty
    int lastBitMask = 1; // Depth write bit
    int depthWriteIgnoresVisibilityValue = castedA & lastBitMask;
    bool depthWriteIgnoresVisibility = depthWriteIgnoresVisibilityValue == lastBitMask;
#endif

#ifdef visibilityProperty
    int secondLastBitMask = 2; // Visibility bit
    int visibilityValue = castedA & secondLastBitMask;
    bool visible = visibilityValue == secondLastBitMask;
#endif

#ifdef highlightProperty
    int fourthAndThirdLastBitsMask = 12; // Highlight bits
    int highlightIndex = (castedA & fourthAndThirdLastBitsMask) >> 2; // Move 2 bits right to get 0-3 range
    bool highlighted = highlightIndex != 0;
#endif

#ifdef outlinedProperty
    int fifthBitMask = 16; // Outline bit
    int outlinedValue = castedA & fifthBitMask;
    bool outlined = outlinedValue == fifthBitMask;
#endif

#ifdef ignoreClipPlanesProperty
    int sixthBitMask = 32; // Clip plane ignore bit
    int clipPlaneIgnoreValue = castedA & sixthBitMask;
    bool clipPlaneIgnore = clipPlaneIgnoreValue == sixthBitMask;
#endif

