highvrahos Posted October 7, 2014 Share Posted October 7, 2014 Hello, First of all thank you for this great community and tools that you are mainting with the effort of everybody, and most of all of the creators of Babylon JS. We are using Babylon JS with a custom shader to render some plates that allow the dynamic chagning of color and material. We are trying to make the glass render with some opacity, and as we aren't using Babylon JS standard material, but a custom combined with custom shaders, we are using for the plates: shape.registerBeforeRender(function() { engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE); }); And for everything else, to render it normally: shape.registerBeforeRender(function() { engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE); }); Ther result is really good, but we are experiencing an issue when the camera turns low and the plate renders in front of the background, as you can see in the attached photos. The background is a sphere, with inversed normals so it can be rendered from the inside. We know that it's difficult to provide assistance as we are using custom shaders, but we would be really glad if you point us in some direction to search for a fix in this issue. Best regards,Leonidas Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 7, 2014 Share Posted October 7, 2014 You should just ask the custom shader to require alpha for you:var cloudMaterial = new BABYLON.ShaderMaterial("cloud", scene, { vertexElement: "vertexShaderCode", fragmentElement: "fragmentShaderCode", }, { needAlphaBlending: true, attributes: ["position", "uv"], uniforms: ["worldViewProjection"], samplers: ["textureSampler"] }); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 7, 2014 Share Posted October 7, 2014 And btw I would love to see it running Quote Link to comment Share on other sites More sharing options...
highvrahos Posted October 8, 2014 Author Share Posted October 8, 2014 Yes, it works just fine! Thank you. Sent you a PM as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.