Closed mightymarcus closed 8 years ago
What framework you're using BHx with (Lime/Snow/NME)?
also, bumpmap kills the perf on all targets or only on android. does it help if you freeze material? if possible try to build the same code with snow to see if it works on android and if there's any diff in performance
Thanks for the reply.
I'm using Lime.
Bumpmap kills performance only on android (web and native).
Freezing doesn't help.
I can't even build a BHx Sample with snow, I get a bunch of errors on each target.
Maybe I'm too stupid.
But I made this little game some month ago.
There is a bumpmap on the Mesh in the front. This runs smooth at 60FPS on my device (even in the browser). When I use the last version of BHx (the one before the latest), it just needs a single cube with a bumpmap texture on it, and the FPS is dropping down. This means there has to be a bug, because it was much better in the older version then. There I used lime too.
Maybe try it yourself with snow and compare the performance with lime. I really don't get it running with snow.
''' public function new(engine:Engine) { var scene = new Scene(engine); var light = new DirectionalLight("light", new Vector3(0, .4, .8), scene); var cam = new FreeCamera("freecam", new Vector3(0, 0, -5), scene);
var box = Mesh.CreateBox("box", 2, scene);
var mat = new StandardMaterial("boxmat", scene);
var btxt = new Texture("assets/textures/groundbump.png", scene);
mat.emissiveColor = new Color3(0, 0, 0.4);
mat.diffuseColor = new Color3(0, 0, 1);
btxt.uScale = 4;
btxt.vScale = 4;
mat.bumpTexture = btxt;
box.material = mat;
scene.executeWhenReady(function() {
engine.runRenderLoop(function()
{
box.rotation.x += 0.01;
box.rotation.y += 0.01;
scene.render();
});
});
}
'''
Ok, even with 3 cubes it runs fine now. I don't now what happend. Maybe my phone is as tired as me ;)
Coming back later, need a fps counter to measure the difference.
I can't get anything to render on android?! 'Basic scene' doesn't work too, 'BumpMap' sample neither ...
snow build works fine (web and win, android build doesn't work, have no idea why) there's no pref drop with bumpmaps: http://babylonhx.com/demos/bumpmapstresstest/ both web and win builds work fine (those are instances but still... maybe I should use clones instead)
Yes, the problem with the bumpmap occurs only on android for me Desktop is fine.I have a scene with some simple meshes and a ground. The ground gets a bumpmap texture and fps is dropping down so it is stuttering. And I can't try the latest Bhx version to see if the problem is gone because when I use a texture the mesh gets invisible.
I've tried on friends phone with android 4.1.2 and everything works fine, with and without bumpmaps. I have android 5.0.2 and nothing renders, not even LineMesh or mesh without textures in material. Another friend of mine has samsung s6 with android 5.0.0 and meshes with textures do not render (but those without textures do). So this is really strange... What version of android do you have ?
I have version 6.0. Maybe it's the shaders/opengl versions that works on one device but not on the other. I added some custom shaders in a demo and the most of them didn't work (this was on windows 10) until I added #version 130 to the shader code.
I've fixed this. I'll push the fix in a few hours when I get back home
this should be fixed now, I've just pushed an update. please check
Right.
When I assign a texture to a material, the mesh becomes invisible. That happens only on android.
In the last version of BHx applying a bumpmap totally kills the performance.