Search the Community
Showing results for tags 'pointlight'.
-
Hello Everyone ! I am currently working on an 'indoor' project and can't manage to solve an issue. I would like to render a room with a ceiling light. I am working with StandardMaterial only. I use a single pointLight to avoid heavy computations with multiple lights. Every mesh both cast and receive shadows. To see non-directly-illuminated mesh, I also use an ambientColor on every material on the scene. Thanks to Deltakosh's answers on a previous post, I managed to get correct shadows using Close Exponential Shadow Map by stretching my scene into a unit cube and setting the depthScale of the shadowGenerator to 1. I use shadowGenerator.setDarkness(0) to ensure shadows are the most dark as possible. However, even if these shadows are correct, they are way too light to be seen in my scene. I think this is both due to the depthScale and the fact that receiving-shadows-mesh material have an ambientColor. I thought about apply a filter directly in the shadows texture to increase level of gray in the entire image but I don't know how to get this texture and how to apply filter before the render. Do you know how to do that ? Or any ideas on how to reach my goal ? Because the room I would like to render is fully dynamic, I think I cannot use tricks like static lightMapping. PS : Here is a PG showing my problem. I would like the shadow to be darker. Thank you very much !
- 6 replies
-
- shadows
- closeexponentialshadows
-
(and 2 more)
Tagged with:
-
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
- 20 replies
-
- shadow
- pointlight
- (and 5 more)
-
Hi ! My question is in the title ! I've been testing with a moving pointLight, but its lighting still 'updates' either set to true or false. I wonder what needRefreshPerFrame does exactly just curious !
- 2 replies
-
- directionallight
- spotlight
-
(and 2 more)
Tagged with:
-
Hello, I'd like to access the babylonScene.ShadowGeneratorsList that SceneBuilder.Lights.cs uses, but I can't seem to find any variable that doesn't come up as undefined after I've called the SceneLoader.Load private void GenerateShadowsGenerator(Light light) { var generator = new BabylonShadowGenerator { lightId = GetID(light.gameObject), usePoissonSampling = light.shadows == LightShadows.Soft, mapSize = 256 + 256 * QualitySettings.GetQualityLevel(), bias = light.shadowBias / 10.0f, useBlurVarianceShadowMap = light.shadows == LightShadows.Soft }; var renderList = new List<string>(); foreach (var gameObject in gameObjects) { //why not deliver the boolean to the scene? I could use that boolean to manually create shadows inside babylon. var meshFilter = gameObject.GetComponent<MeshFilter>(); var renderer = gameObject.GetComponent<Renderer>(); if (meshFilter != null && renderer.shadowCastingMode != ShadowCastingMode.Off) { renderList.Add(GetID(gameObject)); continue; } var skinnedMesh = gameObject.GetComponent<SkinnedMeshRenderer>(); if (skinnedMesh != null && renderer.shadowCastingMode != ShadowCastingMode.Off) { renderList.Add(GetID(gameObject)); } } generator.renderList = renderList.ToArray(); babylonScene.ShadowGeneratorsList.Add(generator); //***How do i access this list in babylon?*** } The end goal here would be to emulate the Unity mesh renderer option to cast shadows or not. The exporter does this, but if I can't access the shadow generator list, I can't determine which meshes to push into the wanted shadow generators. That's my understanding of the problem at least. As an aside, I've created shadow generators for two point lights (manually), and I'm importing one spot light which I've positively determined has a shadow generator created for it somewhere. "shadowGenerators":[{"mapSize":1536,"bias":0.005,"lightId":"c21fd6a4-701a-4377-86b9-868b221c1c96","useVarianceShadowMap":false,"usePoissonSampling":true,"useBlurVarianceShadowMap":true,"blurScale":0,"blurBoxOffset":0,"renderList":["f808b945-1605-4e8f-8233-f75b89e55c71","0cc9fd1e-1a23-4c9e-9cef-5b0c87faf717","36d7e455-a32f-490a-b837-3043d6f30691","5091d4f8-2767-4e7e-acb6-a7c179b33583","c5313fc0-4edd-43d7-8dcf-85f76e83905f","d3d119e6-37f5-4725-af03-f470a755ac93","d5d11567-f959-4291-b784-ffb07089e6bd","9141800a-91a8-4d51-bceb-85df54d49e39","acce9ece-cd8f-42fb-98e7-53ff7de56315","cd22cc1d-07f7-4845-9de2-967f42eabf5b","0ad378ab-6f73-4861-91a9-bc649ffd4759","a8e8b351-71a2-4bb9-a995-736b637615a6","385b2d6a-a789-4a2a-ba99-73c45f096c8a","d056b786-d3d8-45dc-ae61-509a34b17f1a","0bf62911-a3cf-4bd8-a0b4-96fd20a89fd2","fdfc93be-5a6c-4049-80de-c6912168f1c8","25efb981-7f78-4c5c-8e28-cfde40b304f5","1bf1b3b6-b0fe-4fe5-a5af-1509ed156dbc","673a7d44-10c1-47e4-9d12-2c55322f3b28","aa4d1889-0951-4d43-81d8-5d774a7012d2","157582a5-5887-4661-bbf8-29aaa6da108c","7b3f2c8d-447b-41fa-9366-d007137e6a3c","c4860f5e-d38e-4285-a098-3a158564dd8e","f5e3a43a-4475-4c67-941d-bab8a377290e","49374c28-a289-471b-83df-2af6773d18b2","d8511075-b08c-47ea-a779-7720c91351ae","e2807f9b-3807-4ae0-bdff-86ab12195672","d730e55a-948c-4ac5-beef-a9eb8ae12479"]}],"skeletons":[],"actions":null} The only thing left I have to do is determine which meshes can cast shadows, and then push those meshes into the shadow generator render lists. Thank you for your time.
-
Hi, I saw that, with BJS v2.3, the shadows were working also for the point light. I can't see them in this example : http://www.babylonjs-playground.com/#1QXRNW#1 Did I miss something ? I know that I used a back sided big box to receive the shadows but it works well with the directional light.
-
Hi, PointLight in the Babylon preview release (also release currently available in the sandbox) makes a sharp light circle like this: In release 2.2 it was smooth like this: I need to use the latest release because in release 2.2 shaddows did not work for me. Please advise how can I make it smooth in the latest release. Thank you in advance! Vojtech