Vousk-prod. Posted February 2, 2015 Share Posted February 2, 2015 Yes, but I think the idea of ozRocker is to test realtime shadows on imported complex (and polys heavy) meshes... Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 2, 2015 Share Posted February 2, 2015 get it to work here, It will work on complex objects.You can see in the example I pasted that the knot doesn't receive shadows correctly. The upper part should be lit and only the parts "under" other parts should receive the shadow. ozRocker 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 2, 2015 Share Posted February 2, 2015 And also there are lots of shadow's artifacts on the object we can see by zooming to it. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 2, 2015 Share Posted February 2, 2015 Since we are talking about shadows (I continue in this post instead of creating a new one), even on very simple mesh in some cases there are errors. Look at this PG ("playground") : http://www.babylonjs-playground.com/#1MYQJJ#19 The 2 boxes are same size, but one is half way through the ground. That one has a false strange shadow... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 2, 2015 Share Posted February 2, 2015 Hum..according to light position I think the shadow is pretty accurate Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 2, 2015 Share Posted February 2, 2015 What ? I'm starting to ask myself if we see the same result... . I'm using Firefox here. See on the picture, green shadows are ok, red one shouldn't be here... ozRocker 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 2, 2015 Share Posted February 2, 2015 (BTW I see the same on IE) Quote Link to comment Share on other sites More sharing options...
iiceman Posted February 3, 2015 Share Posted February 3, 2015 @Deltakosh, can you please explain why this shadow is "correct"? It seems like the light is coming from the other side of the plane to create the second shadow.. that's not really.. normal, is it? And here is another test case to demonstrate the shadow problem discussed in this thread: http://www.babylonjs-playground.com/#19SA2J#1As soon as any mesh is on the shadowMap renderList and has receiveShadows = true it shows this weird behaivor. In this playground it only stops if the meshes leave the area where the light is directed to, I think. ozRocker 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 4, 2015 Share Posted February 4, 2015 Playground: The weird effect is due to the fact that objects are OUTSIDE the field of view of the lightOther demo: I THINK this is an artefact due to the fact that we have not enough precision in the shadow map due to webgl restriction. I check this more precisely Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 4, 2015 Share Posted February 4, 2015 I confirm my diagnostic: using poissonSampling you have no more artifact because you readin 4 values and get an average http://www.babylonjs-playground.com/#1MYQJJ#25 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 4, 2015 Share Posted February 4, 2015 Actually this is even more related to VSM lost of precision. You can check it by setting shadowGenerator.useVarianceShadowMap = false http://www.babylonjs-playground.com/#19SA2J#3 Quote Link to comment Share on other sites More sharing options...
iiceman Posted February 4, 2015 Share Posted February 4, 2015 That sounds like a really easy solution. I am gonna try that out with my scene at home as soon as I have time. Thanks! Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 4, 2015 Share Posted February 4, 2015 Actually this is even more related to VSM lost of precision. You can check it by setting shadowGenerator.useVarianceShadowMap = false http://www.babylonjs-playground.com/#19SA2J#3 But in this example, we still have something strange appearing on the cube (when it is moving around lower left corner for instance) Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted February 4, 2015 Share Posted February 4, 2015 ozRocker, Can you try to set the directional light direction to (2, -2, -1) ?light = new BABYLON.DirectionalLight("dir", new BABYLON.Vector3(2, -2, -1), newScene); Quote Link to comment Share on other sites More sharing options...
spritefire Posted February 4, 2015 Share Posted February 4, 2015 With the knot test that was posted earlier :http://www.babylonjs-playground.com/#OPL98shouldn't the knot also have shadows on it caused by its parts blocking the light?I only ask because I haven't seen an example with this working in babylon yet. Here is a (very very rough) example of what I mean. or like this: Quote Link to comment Share on other sites More sharing options...
iiceman Posted February 4, 2015 Share Posted February 4, 2015 http://www.babylonjs-playground.com/#OPL98#1 spritefire and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted February 4, 2015 Author Share Posted February 4, 2015 ozRocker, Can you try to set the directional light direction to (2, -2, -1) ?light = new BABYLON.DirectionalLight("dir", new BABYLON.Vector3(2, -2, -1), newScene);ok, I've set the light to that direction. You can see it in http://www.punkoffice.com/babylon/luke_anim.html Quote Link to comment Share on other sites More sharing options...
ozRocker Posted February 28, 2015 Author Share Posted February 28, 2015 IT WORKS!!! I just tried out the new babylon.js version 2.1 (alpha) and I'm seeing objects are properly casting shadows on themselves. It works with my luke_anim demo and also the knots people have posted above. Thank you very much to whoever made those enhancements! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 2, 2015 Share Posted March 2, 2015 My pleasure One of the goal of the 2.1 is to improve shadows I updated the doc accordingly:http://doc.babylonjs.com/page.php?p=22151 iiceman, Vousk-prod. and jahow 3 Quote Link to comment Share on other sites More sharing options...
razieh Posted September 13, 2018 Share Posted September 13, 2018 On 1/30/2015 at 6:38 PM, Deltakosh said: I think that Gryff our master of Blender can help you for this one i have some shadows bake from blender and all my objects in scene are static .... and i dont need that babylon make for me shadows...... as i know in unity i have to just add my shaows to occulusion in material .... now my question is how can i add my own shadows to babylon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.