ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator Need help to develop demo app with FPS rate
person icon
sagh0900
Registered User
Quote
2012-11-01 03:53:19

Hi,

I'm very interested in Copperlicht. To convince my professor to use this framework, I want to develop an application which I can code custom 3D model using copperlicht and should be able to add more objects. I should also able to print FPS to check the variations in FPS as I add more objects on canvas. I'm new to graphic programming, I neither have knowledge on shader programming nor openGL. Being a newbie, how can I start diving into this framework?

The following steps I wanted to implement (Suggest me if I go wrong):

1. Develop simple demo using copperlicht loading single cube or sphere or teapot on canvas.
2. Able to see the fps as I change the camera angles.
3. Later I should be able to add more triangles(Models) on the canvas either of same type (ex: Teapot) and able to compare the fps with single teapot one.

Am i approaching the right way or please suggestions needed. The provided tutorials neither of them having FPS demo. Please someone HELP ME. I really liked the features stated on homepage but I don't know how can I implement them in my demo.

person icon
niko
Moderator
Quote
2012-11-01 10:16:04

The best way to start is to work through all tutorials (you will find them in the documentation). By reading them, you'll learn most things you need to. The call to create an instance of the 3D engine is something like
CL3D.CopperLicht(elementIdOfCanvas, showInfoTexts, fps, showFPSCounter)

See the 4th parameter, just set it to true and it will print the current FPS.

person icon
sagh0900
Registered User
Quote
2012-11-01 17:09:59

thanks for your wonderful reply, I will try to do that. In the third lesson form tutorials, using custom nodes, I want to add more meshes so that I can compare the fps with single mesh. How can I do that?

person icon
sagh0900
Registered User
Quote
2012-11-01 17:47:25

wrote:
The best way to start is to work through all tutorials (you will find them in the documentation). By reading them, you'll learn most things you need to. The call to create an instance of the 3D engine is something like
CL3D.CopperLicht(elementIdOfCanvas, showInfoTexts, fps, showFPSCounter)

See the 4th parameter, just set it to true and it will print the current FPS.



I tried to do this:

var engine = new CL3D.CopperLicht(canvasID);

CL3D.CopperLicht(canvasID, true, null, true);

I set 2 and 4th parameter to true and 3rd one null for default 60 fps.

But I get this:
Error: Object doesn't support this property or method

Seriously speaking, I don't have any knowledge on this kind of programming. Only passion drove me here. I request your reply could be more detail. I'm also going through all the tutorials, no where mentioned how to print FPS.

person icon
niko
Moderator
Quote
2012-11-02 20:58:04

Your code looked exactly like this here?

var engine = new CL3D.CopperLicht(canvasID);
CL3D.CopperLicht(canvasID, true, null, true);


It should have been only something like this here:

var engine = new CL3D.CopperLicht('thenameofyourcanvas', true, 60, true);


person icon
sagh0900
Registered User
Quote
2012-11-04 14:21:44

wrote:
Your code looked exactly like this here?

var engine = new CL3D.CopperLicht(canvasID);
CL3D.CopperLicht(canvasID, true, null, true);


It should have been only something like this here:

var engine = new CL3D.CopperLicht('thenameofyourcanvas', true, 60, true);


Thanks for the answer. I think you are the only one in whole forum who is active.

person icon
sagh0900
Registered User
Quote
2012-11-04 18:07:59

wrote:
Your code looked exactly like this here?

var engine = new CL3D.CopperLicht(canvasID);
CL3D.CopperLicht(canvasID, true, null, true);


It should have been only something like this here:

var engine = new CL3D.CopperLicht('thenameofyourcanvas', true, 60, true);


@niko, Its working fine and seriously thanks for your valuable answer. But I do have one more question, actually, here we are restricting FPS to 60 max, but how could we obtain FPS in natural phenomenon? I mean, The copperlicht application maximum FPS is 60 fps? Can't we achieve more than that? Isn't there a way to achieve frame rate as it was without restricting to default as maximum?

For loading simple cubescenenode, (Cube 3D model), can't we achieve more framerate than 60FPS? Isn't it the higher the framerate, the better the application? I'm confused, could you clarify me please..

P.S: Sorry if I'm very dumb in questioning, I'm in the state of understanding each bits and pieces from lower level.

person icon
niko
Moderator
Quote
2012-11-05 21:51:58

If you specify '60' fps, then CopperLicht will try to do 60 fps, if possible. If the hardware it runs on is not capable of doing so, it will simply do it as fast as possible.
You can also specify 100 fps. Or 1000. Whatever you want. Usually, even 30 fps is enough for most people, but 60 is a value where all people see movements as 'smooth'.

person icon
David
Guest
Quote
2013-02-14 15:42:36

Hello,

I am working on a test-scene and i want to measure the performance for different amount of objects. Now the FPS which can be set and displayed with

CL3D.CopperLicht(elementIdOfCanvas, showInfoTexts, fps, showFPSCounter, loadingScreenText)

doesn't match the amount of rendered frames which i actually see.
I understand that you can cut off the FPS with the fps-attribute. So when i choose "15", the framerate won't go higher than 15 frames per second.

I tried this for a scene with many objects. If i set the fps to "15", it will render the scene about 15 times per second. Also what i see on screen is not faster rendered than 15 times per second.
But if i use the same scene with a framerate set to "60", then the FPS on screen shows 60FPS but what i actually see on screen is that the scene will be rendered only a few times per second.

It seems to me that the FPS isn't really measuring the amounts of rendering-circles per second.
So how can i measure the real frames rendered per second?

Thanks in advance!

person icon
David
Guest
Quote
2013-02-15 14:42:42

Hello again,

ok i solved the problem by myself.
I have found out that you are using setInterval() for drawing the scene, which doesn't consider the performance of the system.
Maybe you should implement the rendering cycle with requestAnimationFrame() in one of your next releases.

person icon
niko
Moderator
Quote
2013-02-16 07:25:00

that's true, but it's intentional. People don't like websites taking down the performance of their system. But you are right, maybe it's an idea to offer a section option.

person icon
jquindlen
Registered User
Quote
2013-08-08 07:13:55

niko, I'm running CopperLicht as an engine for a game inside a C client locally, so I want all the performance I can squeeze from a user's machine as any desktop PC game would. So to me, the news that it's possible to squeeze better performance from switching the render cycle from setInterval() to requestAnimationFrame() greatly excites me. I second the feature request, as I think it is relevant for different use cases. Thanks!


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |