Difference between revisions of "Aggressive Optimizations"

From Verge3D Wiki
Jump to navigationJump to search
m
Line 1: Line 1:
Here is the list of aggressive optimizations you can use for your Verge3D apps when nothing else helped. All these techniques reduce quality of your apps, so use with caution! Normally, you should always stick to the "official" recommendations specified [https://www.soft8soft.com/docs/manual/en/introduction/Optimizing-WebGL-performance.html here] and [https://www.soft8soft.com/docs/manual/en/introduction/Performance-Bottlenecks.html here].
Here is the list of aggressive optimizations that you can use as quick & dirty hacks to boost performance of your apps. All these techniques reduce rendering quality, so use them with caution! Normally, you should always be patient and stick to the "official" recommendations specified [https://www.soft8soft.com/docs/manual/en/introduction/Optimizing-WebGL-performance.html here] and [https://www.soft8soft.com/docs/manual/en/introduction/Performance-Bottlenecks.html here].


== Disable shadows ==
== Disable shadows ==


Can help a lot, especially if you use a lot of shadow sources, PCF (Poisson Disk) / ESM shadow algorithms, or shadows from the point lights.
This can help a lot, especially if you:
 
* Use huge shadow maps (perhaps it's time to reduce [https://www.soft8soft.com/wiki/index.php/Common_gotchas_with_Verge3D#Huge_shadow_maps] their size!)
* Use a lot of shadow sources (stick to just one!)
* Use PCF (Poisson Disk) / ESM shadow filtering (choose [https://www.soft8soft.com/docs/manual/en/blender/Shadows.html#shadow_filtering Basic or Bilinear])
* Cast shadows from the point lights (never!)


== Disable post-processing ==
== Disable post-processing ==


It's not always about post-processing puzzles. Don't forget about Ambient Occlusion and Outlining which can be enabled in the modelling suite!
It's not always about post-processing puzzles. Don't forget about [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#ambient_occlusion ambient occlusion] and [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#outline_rendering outlining] which are enabled in the modeling suite!


== Remove reflection cubemaps and planes ==
== Disable HDR rendering ==


Reflection cubemaps affect loading speed, planes affect both loading speed and rendering performance.
Of course you [https://www.soft8soft.com/wiki/index.php/Common_gotchas_with_Verge3D#Enabling_HDR_Rendering_when_not_required never enable it] without proper thinking.


== Reduce amount of rendered pixels ==
== Remove reflection cubemaps and planes ==


Use the [https://www.soft8soft.com/docs/manual/en/puzzles/System.html#set_screen_scale set screen puzzle] with value < 1 (say 0.5).
[https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#light_probes Reflection cubemaps] affect loading speed, [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#reflection_plane_light_probes planes] affect both loading speed and rendering performance. Both consume GPU memory.


== Use either light sources or HDR environment reflections ==
== Use either light sources or HDR environment reflections ==
Line 21: Line 26:
Stick to one of them:
Stick to one of them:


* Keep light sources (preferably one light) but disable specular environment reflections by switching IBL mode: no PMREM, no Light Probe + Cubemap, use Light Probe which provides only diffuse lighting.
* Keep light sources (preferably one light) but disable specular environment reflections by switching [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#ibl_environment_mode IBL mode] - use Light Probe which provides only diffuse lighting.
 
* Remove all light sources. For better performance you might switch [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#ibl_environment_mode IBL mode] to "Light Probe + Cubemap".
 
== Set IBL cubemap size to 256 ==
 
Quick and easy, almost no quality harm, but makes your app less VRAM-hungry. See [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#global_rendering_properties_indirect here].
 
== Set View Transform to Standard ==
 
Blender only. Perhaps you didn't even know about the [https://www.soft8soft.com/docs/manual/en/blender/Lighting-and-Rendering.html#global_rendering_properties_color_management existence] of this Blender setting... It's nothing serious, just minor FPS boost and minor reduction of the scene loading time. However, it is just a couple of clicks and brings you no quality harm (just slightly different scene look).
 
== Reduce amount of rendered pixels ==


* Remove all light sources. For better performance you might switch IBL mode to Light Probe + Cubemap.
This one is brutal. Use the [https://www.soft8soft.com/docs/manual/en/puzzles/System.html#set_screen_scale set screen puzzle] with value < 1. Start with 0.75 and continue to 0.5.


== Emission shading only ==
== Emission shading only ==


Absolute hardcore which can make your scene as fast as a lightning bolt. Bake everything to textures (ambient occlusion, lighting, diffuse) and use only emission shaders.
Absolute hardcore which can make your scene as fast as a lightning bolt. This is how good old 3D games were made back in 90-es. Don't worry about quality, though, since in 2020-es you have way more geometry and larger textures in your possession.
 
The idea is simple - bake everything to textures (ambient occlusion, lighting, diffuse) and use only emission shaders.

Revision as of 20:12, 7 December 2022

Here is the list of aggressive optimizations that you can use as quick & dirty hacks to boost performance of your apps. All these techniques reduce rendering quality, so use them with caution! Normally, you should always be patient and stick to the "official" recommendations specified here and here.

Disable shadows

This can help a lot, especially if you:

  • Use huge shadow maps (perhaps it's time to reduce [1] their size!)
  • Use a lot of shadow sources (stick to just one!)
  • Use PCF (Poisson Disk) / ESM shadow filtering (choose Basic or Bilinear)
  • Cast shadows from the point lights (never!)

Disable post-processing

It's not always about post-processing puzzles. Don't forget about ambient occlusion and outlining which are enabled in the modeling suite!

Disable HDR rendering

Of course you never enable it without proper thinking.

Remove reflection cubemaps and planes

Reflection cubemaps affect loading speed, planes affect both loading speed and rendering performance. Both consume GPU memory.

Use either light sources or HDR environment reflections

Stick to one of them:

  • Keep light sources (preferably one light) but disable specular environment reflections by switching IBL mode - use Light Probe which provides only diffuse lighting.
  • Remove all light sources. For better performance you might switch IBL mode to "Light Probe + Cubemap".

Set IBL cubemap size to 256

Quick and easy, almost no quality harm, but makes your app less VRAM-hungry. See here.

Set View Transform to Standard

Blender only. Perhaps you didn't even know about the existence of this Blender setting... It's nothing serious, just minor FPS boost and minor reduction of the scene loading time. However, it is just a couple of clicks and brings you no quality harm (just slightly different scene look).

Reduce amount of rendered pixels

This one is brutal. Use the set screen puzzle with value < 1. Start with 0.75 and continue to 0.5.

Emission shading only

Absolute hardcore which can make your scene as fast as a lightning bolt. This is how good old 3D games were made back in 90-es. Don't worry about quality, though, since in 2020-es you have way more geometry and larger textures in your possession.

The idea is simple - bake everything to textures (ambient occlusion, lighting, diffuse) and use only emission shaders.