chardetm

Members
  • Content Count

    6
  • Joined

  • Last visited

Everything posted by chardetm

  1. Thanks that's exactly what I want to do!
  2. Sorry for the delay, exams and everything... So! Thanks to everyone who replied! In the meantime I found a way to do what I want but it feels like I'm using a missile to kill an ant, I'm using an opacityTexture on my mesh. But if I could do it without a texture that would be great! This sounds promising, how can I do that? Yes more or less, ultimately I would like it not to be linear all the way but this is the spirit! If I know how to do this I know how to do exactly what I want! I think your solution applies the alpha to the whole mesh, my problem with this is that I want a different alpha for a single mesh because this mesh is very long and I want it to disappear in the distance...
  3. I have, the issue is that my background is a HTML element under the canvas which is dynamic, that's why I need transparency...
  4. The problem is that having a uniform background is not an option for me...
  5. Thank you for your reply! The problem I see with what you suggest is that in my case I will have a long mesh with an end close to the camera and an end in the distance, so the different alpha levels should apply even on a single mesh... I thought of splitting the mesh in several parts but I fear that the limits between the parts become visible if I don't split it in enough parts, and that it may take a lot of resources if I split it in say 100...
  6. Hello everyone! I wonder if it is possible to "make objects disappear in the distance", just like a fog but playing with the alpha channel. I've tried this: scene.fogMode = BABYLON.Scene.FOGMODE_LINEAR; scene.fogColor = new BABYLON.Color4(0,0,0,0.00001); scene.fogStart = 30; scene.fogEnd = 70; I expected it to work because if I understood correctly the color with fog is computed like distanceCoef*fogColor + (1-distanceCoef)*originalColor where distanceCoef is between 0 and 1. But it seems like these are treated as Color3 and not Color4. I really need transparency because I don't plan to have a uniform background. Any idea? To test this you can go to http://playground.babylonjs.com/?2, paste the code above somewhere and set the background color to anything. Thank you! EDIT: Added screenshot: here I would like the objects to become transparent in the distance (so appear more and more green), not just black. EDIT 2: I found an example of exactly what I would like, this is a screenshot from a RockBand game, see how the neck disappears in the distance?