Jump to content


  • Content Count

  • Joined

  • Last visited

About thrice

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Could also maybe create a ribbon and update that as the sphere moves, and use that to track the spheres path, if that's what you are trying to do? (i'm assuming you're going for a 2d fog of war effect i.e. warcraft/diablo?) idk: https://doc.babylonjs.com/how_to/ribbon_tutorial
  2. Eh, not like that at least, you def can't store variables within the fragment shader itself. Part of your question sounds like maybe it could be solved with vertex shader, which is mostly outside my knowledge domain, but maybe not. However It also sounds like there might be a better way of doing what you are trying to achieve. You could probably use a custom render target to essentially bake the image as the sphere moves through it, or something to that effect? Then you'd just pass the baked image as a sampler to the main shader and use that to diff it? IDK I don't have much experience with re
  3. Ya so, you'd either have to do the calculations on the javascript side, and pass it to the shader as a uniform, or something else, but you can't store computed variables in the shader for the next pass if that's what you are asking. Are the sphere / background 2 different textures you're passing into the shader?
  4. It's possible, just not directly from within the shader. Instead you pass the data to the shader on the JS side of things, i.e. assuming you have an instance of shader material, pseudocode: shader_material.setVector3('inputColor', new BABYLON.Vector3(1,0,0); shader_material.setFloat('time', 0.0); Then after event occurs you can do something like current_time = 0.0; time_step = 0.01; scene.onBeforeRenderObservable.add(() => { shader_material.setFloat('time', current_time + time_step); });
  5. Hey Delta. I'm stuck on an older version of babylon atm (3.1) so no glow layer for me, but also I don't think glow layer works with shader materials? (all my effects are shader materials)
  6. Also, I tried using multiple cameras / layer mask, but the issue I am having is the pipeline knocks out the layer below it when it is applied. So in this PG, I am trying to make the shape mesh on top of the board have bloom applied, but the board underneath not bloom. (uncomment line 50 to see the issue I am having with this strategy, but I am hoping there may be a better way anyways?) https://www.babylonjs-playground.com/#4PG77U#2
  7. Basically looking to use the bloom post process but only for effect type meshes, which have baked illumination (projectiles and such), and maybe my main game board mesh. Anyone know an easy way to do this?
  8. The reason (or at least one of) is because isVisible=false can be used to group meshes together, so that the children meshes are still active in the scene (like a transform node in newer babylon versions). If you setEnabled(false) instead the child meshes will be removed from the rendering loop also. I believe there are other uses I've encountered as well just can't think of off the top.
  9. You should be able to make a custom shader material for this purpose, at least that is what I do. I use it when I want the material to appear exactly as is. Something like: BABYLON.Effect.ShadersStore['noLightFragmentShader'] = ` precision highp float; uniform float time; varying vec2 vUV; uniform sampler2D textureSampler; void main() { vec4 texture_color = texture2D( textureSampler, vUV ); vec4 final = texture_color; gl_FragColor = final; } BABYLON.Effect.ShadersStore["noLightVertexShader"]= ` precision highp float; // Attributes attribute
  10. Hmmm. I'm on OSX 10.2 sierra. - Chrome v70.0.3538.110 - Also seeing issue on my macbook pro/chrome. Also seeing issue in my actual game which is running an older electron/chromium version (not sure which exactly). What are you running?
  11. Sorry, use this playground instead for the broken version https://www.babylonjs-playground.com/#CAAXS7#3 In the one I posted originally, it was broken, but I was doing dumb stuff to try and work around it which makes it more confusing
  12. Sure, though hard to demonstrate via SS due to flickering. Here are videos of: chrome version (broken) https://www.dropbox.com/s/b5e8zkv0vjl6be4/video_bug_chrome.flv?dl=0 safari version (working) https://www.dropbox.com/s/jx5jrl17a5es8vb/video_safari.flv?dl=0 Are you seeing the working version or the bugged version?
  13. Just opened 2nd example on my iPhone X and runs flawlessly however. So maybe bug with engine? Or something with auto play? Though I don’t see why that would be the case when the first example is working in chrome
  14. So I am having issues with videoTextures and createInstance. I thought it was related to alphaBlending/mode and what not, but I am able to get it working perfectly if I just use clone or without createInstance. So I am wondering if it's an issue with video texture, or just my createInstance implementation in my custom shader (though I use the same code elsewhere for createInstance with non video textures and as far as I can tell it works correctly.) Anyways here is a working playground version, or what should be happening, using clone. https://www.babylonjs-playground.com/#TQUA6H
  15. In case anyone else stumbles on this thread like I did yesterday, here is a working example on how you can faux do this. Basically rather than use a transparency channel I discard black pixels, and allow a discard threshold to be set, which will call discard on any pixel whose sum of r.g.b < discard threshold. https://www.babylonjs-playground.com/#TQUA6H I am however having some issues with video textures/instances but going to open a separate issue for that.
  • Create New...