Jump to content

BJS 3.3.0-rc3: ALPHA_COMBINE ignored


Recommended Posts


I updated my app from BJS 3.2.0 to BJS 3.3.0-rc3 to prepare for the new features. I noticed that my white color on the texture is no longer considered as transparency, but remains white.


BABYLON.Effect.ShadersStore.shadowPlaneVertexShader = '\r\n' +
	// Precision
	'precision highp float;\r\n' +
	// Attributes
	'attribute vec3 position;\r\n' +
	'attribute vec2 uv;\r\n' +
	// Uniforms
	'uniform mat4 world;\r\n' +
	'uniform mat4 worldViewProjection;\r\n' +
	// Varying
	'varying vec2 vUV;\r\n' +
	// MAIN
	'void main(void) {\r\n' +
	'  vec4 p = vec4(position, 1.0);\r\n' +
	'  gl_Position = worldViewProjection * p;\r\n' +
	'  vUV = uv;\r\n' +

 * Custom fragment shader
 * @type {string}
BABYLON.Effect.ShadersStore.shadowPlaneFragmentShader = '\r\n' +
	// Precision
	'precision highp float;\r\n' +
	// Varying
	'varying vec2 vUV;\r\n' +
	// Uniforms - Diffuse
	'uniform sampler2D diffuseTexture;\r\n' +
	// MAIN
	'void main(void) {\r\n' +
	'  gl_FragColor = texture2D(diffuseTexture, vUV);\r\n' +


material = new BABYLON.ShaderMaterial(
				{ vertexElement: 'shadowPlane', fragmentElement: 'shadowPlane' },
                        attributes: ['position', 'uv'],
						uniforms: ['world', 'worldViewProjection'],
						needAlphaBlending: true
material.alphaMode = BABYLON.Engine.ALPHA_COMBINE;
material.setTexture('diffuseTexture', [image with white background and black gradient]);
mesh.material = material;

Does anyone know why this is suddenly no longer possible? 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...