When my camera pulls close to an object, the scene becomes stuck and the frame rate drops seriously. What is the reason?
It is likely caused by using PBR materials (MeshStandardMaterial / MeshPhysicalMaterial) on that object. These two materials are quite time-consuming to render, so the more pixelsš on the screen include them - the longer it will take to render the entire screen on each frame.
If possible, for low-end devices consider using MeshLambertMaterial (for rough surfaces) / MeshPhongMaterial (for shiny surfaces) instead of PBR materials. You can also try limiting the amount of lights in the scene.
(š - or âfragmentsâ; but itâs easier to imagine and understand with pixels )
But I use editor to load the same model, but there will be no such problem.
In that case itâs hard to say what may be causing it without seeing a codepen / live demo
Nevertheless, Iâd still consider at least changing the material - just to check thatâs not the issue.
Did you find any reason for the frame drop?
This is an internal IP address on your own local network. Nobody can access this besides yourself and people in your network (if your firewall allows it).
Perhaps you have too many lights? These increase the cost of the fragment shader, which does more work as you zoom in. But just guessing, a demo would be best.
Is it accessibleďź
I canât tell what the framerate is and it doesnât seem to decrease very much when I zoom in, on my computer, but general if you âfill the screenâ with MeshStandardMaterial (which is what this model uses) it is not unlikely that this will reduce your framerate. Lots of other things might contribute too, like your renderer configuration or the IBL, but I think it is a good idea to test cheaper materials as @mjurczyk suggests.
Sorry, I just removed the dom of my frame rate monitor
I added the dom of frame rate monitoring. You can try to drag the object when the lens is close, and you can feel the frame rate drop obviously
It remains at a steady 60fps even when zoomed in, at least on my computer (2012 Macbook Pro). But not all computers are alike. The earlier comments are still the most likely way to improve framerate regardless of your computer â if MeshStandardMaterial is too expensive when it fills your screen, use a cheaper material like MeshPhongMaterial.