snot224 Posted December 31, 2015 Share Posted December 31, 2015 Hi again, here an over problem I don't understand.In my projet (a strategy game) when I construct a new building I put on the floor a decal, but this decal look's like very dark when normal vector is positive, and when is negative no shadow cast on it...Here the code : // Material this.tabMateriaux['solChateau'] = new BABYLON.StandardMaterial("solChateau",scene); this.tabMateriaux['solChateau'].diffuseTexture = new BABYLON.Texture("3d/terrain/images/solChateau.png",scene); this.tabMateriaux['solChateau'].diffuseColor = new BABYLON.Color3(1, 1, 1); this.tabMateriaux['solChateau'].diffuseTexture.hasAlpha = true; // Placement décal var taille = new BABYLON.Vector3((this.maxX-this.minX)*_CONST_TAILLE_CARREAU__,(this.maxZ-this.minZ)*_CONST_TAILLE_CARREAU__,(this.maxZ-this.minZ)*_CONST_TAILLE_CARREAU__); var sol = BABYLON.Mesh.CreateDecal("decal", ground, new BABYLON.Vector3(this.mesh[0].position.x,this.mesh[0].position.y,this.mesh[0].position.z),new BABYLON.Vector3(0,-1,0), taille); sol.position.y += 1; sol.receiveShadows = true; sol.material = controleurObjet.tabMateriaux['floor'].getSubMaterial(this.indexSubMatSol); shadowGenerator.getShadowMap().renderList.push(sol);I put in attachment a picture to be more clear. have a nice day Quote Link to comment Share on other sites More sharing options...
snot224 Posted January 2, 2016 Author Share Posted January 2, 2016 So, I solved my problem,this.tabMateriaux['solChateau'].ambientColor = new BABYLON.Color3(1, 1, 1);not difuseColor .... I don't know how to put "answered" on the topic, someone could explain me how to ? Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 2, 2016 Share Posted January 2, 2016 You ahve a button in the bottom right ofg the message "set as answered" Quote Link to comment Share on other sites More sharing options...
snot224 Posted January 2, 2016 Author Share Posted January 2, 2016 You ahve a button in the bottom right ofg the message "set as answered" Thanks 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.