How to improve FPS in a JavaScript Three.js Simulation #139599
-
BodyHi Experts, Here is my webgl-renderer and orbit controls code blocks; createRenderer() { renderScene() { Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This usually means your device is hitting limits in the fragment shader. PBR materials (MeshStandardMaterial, MeshPhysicalMaterial), the number of lights in the scene, and shadows all increase the cost of the fragment shader, and zooming in fills the screen with those expensive fragments. To improve performance in this situation, you can do things like: (a) reduce the number of lights If you’re exporting glTF/GLB from Blender, you could get Standard, Physical, or Basic materials in three.js. To get Phong or Lambert you would have to traverse the objects and replace their materials. |
Beta Was this translation helpful? Give feedback.
This usually means your device is hitting limits in the fragment shader. PBR materials (MeshStandardMaterial, MeshPhysicalMaterial), the number of lights in the scene, and shadows all increase the cost of the fragment shader, and zooming in fills the screen with those expensive fragments.
To improve performance in this situation, you can do things like:
(a) reduce the number of lights
(b) bake lights
(c) use cheaper materials like MeshPhongMaterial, MeshLambertMaterial, or MeshBasicMaterial (unlit)
If you’re exporting glTF/GLB from Blender, you could get Standard, Physical, or Basic materials in three.js. To get Phong or Lambert you would have to traverse the objects and replace their mat…