TheDude Posted August 8, 2016 Share Posted August 8, 2016 This may or may not be a bug, but tri planar terrain causes point lights to have an finite range. Seems to work fine in babylon.js playground.Will upload code tomorrow. Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 9, 2016 Author Share Posted August 9, 2016 Maybe I just don't have a full understanding of it but lighting works fine when the terrain has no material. Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 9, 2016 Author Share Posted August 9, 2016 I have now got a demo to show the problem. Note that light follows camera(but not rotation).Test it here. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 9, 2016 Share Posted August 9, 2016 Hey, @Luaacro will soon be with you (I'm guessing the material does not support range at all :)) Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 9, 2016 Author Share Posted August 9, 2016 Thanks, well the material supports limited range! Definitely doesn't work in playground either. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 10, 2016 Share Posted August 10, 2016 @TheDude Please give us a playground. Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 10, 2016 Author Share Posted August 10, 2016 @DigiHz Data http://www.babylonjs-playground.com/#1OUIMU, here you go. Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 10, 2016 Author Share Posted August 10, 2016 @DigiHz Data So here's the deal, after experimenting, it turns out that all normal textures need to be added for it to fully work.It says: Quote // The 3 diffuse textures must be set, even if they share the same texture reference But then says: Quote // In the case of normal maps, it is not necessary to set the 3 textures So Either this is the real bug or the second quote was meant to be true when the developer created the extension. Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted August 10, 2016 Share Posted August 10, 2016 @TheDude Hi It looks like you are right, when we don't set the 3 normal map textures lighting is badly computed. I'll fix it ! Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 10, 2016 Author Share Posted August 10, 2016 Great! Thanks! Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 11, 2016 Author Share Posted August 11, 2016 Also while I'm at it @Deltakosh getHeightAtCoordinates only works work CreateGround and not GreateGroundFromHeightMap, i'm not sure if this is a bug of a feature yet to be added? Did not find documentation of GreateGroundFromHeightMap in the classes section because there is no page?Anywys thought I would let it be known because this is a useful function for placing trees on and other stuff on the terrain. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 11, 2016 Share Posted August 11, 2016 Pinging @jerome who did some works around this Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 11, 2016 Author Share Posted August 11, 2016 Also should be noted that only one triplanar material is supported at a time which does not workin out if you try to chunk the terrain. @Luaacro Though I'll have a check of the code to see why that might be. julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted August 12, 2016 Share Posted August 12, 2016 could you reproduce the bug in a PG please ? The computation of the height normally should work for any GroundMesh mesh, so for ground generated from a height map too : http://jerome.bousquie.fr/BJS/demos/getHeightAtCoordinates.html doc : http://doc.babylonjs.com/classes/2.4/GroundMesh + MeshBuilder for height map ground : http://doc.babylonjs.com/classes/2.4/MeshBuilder#static-creategroundfromheightmap-name-url-options-scene-rarr-groundmesh-classes-2-4-groundmesh- Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 12, 2016 Author Share Posted August 12, 2016 PG probably just me missing something but here it is: http://www.babylonjs-playground.com/#1OUIMU#4 @jerome Quote Link to comment Share on other sites More sharing options...
jerome Posted August 13, 2016 Share Posted August 13, 2016 ok, I'll check this Quote Link to comment Share on other sites More sharing options...
jerome Posted August 13, 2016 Share Posted August 13, 2016 Actually there's no bug : http://www.babylonjs-playground.com/#1OUIMU#5 You just started to call getHeightAtCoordinates before the ground has finished to be computed (classical mistake). There's a delay in the height map texture download time, so the mesh isn't yet finalized when you call getHeightAtCoordinates() You need to make sure, with the parameter onReady (a callback function) that the mesh is finalized before starting any computation on it. GameMonetize and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
TheDude Posted August 13, 2016 Author Share Posted August 13, 2016 Oh wow! How did I miss that, and to think that I'm using that function right now for something else. Thanks anyway @jerome 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.