Material mat_brick = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
mat_brick.setTexture("DiffuseMap", assetManager.loadTexture("Textures/Untitled.png"));
block_geom.setMaterial(mat_brick);
to
Material mat_brick = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
mat_brick.setColor("Diffuse", new ColorRGBA(1f,1f,1f,1f));
block_geom.setMaterial(mat_brick);
My FPS drops from 100+ fps to ~30 fps.
Shouldn’t color be faster than a map? Why is it so much slower?
Okay took me awhile to get around to this but here it is:
You’ll need a texture in the classpath: Textures/planter.png and then you can press “Z” and “X” to switch on/off. Currently for me it goes from a stable 60 fps to about 29 fps.
More details:
Only happens when I have a directional light with a shadow map
Only happens when I have two objects
Only happens when 1 object is DiffuseMap and the other is Diffuse (color)
Really weird bug, because it shouldn’t make a difference, especially with a shadow map.
Mhh there is a lot of texture switches … (textures uploaded to the GPU). Probably due to the ShadowRenderer.
Gonna look into it.
In the mean time you can use the DirectionalShadowFilter with a FilterPostProcessor. It doesn’t exhibit the issue and you should have the same visual result.