Neuromancer Posted October 22, 2014 Share Posted October 22, 2014 Hi community, I get some weird appearance trying to use alpha blending. 1) (see image attachment 1) I do neither use alpha testing nor alpha blending. The texture is a PNG file with alpha information. The result looks fine. 2) I add alpha testing to the diffuseTexture propery. Everything is nice. 3) I add an opacity texture. Now the result looks weird. It seems that the normals of some polygons have flipped. My code is as follows:var createScene = function () { var scene = new BABYLON.Scene(_babylonEngine); var light = new BABYLON.PointLight("point", new BABYLON.Vector3(10, 10, 10), scene); var camera = new BABYLON.ArcRotateCamera("Camera", 0, 1.2, 10, new BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); // changing the wheel precision to get a smoother mouse wheel scrolling camera.wheelPrecision = 20; BABYLON.SceneLoader.ImportMesh("", "_3D/models/", W2PTT_CONFIG["productCategory"] + ".babylon", scene, function (newMeshes) { camera.target = newMeshes[meshToAssignTextureToIdx]; var textureFile = "../userData/textures/_templates/TemplateForMiniCooler.png" + W2PTT.utils.createCacheBuster(); //var textureFile = "../userData/textures/_templates/tree.png" + W2PTT.utils.createCacheBuster();// var textureFile = "../userData/textures/merged/" + W2PTT_CONFIG['shotID'] + ".png" + W2PTT.utils.createCacheBuster(); var material = new BABYLON.StandardMaterial("texturePlane", scene); material.diffuseTexture = new BABYLON.Texture(textureFile, scene); material.diffuseTexture.hasAlpha = true; material.opacityTexture = new BABYLON.Texture(textureFile, scene); material.opacityTexture.getAlphaFromRGB = true; //material.opacityTexture.hasAlpha = true; //material.backFaceCulling = false; //material.diffuseTexture.getAlphaFromRGB = true; //material.specularPower = 256; //material.alpha = 1; newMeshes[meshToAssignTextureToIdx].material = material; }); scene.registerBeforeRender(function () { light.position = camera.position; }); return scene;};Any ideas? Thanks for your help. //Edit: The mesh is an exported Blender file. Quote Link to comment Share on other sites More sharing options...
Neuromancer Posted October 22, 2014 Author Share Posted October 22, 2014 Okay, I found a workaround: I just split the objects in my Blender project. So the window glass is separated from the rest of the cooler and it has its own (alpha) material now. But I still wonder why some polygons flipped normals before....? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 22, 2014 Share Posted October 22, 2014 Sounds strange but you find the right thing to do Quote Link to comment Share on other sites More sharing options...
Neuromancer Posted October 24, 2014 Author Share Posted October 24, 2014 Hi Deltakosh, something offtopic here: I think you are the creator of BabylonJS, aren't you? So is it just a coincidence that your nick includes the name "Kosh", one of the most important figures in the TV series Babylon 5? And did BabylonJS get its name from the series?If it is so: congratulations, good choice! I like this series so much, even more than StarTrek and I'm a big fan of G'Kar and of course - Kosh. Probably one of the most underrated TV series ever. Greetings. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 24, 2014 Share Posted October 24, 2014 This is BY FAR my best TV show ever. I'm a huge fan of Babylon 5 and this is why I named the engine "Babylon.js" Kosh, Vorlon Ambassador, was my nickname since I'm 20 or so (and I'm 40) I added "delta" because as a wow player I created "kosh" then "alphakosh", "betakosh", "gammakosh" and then "deltakosh" which is now my main character MasterK and Neuromancer 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 24, 2014 Share Posted October 24, 2014 So is Davrous a Dr. Who fan? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 24, 2014 Share Posted October 24, 2014 No his name is David Rousset...He has no imagination ! Quote Link to comment Share on other sites More sharing options...
Neuromancer Posted October 24, 2014 Author Share Posted October 24, 2014 To all german Babylon.js users who may be interested to the TV series that lent its name to Babylon.js: Tele5 is broadcasting Babylon 5 atm every afternoon from 4 to 6 pm. It's worth to have a look at. Today season 4 (of 5) has started. But since Babylon 5 has an epic story you may be a little confused, be aware of that. However, the danger of becoming addicted still remains... GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Hagop Posted December 1, 2015 Share Posted December 1, 2015 what is the W2PTT ? what's it's use? Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 1, 2015 Share Posted December 1, 2015 I doubt you will get an answer from a user that was last active in 2014. BUT! It seems like the w2ptt is simply a placeholder for strings :-) It contains the current product-category name (the babylon file to be loaded) and adds what seems to be cache-prevention-url-param to the texture. that's about it... 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.