Search the Community

Showing results for tags 'light'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 37 results

  1. Hi everyone I have some weird issue using shadows in Babylon. Please take a look at the sample below : http://www.babylonjs-playground.com/#ITTNDX#1 It seems that the shadow is not cutted off properly ! it still appears even if the object goes under the ground. Is there anything to do to fix that ? Thanks for your time A
  2. Light Cookies

    Hello everybody! I am making caustics effect underwater. I see playcanvas.js engine has an example. Here: http://playcanv.as/p/Hdzeoc5P Doc: https://developer.playcanvas.com/en/api/pc.LightComponent.html#cookie 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!
  3. Hi, i have a question about shadows, is it possible to let a mesh cast shadow on it self? Currently I can make a tree looking like the first picture, but in this case the 3d deep looks not that good. I looking for a solution I can get a tree like the second picture. Thanks for your help Mirco
  4. Hi community, I have a light source with a specific specular color. I would expect that you can see this color on a surface reflecting (especially on a very smooth surface) . Either I miss some settings, or it's a bug? see Playground diffuse works, but specular (should be red) is dead.
  5. Shape of light source

    Hi, I couldn't seem to find an answer to this question I want to create a light source that has a specific shape, or make an object also be a light source. Whichever. How would I do that? Thanks for the help!
  6. I'm displaying some items in the "billboard" mode: https://www.babylonjs-playground.com/index.html#20K47P#1 The items would need to maintain the same color (or change it just a bit with the camera rotations). I believe it must be very simple to do, but, still bein a novice, I do not know how ....
  7. Hi, what would be the best way to crate lamp like mesh, that is half transparent and is lightened from inside (emits light). Thanks.
  8. I have a Phaser game created and I am able to create an updated visibility graphic object while my sprite moves. However, like in this example, and every other I have found online: http://www.emanueleferonato.com/2014/10/21/phaser-tutorial-how-to-create-an-html5-survival-horror-game-in-6-easy-steps/, they are using an image of the thing you want to see as the 'background', and simply .mask against the visibility graphic. In my case, I do not have an image of the map as it is created through a tilemap generator, so my current code basically shows the opposite of what I am looking for: For this example, I created a test box in the bottom right of the screen that has nothing to do with the real map (I'll add the correct walls later to the visibility algorithm). I want the part that is not white to be blacked out, and the whited part to be crystal clear. I have tried creating a sprite of just black, and a sprite of just transparent, and had them .mask = visibility graphic. But this just overwrites everything else. I have taken out the most important part of the code for reference: preload () { //load assets that are specific for this level this.game.load.image('blackness', '../../assets/images/blackness.jpg'); this.game.load.image('transparent', '../../assets/images/transparent.png'); //this.game.load.image('yellowish', '../../assets/images/yellowish.png') } create () { this.blackness = this.game.add.sprite(0,0,'blackness'); //this.blackness.alpha = 0.8; //this.transparent = this.game.add.sprite(0,0,'transparent'); this.lightCanvas = this.game.add.graphics(0,0); } update() { let visibility = this.createLightPolygon(this.currentPlayerSprite.x, this.currentPlayerSprite.y); this.lightCanvas.clear(); this.lightCanvas.beginFill(0xffffff,0.5); console.log('visibility',visibility) this.lightCanvas.moveTo(visibility[0][0],visibility[0][1]); for(let i=1;i<=visibility.length;i++){ this.lightCanvas.lineTo(visibility[i%visibility.length][0],visibility[i%visibility.length][1]); } //this.transparent.mask = this.lightCanvas; this.lightCanvas.endFill(); }
  9. I do not understand why the ground in the scene is not affected by the solar light of the sky box. demo:http://www.babylonjs-playground.com/#E6OZX#6. I will describe it in more detail: When I removed the light(The HemisphericLight) in the scene.The ground turned black .I think there is a sun in the sky box, why the sun's light does not affect the ground. please help me!!
  10. Hi guys! I make map with the dark forest and I need make center of the map with good light, but the closer to the forest, then map gets darker. I need something like the fog but without binding to the camera. Fog always in position 0, 0, 0 and if player go to coordinates 100, 100, 100 then his go to the dark. While I did just the fog attached to the camera and if the player closer to the forest, then fog far from the player and camera. And the forest does not seem so dark. Anybody haves some ideas how do it?
  11. flickering neon light effect

    Hi, For my website i created a neon effect with PixiJS v4 and i'm not happy with the results i was wondering if anyone could improve upon or has a better idea how create a neon effect which works across multiple desktop/mobile devices. The neon light is a simple transparent png image overlaid on top of static background image. It works for time been 'good enough' for desktop browsers, but i had to disabled it for iPad, etc. because of the slow performance combined with rain (pixi-particles) and fog (custom particle effect). Live version: http://5701.nl Code: //PIXI var PIXI; var Container = PIXI.Container, autoDetectRenderer = PIXI.autoDetectRenderer, loader = PIXI.loader, resources = PIXI.loader.resources, Sprite = PIXI.Sprite, ParticleContainer = PIXI.particles.ParticleContainer, extras = PIXI.extras; var street = new Container(); var weatherType = new Container(); var renderer = new autoDetectRenderer(3600, 720, {antialias: false, transparent: true, resolution: 1}); document.getElementById('street').appendChild(renderer.view); //View renderer.view.style.display = 'block'; renderer.autoResize = true; //Variables var neonSign, neonFilter, colorMatrix, count = 1; function animateScene() { //Animate neonSign neonSign.alpha = 0.1; count += 2; var bright = 2 + Math.sin(count); neonFilter.brightness(bright, false); requestAnimationFrame(animateScene); renderer.render(street); } function setup() { //Setup neonSign neonSign = new Sprite(resources['images/one-stop-copy-shop_glow.png'].texture); neonSign.width = 1200; neonSign.height = 300; neonSign.position.set(1200,0); colorMatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; neonFilter = new PIXI.filters.ColorMatrixFilter(); neonFilter.matrix = colorMatrix; neonSign.filters = [neonFilter]; //Add neonSign street.addChild(neonSign); //Start animateScene(); } //Setup loader .add('images/one-stop-copy-shop_glow.png') .load(setup);
  12. Hey Delta... Did you get a chance to put the missing light.onDispose and camera.onDispose just like the mesh.onDispose has???
  13. Hi ! I am having an issue with shadow maps, it seems pretty random, but from time to time the shadow map seems to "degenerate" meaning that the shadow map's resolution progressively lowers until the shadow is not visible anymore. I don't know what could cause that, I am not running any scene optimiser and not touching my shadow map during the renderloop so there is no reason its resolution suddently start to lower by itself... I am running the (v2.5.-beta) version. I will try and pose a screenshot of the scene as I can't seem to be able to reproduce it in the playground. Thanks in advance for your time and answer !
  14. Light problem

    I'm testing the 3ds max exporter and I have the light problem shown in the attached image. Why? There are a plane object, a teapot and a simple omni light with shadow map activated. I've tried every parameters combination between the exporter UI and the light parameters. Thanks in advance.
  15. Shadow issues..

    OK so I have this endless chunked terrain where I am walking around, I head out a ways, the sun/light objects are moving with the player as I move keeping it's orbit and direction pointed toward the player model, but for some reason the shadows start to go off to the wrong side and distorts (see above image)! Is there a way to tell the shadow generator the light position and target has updated because it looks like it isn't updating since it was instantiated. I'd think it would auto update or something each frame to make sure it was following the light source properly, but that doesn't seem to be the case here. Is there something like shadow generator.update() or something I'm missing? How would I get this to work right, it is bugging me! Here is the bit of code that updates the sun/light position pre-calculated before frame render, less global variables of course.. scene.beforeRender = function (){ skybox.rotate(BABYLON.Axis.Z, -0.00008, BABYLON.Space.PIVOT); if(sunmove && actor){ sunvls.mesh.position = new BABYLON.Vector3(actor.position.x + sunorbdis * Math.sin(sunorbdelta), actor.position.y + sunorbdis * Math.cos(sunorbdelta), actor.position.z); light.position = sunvls.mesh.position; sunorbdelta += sunspeed; } }; How can I work in shadow generator update? Thanks!
  16. Hello, I am having trouble with the shadow generator, this playground illustrate my problem => http://www.babylonjs-playground.com/#DAKLR#4 I made a room with a window. Then I add two lights with a shadowgenerator for each one, the two sphere show their position into the scene. The one outside the room act properly (you can see light pass through the window), but the one inside the room light nothing. If you comment line 97 -> 104 (remove the roof) the light inside act properly. Thanks
  17. Hi, So I have another problem, this time with the PBR textures imported from unity using Babylon2unity. If I am using any light other than Hemilight (pbr material from unity seem to work with it), all the textures show up black. Again it might be solved by some tweaks in the texture objects, so I have been looking for the problem for hours now... I had some successes, failure, a lot of frustration. So I thought i should ask for your help. On the first image this is the results of my tweaking using an omnilight. So I though I had it figured out, by changing the reflectivityColor and reflectionColor from 0,0,0 to 1,1,1 it seems I get back my texture for the little robot in the middle (the infamous roger robot). With some shadow etc. I also changed the "hasAlpha" in the reflectivityTexture (because it does have alpha) and changed useMicroSurfaceFromReflectivityMapAlpha and useAutoMicroSurfaceFromReflectivityMap to "true" (one of them was already to true, can't remember which one) - that did work with matte region becoming matte, at long last. So I said Great ! lets change the reflectivity color and reflexion color for one of the tile type (the little hexagons thingy). By doing that I also get back the texture normal color BUT, light does not seem to interact in the same way, the mesh is lighted both in front and behind similarly... the back face should be black no? (see image 2). The last 2 images is with the hemilight (front and back) , it seems the material is behaving normally... You might be wondering why I am persisting on resolving this issue when I have a perfectly well behaved light source at disposal... and that is a very relevant question. Any idea(s) ? Light source code: var hemiLight = new BABYLON.HemisphericLight('hemiLight', new BABYLON.Vector3(0, 0, -30), scene); hemiLight.intensity = 2; // var sun = new BABYLON.PointLight("sun", new BABYLON.Vector3(0, 50, 0), scene); // sun.intensity = 2;
  18. Hello, I'm currently working with flat shaded meshes and point lights in my Babylon.JS scene and the light is reflecting in a not-flat-shaded way. Playground demo: http://babylonjs-playground.com/#BRSMM#0 My own screenshot: http://prnt.sc/bx9h3o My target is to have one "flat color" per face and no light beam reflections which fade over distance. Is my target even possible with point lights or do I have to use other lights like the hemispheric light? Thanks for every answer, Simon
  19. How to remove glare from light? I need to model the illumination light but did not glare. Is it possible to do something to remove the glare? http://www.babylonjs-playground.com/#132VFT
  20. hi everybody.. could you give me tips to create fake light? i draw fake light like following image with blendMode..(i don't use shader here because it's slow on mobile). it will be drawn on maps.. i wanna add good simple animation like intensity of light or glittering i need good formula or function to draw good.. thx..
  21. Visual light area

    I would like to have the below effect t The problem I'm having is that the spotlight doesn't provide me with the total length of the light, so there's no way for me to calculate the measurements for the cone. Can someone please lead me in the right direction on how to get the desired effect? Thanks in advance.
  22. Light Trail and Follow

    Hello everyone! First of all, thanks for the excellent forum! It's amazing. My question is, how to make and which the best way to make a "Light trail effect". I've make this image from photoshop to illustrate: The red dot is the point that the line shall follow. When the line becomes long, needs to fade out. I thought 2 possibilities to do it : Particles or slice and manipule a "shape" (texture), dividing in 3 parts, like : My doubt is, what is better? Or have other way to do... And, the Particles or Particles Storm from Phaser can do this? Sorry for my bad english Thanks for patience!
  23. Hi, I would like to setup so that light falls on the mesh, even when mesh is rotated. http://www.babylonjs-playground.com/#1HCFXA#0 Currently, if I rotate the mesh and look at the bottom surface, it is rendered as black, which means there is no light that hits this surface. I think this means light moves along with the camera. is this correct? However, when scene is rotated and a different surface is placed on top, I see a shine. Why is this ? I think I am missing something very basic here. All I want is use a single source of light and illuminate the mesh, no matter how it is rotated. Is this possible ? Regards Rajkumar
  24. I'm trying to display 3-dimensional maps with overlays, in the same way as it possible, for example, with leaflet.js. I have created a sample in the playground: http://www.babylonjs-playground.com/#HJMHU#7 This displays my region with an overlay for the highwater risk areas. If you wait a little the blue areas disapear. But also the shaded relief disapear. I have tried a lot with different textures of the material and different lights. I have even looked into BABYLON.Effect.ShadersStore. But I haven't found a better solution yet. Is there a better way to get such fading textures? (If possible without low level C source code) You can see it implemented on our site http://hmsmap.com/3d/?x_anz=3&y_anz=3&z=11&lat=51.9547&lng=8.2387&tp=OpenStreetMap&op=HW_Gefahrenkarte Use the second slider in the footer to change the opacity.