aggregate1166877
aggregate1166877

Reputation: 3220

Enabling GL EXT_blend_minmax

According to this MDN page EXT_blend_minmax has been supported since Chrome 38 and Firefox 47.

I'm trying to use it from Three.js. However, it doesn't work for me with either latest Chrome or latest Firefox:

const renderer = new THREE.WebGLRenderer();
const gl = renderer.getContext();
const ext = gl.getExtension('EXT_blend_minmax');

console.log(ext) // -> null; I'm hoping for { [...], MAX_EXT }

I've also tried setting my Chrome WebGL flags to experimental, but I get the same result.

Is there something I should do to activate it?


X/Y reason: I would like multiple semi-transparent objects to overlap. However, I want a max alpha limit among them. My understanding is that EXT_blend_minmax can help achieve this. Example visuals:

enter image description here

Upvotes: 0

Views: 99

Answers (1)

Mugen87
Mugen87

Reputation: 31076

There is no need to explicitly request the EXT_blend_minmax extension on app level. If you configure the blending equation with the three.js constants THREE.MinEquation or THREE.MaxEquation, you can use the extension automatically.

Blending is defined for materials so you have to set the blendEquation property to one of the above values.

Upvotes: 1

Related Questions