Skip to content

How to improve FPS in a JavaScript Three.js Simulation #139599

Discussion options

You must be logged in to vote

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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tahasatan666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Discussions around programming languages, open source and software development
2 participants