Home › Forums › General Questions › help with showFPS
- This topic has 9 replies, 5 voices, and was last updated 4 years, 4 months ago by web.
-
AuthorPosts
-
2020-06-15 at 2:31 pm #28854core3dCustomer
Hello,
I’m trying to make my scene as efficient as i can so i wanted to see FPS on my scene while i building. Using the latest pre3 version and triple F shortcut not working on my browser and im not sure how to enable showFPS() function in myscene.js file. help please.2020-06-16 at 7:50 am #28870Ivan LyubovnikovStaffHi,
This feature should work out of the box for all new projects, but for old ones that based on an older version of Verge3D you have to update them as described here: https://www.soft8soft.com/docs/manual/en/introduction/App-Manager.html#Update
Co-founder and lead developer at Soft8Soft.
2020-06-18 at 9:34 am #28963core3dCustomerEdit: Nevermind it works now. if you update your old projects it won’t work but if you make a new one it works. At least in my case.
2020-06-28 at 11:24 pm #29358GLiFTeKCustomerHi,
This feature should work out of the box for all new projects, but for old ones that based on an older version of Verge3D you have to update them as described here: https://www.soft8soft.com/docs/manual/en/introduction/App-Manager.html#Updatehow do you update a text object updated with the fps?
i tried a js call, but don’t seem to be able to get the syntax correct.Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-06-29 at 1:01 pm #29373Ivan LyubovnikovStaffhow do you update a text object updated with the fps?
i tried a js call, but don’t seem to be able to get the syntax correct.Do you mean Blender’s Text objects? Because there’s no need to update the FPS counter itself, I was just saying about updating an application to the newer version of verge3d.
Co-founder and lead developer at Soft8Soft.
2020-07-01 at 7:59 pm #29489GLiFTeKCustomerhow do you update a text object updated with the fps? i tried a js call, but don’t seem to be able to get the syntax correct.
Do you mean Blender’s Text objects? Because there’s no need to update the FPS counter itself, I was just saying about updating an application to the newer version of verge3d.
well i was trying to get the fps to link to an updated blender text object for a readout, how does one use the ” .showFPS () : null ” line? wrap in a function? assign it a true value?
put in run code area of bottom of myapp.js I’m thinking? or in the default generated area?
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-07-03 at 8:54 am #29606Ivan LyubovnikovStaffwell i was trying to get the fps to link to an updated blender text object for a readout, how does one use the ” .showFPS () : null ” line? wrap in a function? assign it a true value?
You can put
app.showFPS();
in runCode to enable it via js (andapp.hideFPS()
to disable). And there’s also a hotkey to switch it: just pressF
3 times.But this feature is just a small widget displaying FPS in the top left corner. It’s not well-suited for obtaining/utilizing the FPS value. If you need to calculate it I’d suggest to do that in a render callback:
function runCode(app) { // add your code here, e.g. console.log('Hello, World!'); var avgFPS = 0; app.renderCallbacks.push(function(delta, elapsed) { var FPS_INERTIA = 1; if (delta > 0) { avgFPS = v3d.MathUtils.expAverage(avgFPS, 1 / delta, delta, FPS_INERTIA); var fps = Math.round(avgFPS); // update objects, display FPS here, etc... } }); }
– then you can use that
fps
variable for updating a text object, for example:textObj.geometry = textObj.geometry.cloneWithText(String(fps) + ' FPS');
Co-founder and lead developer at Soft8Soft.
2020-08-11 at 3:26 pm #31396webCustomerSorry to bring up this thread.
I would like to know how you can remove that renderCallback, after you dont need that function anymore?2020-08-12 at 7:06 am #31424Yuri KovelenovStaffHi,
renderCallbacks is a plain JS Array so you can use various methods to remove your callback from this array.
2020-08-12 at 7:41 am #31432webCustomerOkay, didnt know that. Thanks for the link.
-
AuthorPosts
- You must be logged in to reply to this topic.