Ahiru Posted September 17, 2015 Share Posted September 17, 2015 I have a simple scene: http://playground.babylonjs.com/#CTHIE#4 Should there not be only ONE draw call and ONE material? Why there are 3 respectively 2 of them? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 17, 2015 Share Posted September 17, 2015 1 draw call only for me and 3 materials here Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 17, 2015 Author Share Posted September 17, 2015 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 17, 2015 Author Share Posted September 17, 2015 My problem is that I have several of these boxes in one scene, and they always cause 3 draws per box - that adds up fast. And meshing them did not work either, because they are not rendered, then. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 17, 2015 Share Posted September 17, 2015 Ahiru, I got the same result as Jerome. cheers, gryff Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 17, 2015 Share Posted September 17, 2015 I get 1 draw & 3 materials, using Firefox 40. Notice that you are pushing 78k vertices. Which exporter are you using? Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 17, 2015 Author Share Posted September 17, 2015 *blush* - wrong link in clipboard. Edited! Quote Link to comment Share on other sites More sharing options...
adam Posted September 17, 2015 Share Posted September 17, 2015 The href is still pointing to the original link. Here: http://www.babylonjs-playground.com/#CTHIE#4 Quote Link to comment Share on other sites More sharing options...
adam Posted September 17, 2015 Share Posted September 17, 2015 Looks like "show bounding box" requires 2 draw calls per mesh. Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 17, 2015 Author Share Posted September 17, 2015 Hmm - is there a better way just to show the edges like a wireframe? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2015 Share Posted September 18, 2015 you can set material.wireframe = true:http://www.babylonjs-playground.com/#CTHIE#5 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 18, 2015 Author Share Posted September 18, 2015 I tried already before (was my first idea) - but nothing is shown: http://www.babylonjs-playground.com/#CTHIE#6 Your example uses "CreateBox" again, ignoring, that I only have the min and max Verticex to create the box. (I know - I could write a function that calculates from there the center and scaling-factors and create a box and scale and move it around - and use the RenderEdges function in the end, because the wireframe splits the faces of the cube, wich is not intended) But I liked it to see that there seemed an easy way to build a box with 2 Vertices only: - only the 3 draw calls for the bounding box are irritating and makes it slow in the end var min_coordinates = new BABYLON.Vector3(-4, -10, -2);var max_coordinates = new BABYLON.Vector3(20, 1, 10);var custombb_mesh = new BABYLON.Mesh("custom_boundingbox", scene);var vertexdata = new BABYLON.VertexData();vertexdata.indices = [];vertexdata.positions = [ min_coordinates.x, min_coordinates.y, min_coordinates.z, max_coordinates.x, max_coordinates.y, max_coordinates.z];vertexdata.applyToMesh(custombb_mesh);custombb_mesh.showBoundingBox = true; Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 18, 2015 Author Share Posted September 18, 2015 By the way DK - you asked for wishes for the next version: How about: BABYLON.BoundingBox.Show() ? I use it for debugging reasons to visualise my bounding - boxes. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2015 Share Posted September 18, 2015 what do you mean by show? you can enable mesh.showBoundingBox = true Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 18, 2015 Author Share Posted September 18, 2015 Yes - that's when a mesh exists, that has a BoundingBox - what about manual created boundingBoxes like I would use to visualise the bounding boxes of an Octree? Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 18, 2015 Author Share Posted September 18, 2015 Concrete (please don't look too close at the code - not ready yet ): http://playground.babylonjs.com/#URBLI#31 But every box will take 3!! draw-calls making it unusable for bigger Tree-Visualisations Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2015 Share Posted September 18, 2015 I reduced it thanks to some optims http://playground.babylonjs.com/#URBLI#32 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 18, 2015 Author Share Posted September 18, 2015 Hey - thanks - works well! 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.