Ni fait ni à faire

  • Content Count

  • Joined

  • Last visited

About Ni fait ni à faire

  • Rank

Profile Information

  • Gender
    Not Telling

Contact Methods

  • Twitter
  1. Even if it was a little difficult to set up (never put my hand on nodejs/npm before), this is indeed much cleaner... and it works ! Thank you
  2. It appears that, going back to an older state ( - I just picked one I'm sure I worked against -), the output js file is correct.
  3. Hello ! For some time, I've been building custom minified versions of Babylon.js, by directly running BuildOurOwnBabylonJS.bat on Wine/Linux. However, it recently (I can't be more precise) stopped working, as the produced file seems invalid (even with a fresh-cloned git repository). It may be a bug on Wine's side, or mine, in which case I'm deeply sorry for the unneeded noise.
  4. I managed to get the "flattened light map" effect by patching the Create Your Own Shader Phong vertex shader in a better way : vec4 outPosition = worldViewProjection * vec4(uv.x, uv.y, 0.0, 1.0);gl_Position = outPosition; (flattened surface of a lit sphere) It still needs some tweaking ( specular looks strange) but is definitely what I was searching for. Big thanks to jahow !
  5. There I (hope to) go : Time to do some raw WebGL programming
  6. Hi again ! This seems to be a working solution (which is an incredible leap forward thx so much), but the resolution ( 256x256 texture) and performance constraints are difficult trade-offs. I can't believe there is no way to do this in a more WebGL way, I keep searching & keep this thread updated. Big thanks
  7. Hello ! I'm working on a project in which a moving light revolves closely around an arbitrary model, revealing the surface it has lit, in a "fog of war" style (but with precise lighting): (this model is "Ice Asteroid" by jesterelly and is under CC-By license) (the *point* light is just an example, may as well be directional light with a shadowgenerator). To do this, I must keep track of once-lit areas to display them even if they are not illuminated atm. As this information can only be assigned to the whole surface (the camera is mobile, and all surface is concerned), I thought of using a texture to store it, "inside" the model material. I was kindly pointed toward RenderTargetTextures, which seem the way to go , but I struggle with implementing my plan (and I don't know if it is correct anymore) : 1) using a new material = standard material + a light map texture, which stores all pixels of the diffuse texture ever lit ( 0/1 states), and display (or not) a fragment accordingly. Seems OK. 2) the "light map" is a RTT which onBeforeRender replaces the model material with a "detect light" custom material : its fragment shader output only convoys light/shadow information, and it is displayed on a plane, to form the model UV map (but only with lit/unlit zones).the rendering takes place, creating the "instant" light maponAfterRender puts back the almost-standard model material, and makes an "addition" of the newly created light map and the previous one (final_uvpixel_value = uvpixel_value_1 + uvpixel_value_2), passing it as a texture to the model material. I scratch my head on these 2 points : in particular, I have no idea how to access to the "light state" of the model surface, presented as a flat texture. I tried to "unwrap" my model by replacing gl_Position = viewProjection * finalWorld * vec4(position, 1.0);by gl_Position = vec4(vDiffuseUV,0., 1.0);in the standard material vertex, but so far I only got beautiful glitches (always on UV-mapped models). I can't think of another way to go for the moment. Any idea about this "real-time surface illumination texture" is welcome (thank you very much for reading this)
  8. ! I never thought of RTT that way, for me they were just "additional displays" for another camera. As they can be used "on" an UV-unwrapped model, this is the way to go. Thank you very much to both of you.
  9. Hi jahow ! This is it. Although the "fog map" must be permanent, whereas the shadow map is regularly recreated (from what I understood, may be wrong). This would be perfect for a surface (or plane model), but not for any 3D model (e.g. a sphere, with a light revolving around - half the sphere would not be mapped by the orthographic camera). In my opinion, the simplest (if possible) way would be to use a texture with uv coordinates (just like the diffuse texture) and write on it directly from the fragment shader. I forgot to say it doesn't matter if non-visible illuminated areas are not updated on the "fog map" (so the shader seems the place to do it). Thank you for your ideas (I keep scratching my head & post whatever I may find)
  10. Hello ! I'm currently working on a "fog of war" material : the standard material + a texture to keep track of once-lit areas, and display them later event if they are not illuminated (because of the standard lighting model or shadowgenerator). It would produce the ~same effect as classical real-time strategy games FoW,(with a moving light revealing the model) but based on actual lighting and on arbitrary UV-unwrapped models. However, I can't figure out how to write to a texture : when the shader gl_FragColor rgb component would be different from (0,0,0), it must modify the corresponding point on texture. From what I found, Babylon.js' DynamicTexture can be altered from the js part (as an HTML canvas), and I should rather use a Framebuffer Object, but I don't understand how to create and manage it from Babylon. Sorry if this is a really noob question, any clue or thought is welcome. Thanks for reading this :-)