|
@@ -28,28 +28,30 @@ export default `
|
|
|
if (ta < uPickingAlphaThreshold)
|
|
|
discard; // ignore so the element below can be picked
|
|
|
#else
|
|
|
- // TODO: only needed when wboit is not available (or not selected?)
|
|
|
- // float at = 0.0;
|
|
|
+ #if defined(dRenderVariant_colorBlended)
|
|
|
+ float at = 0.0;
|
|
|
|
|
|
- // // shift by view-offset during multi-sample rendering to allow for blending
|
|
|
- // vec2 coord = gl_FragCoord.xy + uViewOffset * 0.25;
|
|
|
+ // shift by view-offset during multi-sample rendering to allow for blending
|
|
|
+ vec2 coord = gl_FragCoord.xy + uViewOffset * 0.25;
|
|
|
|
|
|
- // #if defined(dTransparencyVariant_single)
|
|
|
- // const mat4 thresholdMatrix = mat4(
|
|
|
- // 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
|
|
|
- // 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
|
|
|
- // 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
|
|
|
- // 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
|
|
|
- // );
|
|
|
- // at = thresholdMatrix[int(intMod(coord.x, 4.0))][int(intMod(coord.y, 4.0))];
|
|
|
- // #elif defined(dTransparencyVariant_multi)
|
|
|
- // at = fract(dot(vec3(coord, vGroup + 0.5), vec3(2.0, 7.0, 23.0) / 17.0f));
|
|
|
- // #endif
|
|
|
+ #if defined(dTransparencyVariant_single)
|
|
|
+ const mat4 thresholdMatrix = mat4(
|
|
|
+ 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
|
|
|
+ 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
|
|
|
+ 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
|
|
|
+ 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
|
|
|
+ );
|
|
|
+ at = thresholdMatrix[int(intMod(coord.x, 4.0))][int(intMod(coord.y, 4.0))];
|
|
|
+ #elif defined(dTransparencyVariant_multi)
|
|
|
+ at = fract(dot(vec3(coord, vGroup + 0.5), vec3(2.0, 7.0, 23.0) / 17.0f));
|
|
|
+ #endif
|
|
|
|
|
|
- // if (ta < 0.99 && (ta < 0.01 || ta < at)) {
|
|
|
- // discard;
|
|
|
- // }
|
|
|
- material.a *= ta;
|
|
|
+ if (ta < 0.99 && (ta < 0.01 || ta < at)) {
|
|
|
+ discard;
|
|
|
+ }
|
|
|
+ #elif defined(dRenderVariant_colorWboit)
|
|
|
+ material.a *= ta;
|
|
|
+ #endif
|
|
|
#endif
|
|
|
#endif
|
|
|
`;
|