• Content count

  • Joined

  • Last visited

  1. Water Fluid Simulation

    Thank Deltakosh replied. I know this is really difficult , i will continue learning. Babylon.js is a great game engine!
  2. Hello everyone! I'm making fluid simulation effect, i found a demo: and i want to clone it. The demo written by WebGL + shader but i don't know about WebGL, i'm worrying . I'm trying export to babylon.js and there are a few things i don't know how to do. I'm really stuck, i expect the babylon community to help me 1. var texture_water = GL.createTexture(); GL.bindTexture(GL.TEXTURE_2D, texture_water); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.NEAREST); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.NEAREST); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_S, GL.CLAMP_TO_EDGE); GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_T, GL.CLAMP_TO_EDGE); GL.texImage2D(GL.TEXTURE_2D, 0, GL.RGBA, 512, 512, 0, GL.RGBA, GL.FLOAT, null); 2. var quad_vertex = [-1, -1, 1, -1, 1, 1, -1, 1]; var QUAD_VERTEX = GL.createBuffer(); GL.bindBuffer(GL.ARRAY_BUFFER, QUAD_VERTEX); GL.bufferData(GL.ARRAY_BUFFER, new Float32Array(quad_vertex), GL.STATIC_DRAW); var quad_faces = [0, 1, 2, 0, 2, 3]; var QUAD_FACES = GL.createBuffer(); GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, QUAD_FACES); GL.bufferData(GL.ELEMENT_ARRAY_BUFFER, new Uint16Array(quad_faces), GL.STATIC_DRAW); GL.vertexAttribPointer(SHP_VARS.rendering.position, 2, GL.FLOAT, false, 8, 0); GL.bindBuffer(GL.ARRAY_BUFFER, QUAD_VERTEX); GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, QUAD_FACES); GL.disableVertexAttribArray(SHP_VARS.rendering.position); 3. GL.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_SHORT, 0); GL.disableVertexAttribArray(SHP_VARS.water.position); GL.framebufferTexture2D(GL.FRAMEBUFFER, GL.COLOR_ATTACHMENT0, GL.TEXTURE_2D, texture_normals, 0); GL.useProgram(SHP_NORMALS); GL.enableVertexAttribArray(SHP_VARS.normals.position); GL.bindTexture(GL.TEXTURE_2D, texture_water); GL.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_SHORT, 0); GL.disableVertexAttribArray(SHP_VARS.normals.position); GL.bindFramebuffer(GL.FRAMEBUFFER, null); GL.flush(); With the above code how i export to babylon.js? Thanks so much!
  3. Light Cookies

    Thanks to DK, I will wait to your update
  4. Light Cookies

    Hello everybody! I am making caustics effect underwater. I see playcanvas.js engine has an example. Here: Doc: I tested with editor's playcanvas.js, result just like what i need, below image. They use Spotlight with a texture. I tried search google, forum, document but does not have this attribute. How i can make this effect? Can Babylon.js's team support this attribute for Spotlight? Thanks so much!
  5. Hi @Mythros! You want to load multi model and use them outside function?
  6. I'm sorry, i am busy. I will come back at tonight (GMT +7).
  7. If you want reuse mesh, you just use clone method. Here:
  8. Try
  9. Hope help you :
  10. Tween model by TweenMax.js

    @Deltakosh I'm sorry, i no get error. I replaced other link: Fish.babylon
  11. Hello everyone! I'm using TweenMax.js (GSAP) to tween position for model with bezier but model's rotation incorrect. This is PG: How to fish's head rotation in the direction of movement? (JUST use TweenMax.js, DON'T use BABYLON.Path3D). Thanks you!
  12. @Hersir Thanks you very much!
  13. Hello! i begin use ShaderMaterial, i copy Vertex and Fragment from but sphere not visible. This is PG: Where I am wrong? Thanks you!
  14. WebGL water

    Hi @Dad72, Sorry for digging it up . I also want this effect but i can't do, do you made it? Can you share source code? please..