www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: kiffa on April 07, 2013, 03:47:29 pm

Title: Does the fog affect the performance heavily?
Post by: kiffa on April 07, 2013, 03:47:29 pm
In my racing game, if i disable fogging, FPS = 50 - 54,  if i enable, FPS = 38 - 44. I don't know if i use it in a wrong way. Codes:

Code: [Select]
world.setFogging(World.FOGGING_ENABLED);
 world.setFogParameters(3000, 3500, 155, 155, 155);
Title: Re: Does the fog affect the performance heavily?
Post by: EgonOlsen on April 08, 2013, 07:20:06 am
Which OpenGL mode are you using (1.x or 2.0)?
Title: Re: Does the fog affect the performance heavily?
Post by: kiffa on April 08, 2013, 08:42:18 am
2.0

04-08 14:34:15.520: D/Woo3d(26573): GL vendor:NVIDIA Corporation
04-08 14:34:15.520: D/Woo3d(26573): GL version:OpenGL ES 2.0
04-08 14:34:15.530: D/Woo3d(26573): GL renderer:NVIDIA Tegra
04-08 14:34:15.530: D/Woo3d(26573): GLSL version:OpenGL ES GLSL 1.00
Title: Re: Does the fog affect the performance heavily?
Post by: EgonOlsen on April 08, 2013, 10:17:55 am
Fog in OpenGL ES 2.0 is slower than in 1.1 because it has to be done in the fragment shader. Depending on the device that you are using, the performance impact might be normal. However, the set of default shaders is limited and not all of them support fog. So it might happen that you get an optimized shader without fog, but a more generic (=slower) one with fog. Can you tell me how many texture layers and lights affect the fogged objects?
Title: Re: Does the fog affect the performance heavily?
Post by: kiffa on April 18, 2013, 05:30:31 am
Can you tell me how many texture layers and lights affect the fogged objects?

Only one texture layer, and only ambientLight.
Title: Re: Does the fog affect the performance heavily?
Post by: EgonOlsen on April 18, 2013, 08:28:04 am
Well, that's pretty basic. In that case, there's nothing you can do. The performance impact comes from the additional complexity of the shader. Tegra2 isn't very good when it comes to shaders anyway, so that might be a reason. It might have less of an impact on more powerful chips.