Kita Posted September 27, 2014 Share Posted September 27, 2014 Hi, i'm new to babylon.js and i have some trouble. I generate some plane meshes 25x25 with the same textures. Then the FPS go down to 30, but i think thats not a big 3d-Scene, the Examples on babylonjs.com are more complex and run in 60 FPS. I try it with runRenderLoop and with window.setTimeout both max 30 FPS. Here is my code:var createScene = function () { var scene = new BABYLON.Scene(engine); //Create a light var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(-60, 60, 80), scene); var light0 = new BABYLON.HemisphericLight("Hemi0", new BABYLON.Vector3(0, 1, 0), scene); light0.diffuse = new BABYLON.Color3(1, 1, 1); light0.specular = new BABYLON.Color3(1, 1, 1); light0.groundColor = new BABYLON.Color3(0, 0, 0); var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 0, -40), scene); scene.activeCamera = camera; scene.activeCamera.attachControl(canvas); var materialPlane = new BABYLON.StandardMaterial("texturePlane", scene); materialPlane.diffuseTexture = new BABYLON.Texture("textures/grass.jpg", scene); materialPlane.diffuseTexture.uScale = 1.0;//Repeat 5 times on the Vertical Axes materialPlane.diffuseTexture.vScale = 1.0;//Repeat 5 times on the Horizontal Axes materialPlane.backFaceCulling = false;//Allways show the front and the back of an element var x,y; var width = 25; var height = 25; var startx = -(width*1.1)/2; var starty = -(height*1.1)/2; for(x=0;x<width;++x) { for(y=0;y<height;++y) { var plane = BABYLON.Mesh.CreatePlane("plane", "1", scene); plane.position.x = startx+x*1.1; plane.position.y = starty+y*1.1; plane.material = materialPlane; } } return scene;}Its that ok, when i use the same material on different meshes? How can i create a texture with a Subimage, uOffset and vOffset doesn't work? best regards, Kita Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2014 Share Posted September 28, 2014 To achieve far greater performance, it could be interesting to merge your meshes into one single mesh. SOmething like this: var globalVertexData = new BABYLON.VertexData(); for (var i = 0; i < count; i++) { var planeVertexData = BABYLON.VertexData.CreatePlane(128); delete planeVertexData.normals; // We do not need normals // Transform var randomScaling = Math.random() * Math.random() * 1.5 + 0.5; var transformMatrix = BABYLON.Matrix.Scaling(randomScaling, randomScaling, 1.0); transformMatrix = transformMatrix.multiply(BABYLON.Matrix.RotationZ(Math.random() * Math.PI)); transformMatrix = transformMatrix.multiply(BABYLON.Matrix.Translation(Math.random() * 1000 - 500, -Math.random() * Math.random() * 100, count - i)); planeVertexData.transform(transformMatrix); // Merge globalVertexData.merge(planeVertexData); } var clouds = new BABYLON.Mesh("Clouds", scene); globalVertexData.applyToMesh(clouds);Live example here:http://www.babylonjs.com/scenes/clouds/ Quote Link to comment Share on other sites More sharing options...
AlexB Posted September 28, 2014 Share Posted September 28, 2014 I'm getting pretty poor performance from that demo, Deltakosh. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2014 Share Posted September 28, 2014 This may be because there are more than 12000 clouds Quote Link to comment Share on other sites More sharing options...
joshcamas Posted September 28, 2014 Share Posted September 28, 2014 46 FPS Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 29, 2014 Share Posted September 29, 2014 http://www.babylonjs.com/playground/#2HO8HK I'm seeing fps of around 10... (ff30) and that's after I removed a light, reduced the number of planes, and removed the textures. 9 fps in IE11. That seems pretty low.... for only 225 vertices. *shrug* Maybe Kita and I need some byte lube. Quote Link to comment Share on other sites More sharing options...
joshcamas Posted September 29, 2014 Share Posted September 29, 2014 60 fps for me... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 29, 2014 Share Posted September 29, 2014 Have google chrome no problem. 60fps.I Firfox with 59 fps but when I go full screen, and I sort of full screen I am 40 fps, but with google chrome it works very well. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 29, 2014 Share Posted September 29, 2014 60fps on my intel HD4400 (one of the slowest gfx card ever:)) with IE Quote Link to comment Share on other sites More sharing options...
Kita Posted September 29, 2014 Author Share Posted September 29, 2014 Thanks for the answers, i will try the merging. but how can i create multible planes with different textures? And the other question, how can i create a texture with a Subimage, uOffset and vOffset doesn't work?The SpriteManager can use different Subimages in Sprite.playAnimation. Best regards, Kita Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 29, 2014 Share Posted September 29, 2014 Ok so for multi materials, here is a topic for you:http://blogs.msdn.com/b/eternalcoding/archive/2013/07/10/babylon-js-using-multi-materials.aspx For subimage, I do not get your point:( COuld you give an example? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 29, 2014 Share Posted September 29, 2014 Hey Kita (and others)... what FPS do you get for this particles demo... http://www.babylonjs.com/playground/?12 ? I'm around 52 FPS on it. http://www.babylonjs...yground/#2HO8HK ...is so much slower. hmmm. There has to be a logical explanation for this. When I first arrive at the page, my FPS is at 60. Five seconds later... boom, 10 FPS. *scratch scratch* One would think that the particles demo would be much more "heavy" than Kita's thing. But my FPS says noooo... Kita's thing appears 5 times heavier. I am perplexed. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 29, 2014 Share Posted September 29, 2014 Very strange...Do you have the same performance on chrome, IE and firefox? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 30, 2014 Share Posted September 30, 2014 Hi dk! Same results for my auto-updating IE11. (insignificant performance differences from FF). Win 7 - Google Chrome... I can't get it to do webGL. When the Chrome browser launches, I get 5 little popups (opening all at once) with only an "ok" button on each. They are all blank, or white text on white backdrop... and text (if its there) is un-highlight-able. They can be closed. Browser window looks fine, but can't do webGL. I've tried the web-suggested ways of making Chrome's webGL work, but all webGL demos claim "not webGL ready". Personal problem. Those 5 popups are indicating SOMETHING, but without text on them, it is difficult to determine what they indicate. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 30, 2014 Share Posted September 30, 2014 Oh oh.. I know what is it then. You have a driver issue (A black listed driver). Update your driver (or your gfx card:)) IE runs in software mode on blacklisted drivers Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 30, 2014 Share Posted September 30, 2014 Ok, I'll see what can be done, but last I checked, I have the newest driver available for this on-MB video. Not sure if its pertinent, but in both my browsers... if I turn the camera until the planes are out of view, the fps is back to 60+. Ok, thanks for the info... I'm off on a driver updating mission. But I think I will fail. I went down this path before, back when we struggled to get the mirrored video running. Update: http://www.dell.com/support/home/us/en/04/product-support/servicetag/2DS0GK1/drivers?DCP=DndTag&s=DHS No new video drivers available. There is a BIOS upgrade there, but when attempting to install... computer reports that my current BIOS is the same or newer, already. Still researching. Quote Link to comment Share on other sites More sharing options...
Kita Posted September 30, 2014 Author Share Posted September 30, 2014 @Deltakosh: Thanks thats what i need When i use "textures/player.png", i will not use the first SubImage, but the second or third one as a Texture. Just like a tileset https://wiki.themanaworld.org/images/c/c3/Woodland_Tileset.png , sorry for my english @Wingnut: I have the same Problem if i use 25x25 Planes, and turn the camera 60+. Best regards, Kita Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 30, 2014 Share Posted September 30, 2014 Thanks, Kita! Kita, could you please browse http://www.babylonjs.../playground/?12 and report your fps? Thanks. Quote Link to comment Share on other sites More sharing options...
Kita Posted September 30, 2014 Author Share Posted September 30, 2014 I have on all playgrounds and all examples(Reciprocating engine) 60+. But my 25x25 Planes are only 30 FPS Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 30, 2014 Share Posted September 30, 2014 nod, thanks, Kita. Now I feel old and slow. Oh wait. I AM old and slow. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted September 30, 2014 Share Posted September 30, 2014 Did you try this Wingnut. It finds all the updated driver on your computer. http://www.touslesdrivers.com/index.php?v_page=30&v_forum=0 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 1, 2014 Share Posted October 1, 2014 Thanks for the link, Dad72! Actually, I already have one of these. It is built-into the Win7 device manager. The driver details list... http://urbanproductions.com/wingy/babylon/misc/driverdetails.jpg The search panel... http://urbanproductions.com/wingy/babylon/misc/driversearch.jpg The results... http://urbanproductions.com/wingy/babylon/misc/driverwork.jpg I have also scoured the Dell video drivers update pages, and they report the same. (darnit) (Sorry for the off-topic stuff, here, gang. Thanks for the help.) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 1, 2014 Share Posted October 1, 2014 It has nothing to do with what you find in the device manager of Win7 which is never nothing to update or rarely. with the link, you have an advanced search and specify who always finds something to update. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 1, 2014 Share Posted October 1, 2014 Wow, that's a nice piece of software. It found a newer (2012) driver, at Intel. Unfortunately, after the driver installed, no changes are seen in all three browsers. But thanks again for the link, software, and good advice (and a fresher GFX driver). I am going to continue the investigation, of course. I'm sure glad Ma-Config allowed English language. I was scared, at first. Maybe it's time for this 6 year old desktop to retire to media server status. Quote Link to comment Share on other sites More sharing options...
Kita Posted October 1, 2014 Author Share Posted October 1, 2014 (edited) I think thats not a Graphic Propblem, its a the CPU Problem, when i use IE / Chrome with useing only one CPU 100%.If I turn the camera until the planes are out of view, the fps is back to 60+ and CPU go down to 10%. Is my Browser using CPU insteat of GPU? I have an i5-460M CPU and NVIDIA GT 420M. How can i detect if my Browser use the CPU or the GPU? In Chrome i have opened the url "chrome://gpu/" they show me all "Hardware accelerated" only Rasterization "Software only". Best regards, Kita Edited October 1, 2014 by Kita 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.