snot224 Posted January 2, 2016 Share Posted January 2, 2016 Hi all, and Happy New Year !!!!! I come with an over problem.I've got a ground, and some meshes on it (this is a strategy game). I've got 2 viewports, 1 for the game, and 1 for minmap to have a global view.I would like to show or not some meshes on the minmap viewport (like skydome, building to replace it with sprite, etc etc ...), I read about the layermask, it is working fine until I put shadow on my scene .... If I hide meshes on minmap, shadow disapear in the over viewport ... Here the playground exemple : You just have to switch between line 36 and 37 with comment to saw what I mean. http://www.babylonjs-playground.com/#1WELNV#1 Some good idea ? Quote Link to comment Share on other sites More sharing options...
snot224 Posted January 4, 2016 Author Share Posted January 4, 2016 Hi, no one have solve this problem ? there is a problem with my implementation ? Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted January 4, 2016 Share Posted January 4, 2016 I did not solve this yet, but I have a similar problem (I am using two cameras, one is an overview, one is for close view. The overview uses a simple object, the close view uses a detailed object). I swapped the order of cameras in your scene, and now only the shadow remains. It is maybe better if you replace the object with some sprite, it still has the shadow.http://www.babylonjs-playground.com/#1WELNV#2 The shadowGenerator, and the rendertarget in it, uses the first active camera I think. In /src/Lights/babylon.directionalLight: DirectionalLight.prototype.setShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { var activeCamera = this.getScene().activeCamera; So I don't know the solution yet, but we have a similar problem. Quote Link to comment Share on other sites More sharing options...
snot224 Posted January 4, 2016 Author Share Posted January 4, 2016 I did not solve this yet, but I have a similar problem (I am using two cameras, one is an overview, one is for close view. The overview uses a simple object, the close view uses a detailed object). I swapped the order of cameras in your scene, and now only the shadow remains. It is maybe better if you replace the object with some sprite, it still has the shadow.http://www.babylonjs-playground.com/#1WELNV#2 The shadowGenerator, and the rendertarget in it, uses the first active camera I think. In /src/Lights/babylon.directionalLight: DirectionalLight.prototype.setShadowProjectionMatrix = function (matrix, viewMatrix, renderList) { var activeCamera = this.getScene().activeCamera; So I don't know the solution yet, but we have a similar problem. Thanks for you answer, I'm glad to see that I'm not the only one that catch this problem. I will check around this function but I think I will just create a 2D pictures and will interpolate coordinate to match wil real map, because it sound like easiest way. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 4, 2016 Share Posted January 4, 2016 This is a tough question. Shadows are generated once because this is an expansive process. Which means that if you have it for one camera you have it for all. I suggest using clone: one object for the main camera and a clone for the viewport 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.