Search the Community

Showing results for tags 'shadow'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 58 results

  1. Istran

    Shadow bugs.

    The object is added to the list to create a shadow (.renderList.push (obj)). To display the shadow on the object itself from other elements - (.receiveShadows = true). As a result, the object creates a shadow on itself. How to fix it? example : https://playground.babylonjs.com/#D516RY Also, if there is a surface between the light source and the object, then there is a shadow on it. How to solve this problem? example: https://playground.babylonjs.com/#1RVN7H PS: I'm sorry, if you already have a theme. I find it difficult to focus on foreign language resource.
  2. pichou

    Shadow on PNG image

    Hi everybody, I have a plane with material and diffuseTexture. The image used for the texture is a png with transparent background. In order to keep the transparent background in babylon, I set useAlphaFromDiffuseTexture = true; on the material. But now I want to see the shadow of the image. But I cant because of the useAlphaFromDiffuseTexture parameter. So my question is : Is there a way to have the shadow of my png image following the transparent and not transparent part? Thanks for your help! Pichou
  3. Hersir

    Baking shadow maps

    Hi, I have static objects and static lights inside my scene sou it would make sense to bake them to save resources,, anyone have done it? is there some workflow to generate them from scene (in 3d max or other tool). Thanks
  4. Hi, has been a while however I started a new project using BabylonJS, where I'm importing a model from Blender into a scene, now for some reason I cannot get it to cast a shadow. I added a cube next to it and it does cast a shadow, I'm also adding both the cube and the model to the renderList of the shadow generator.. Any ideas or suggestions what I could try or why it wouldn't work?
  5. Hi, found weird bug with shadows. Device: Galaxy S4 OS: Android 5.0.1 GPU: {vendor: "Qualcomm", renderer: "Adreno (TM) 320", version: "WebGL 1.0 (OpenGL ES 2.0 Chromium)"} Browser: Chrome (62.0.3202.84) / Native (6.2.01.12) PG Have mesh with PBRMetalnes material and ground with PBRMaterial. Added spot light as shadow light and included sphere as caster and box as receiver. Than created instance of the sphere. And after that both spheres disappear in S4 device. Sphere dont disappear if instead of instance, clone is used. Working PG
  6. I have a strange bug where my shadowGenerator.setDarkness value doesn't have the same effect when the debug layer is open or closed. I really don't see the possible link between those two things. Here are the 2 screenshots. Same darkness value (0.82). The only thing that differ is the commenting of the line that shows the debug layer. The shadow is cast on a plane with a ShadowOnlyMaterial Material.
  7. Hello everyone! This is my first question about my first babylon.js project. It will be a strategy game with complex economics (similar to Caesar 3, Knights and Merchants). The framework is amazing, I like it very much, but I have some problems with shadows. Everything works fine, until I add lots of instances of a mesh across a large ground. The shadow becomes just a blob, almost invisible. I think the problem comes from DirectionalLight.prototype.setShadowProjectionMatrix where all mesh positions are checked to see how big the area is for casting shadows. The bigger the area, the more detail will be lost. Can someone give me some advice on how to handle this problem? I thought of the following: 1. Increase the mapSize from 1024 to a much larger value, but it doesn't make much difference with 2048 and the fps drops very much. 2. Somehow force the shadow casting area to be smaller with the help of customProjectionMatrixBuilder, and make it follow the camera, but how? 3. Make the shadow part of the model, like an old-school circle shadow with transparency. Ugly, but at least I get 60 fps Any other idea may be helpful You can take a look at it if it helps: http://feszer.go.ro/babylon.js/1/ P.S. I know, that instances can't have different animations, I will handle that with separate clones for every action, I think
  8. Nephelococcygia

    Best way to handle Character with shadow

    I was wondering what is the best way to handle shadow for a "character". I made a character and i want to put a shadow at the bottom a kind of "circle" with opacity, for convenience let's say it's gonna be a transparent PNG. The way i can think of : - (1) Just add the sprite to the game, this leads to duplicated calculations in the update part cause i have to update both the "character" sprite and his shadow; - (2) Add the shadow as a child sprite of the "character", this leads to having the shadow on top of the sprite instead of back to it; - (3) Add the "character" sprite as a child of the shadow sprite, this seems not logical, but it works somehow; - (4) Create a group and add both the shadow and the sprite, (havn't test it but most likely) this leads to define specific property to the group for the size, the position and the overflow boundaries for collision relative to the "character" sprite and the shadow; - (5) Using a filter (Shader) applied on the hole game, with my character position as uniform to render the shadow directly on the "groundLayer". What do you think please ? Is there a better way that i am missing ? Thanks.
  9. Hello, I've created a standard shadowGenerator with var shadowGenerator = new BABYLON.ShadowGenerator(512, light) - after pushing in it multiple objects I've noticed automatic quality decreasing, like that number 512 becomes lower and lower. For example 1 box: https://www.babylonjs-playground.com/#8NWA0U The same with only 100 boxes: https://www.babylonjs-playground.com/#8NWA0U#1 You see the difference. Testing shows 512 becomes ~24 -> 20 times less. Is that true that there is a fixed count of "rays" for calculating shadows? Because the more objects I have - the less "rays" gets everyone of them. Of course I could set 4096 instead of 512 - but that dramatically decreases FPS. The main question is how can we get more or less good shadows with big amount of objects? Troubleshooting from https://doc.babylonjs.com/babylon101/shadows doesn't help with that.
  10. Hi, I get weird shadow for my imported mesh: https://www.babylonjs-playground.com/#DCU3PP#3 Here is a stl version: https://www.babylonjs-playground.com/#DCU3PP#2 Any ideas how to fix it? Thank you very much!
  11. kurhlaa

    Several shadows issues

    Hello, Playing with shadows - https://www.babylonjs-playground.com/#JI41I3 Several issues: 1. Why there are no soft shadows? 2. How do I remove this ugly black square around box/torus on the ground? I've noticed it after switching to the latest babylon.js version. If you comment out the line "shadowGenerator.useBlurExponentialShadowMap = true;" - black square will disappear and shadows will appear, but not soft. 3. If you comment out "shadowGenerator.useBlurExponentialShadowMap = true;" and uncomment "shadowGenerator.usePoissonSampling = true;" - poison shadow appears, but black square still exists;
  12. I am loading a mesh from a babylon file The mesh has a skeleton. The shadow casted by it is not proper. See file "with_skel.jpg" to check the shadow casted. Now if i remove the skeleton by doing mesh.skeleton=null; The shadow is proper. See file "without_skel.jpg" I was able to reproduce the issue in playground but wasn't able to save the code. I got the error message "file too big" when trying to save. The code is a little large as it has an embedded scene file. So I have attached the code here. See file "playground_code,txt" Copy the code to playground to check. comment on/off line 44 to see the issue playground_code.txt
  13. I'm using a custom material which is pretty similar to the ground material used in WorldMonger demo. The problem is that I don't get a shadows on it. Well it's not a big surprise, because I'm overriding the _effect property of the base material. The question is how can I get both my effect with a base material effect without copy-pasting the code from base material. I mean how can I get shadows while using additional effects?
  14. Hi guys. I have a little problem, and I'm confused ) Let me explain what I have to do, and what I did, and please tell me where I wrong. I did a ground with multiple textures, for this, I used a shader. All clear. Now I have to add shadows, but first I tryed to understand how it works lights in shader, and this is almost clear . Here you have a wonderfull playground, where I try to show you what happened to me. The light is draggable. http://www.babylonjs-playground.com/#1TWMLX So I have a light which rays shines the ground, but I want that the darkness of light to be more black. The second problem. The light is on left of the box, but the box is black on left side, and white in the right side. It looks like I have another light in the right of ground. And the water is shines from this light, not from my light.(for this I think I have to add a shader to the water material I think) And the last. For box shadow to be displayed on the ground I read that I need a modelMatrix to sent to shader, a dephtexture, and so on. I make a depthtexture using a rendererTargetTexture, And I put the box in renderingList, but how to sent modelMatrix to that shader? Thank you guys. I wish you a wonderful day!
  15. 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
  16. Hey Folks! In our scene we have some images with transparency on quads. The transparency is just used to mask the silhouettes of the image, so we have no larger half- transparent areas. So far we used the default shader for this, which produced nice silhouettes. All these Objekt are registered in a shadow generator from which we extract the shadow map an pass it in a custom shader. After writing our own shader for the images we ran into a problem: The shadow generator now only takes the quad into account, not the transparency of the image. Therefor the shadows of these images are square. When constructing the custom shader we tell baby- lon to use alpha blending and we also tell the shadow- generator to use transparency shadows. The diffuse texture is simply loaded with a texture sampler in- cluding the alpha channel. We even tried to clip frag- ments under a certain value but the shadow genera- tor still ignores it. We looked through the default shader but couldn't find anything that's helping us in this matter. We found the opacity map, which to our understanding is just a separate, black and white masking texture. So our question is: What steps are necessiary to generate shadow silhouettes based on the alpha channel of an objects texture? As we said, clipping with a threshold or cutout for that matter would be enough. Thank you for your time -Mainequin Team
  17. Mezzorio

    Sprites and Shadows

    Hey! I wanted to know if the library has been updated yet to perform this function, as I found a couple of post from 2014 talking about it being in future updates @Deltakosh, An example post I found and wanted to know if it's here as would be suuuuuper useful to me right now in my current project build, if you know of another way also of it being done please let me know, please find the babylon playground link and youtube video of my build as my textures are not very good at working! https://www.babylonjs-playground.com/#80E5N5
  18. 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
  19. Part 6 of my tutorial series on making Slither.io is here! https://loonride.com/learn/phaser/slither-io-part-6 Check out the demo: https://loonride.com/examples/slither-io/part-6/ Enjoy!
  20. can't see any shaodw on my mobile phone for this pg http://playground.babylonjs.com/#TM2NLD#7 but this demo works pretty good http://www.babylonjs-playground.com/?15 don't know why, would you guys please give me a hand?
  21. Hy gangs, how's your day been? i saw a post on how to cast shadow of a texture from a plane onto a surface using the pointlight, i've been looking for that post but i couldn't find it, i should have followed the discussion trend
  22. Hi, I'm trying to make a light: has fixed position relative to the viewer (camera); casts shadows. I set camera as the light's parent to achieve (1). But the shadow seems not updated as camera orbits. Playground: https://playground.babylonjs.com/#GWK0TQ Can I tell the shadow map to refresh? Thank you very much!
  23. mainequin

    Shadows in Custom Shader

    Dear Babylon JS community, we as a company have decided, that we want to use Babylon JS for a larger project. For this we have specific requirements for what the shaders have to be able to do. I will first state the problem I am trying to solve and then give the context, for possible alternative solutions. PROBLEMS: For our more complex shader computations we want to integrate shadows from at least one shadow-generator in a custom shader. For reasons of confidentiality I can not submit our current project code, that is why I created this test playground: http://www.babylonjs-playground.com/#VZKI0U We want to get the influence of all shadows on a fragment as a float value in the shader for further computations. For this we encountered the following problems: - Mapping to shadow-map coordinates seems to be wrong - using functions like computeShadow() from #include<shadowsFragmentFunctions> yields not-declared-error - computeShadow() yields always 1.0 as a result COURSE OF EVENTS: We started playing around with the standart material and shadow generators and quickly got them to work. we wrote a small utility function for setting up the shadow generators, which you can find at the top of the linked playground code. After this we played around with uploading textures into our custom shaders and were able to create the desired effects. We looked into uploading the shadow-map and the shadow-generator parameters into the shader, which was sucessful. You can find the uploads at line 113-115 of the linked playground code. Since we do not want to write the mapping to shadow map coordinates ourselves, we looked if there is already existing code, which we found in the shadowsVertex.fx, shadowsFragment.fx and shadowsFragmentFunctions.fx files. While trying to get the mapping right, we encountered the aformentioned problems. We were not able to get correct results regarding the shadow-uv-coordinates, shaderincludes like the above mentioned #include<shadowsFragmentFunctions> yields a "computeShadow() has not been declared" error when used in the code after the statement and what code we currently copied from these files seems to always yield 1.0 as a result for the sha- dow intensity. We are turning to you now, because we are at a point where we cannot find the errors in our approach/code anymore. We are required to use Babylon JS version 2.5 in our project. Although it didn't seem to make a difference for the shader code we looked through I wanted to mention it. CONTEXT: Our scene is basically shadeless, with multiple materials per object, distributed via a mask. Therefor we combine a precomputed light texture (for individual objects) with a diffuse texture and multiple material textures blended via a mask texture. Since we require no lighting computation we just want the shadow values to get some visual depth in the scene. Therefor the standart material seems to be not sufficient for our purposes, hence the reliance on a custom shader. I saw code that created a custom material with the standart shaders and then re- placed parts of the vertex and fragment code via a function. We would be ready to do this kind of code insertion, if it yields correct shadow information. Sadly I cannot find the example project for this anymore, so if you could provide a link to a simmiliar source it would be much appreciated. Thank you sincerely for your time and help With best regards from the green heart of Germany The Mainequin Team
  24. 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 !
  25. Hello, is it the correct behaviour that instances that are being disposed doesn't get removed from ShadowGenerator.getShadowMap().renderList ? I have the refreshrate set to 0 and only render with shadow on demand. if (_renderShadow && this._manuallyShadowRender) { this._shadowGenerator.getShadowMap().refreshRate = 1; this._scene.render(); this._shadowGenerator.getShadowMap().refreshRate = 0; } else { this._scene.render(); } Is this a problem i this case? I just want to know (maybe it's a bug). Shouldn't ShadowGenerator check the Mesh.isDisposed attribute? Have a nice day Kevin