Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
How Could I access the FPS to LOG in external file?

sagh0900
Registered User
Quote
2012-11-13 17:34:07


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


I want to LOG the fps to external file generated by the code. How could I do that? I mean accessing the fps somehow which is printing on browser, please help me


sagh0900
Registered User
Quote
2012-11-13 17:41:39

Also, I need help for:


var newMaterialType = engine.getRenderer().createMaterialType(vshaderScript.text, fshaderScript.text);
boxscenenode.getMaterial(0).Type = newMaterialType;



I don't want custom shader to render my texture, in fact I don't need any Texture, instead I should be able to pass some color to view the object. I need both these help. I couldn't find any example resource for the two problems.

@niko, I hope you could solve me problem for these two.


sagh0900
Registered User
Quote
2012-11-13 19:02:48

What I really meant is:

Now I'm having output like this with Texture:

🔎︎


But I want like this:

🔎︎


also I need FPS to be accessed somehow for storing in database or file. Could you please help with that.


niko
Moderator
Quote
2012-11-14 07:32:17

For the color part, as fragment shader, use something like this:

ifdef GL_ES
precision highp float;
endif
uniform sampler2D texture1;
uniform sampler2D texture2;

varying vec2 v_texCoord1;
varying vec2 v_texCoord2;

void main()
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}

Like in this tutorial: http://www.ambiera.com/copperlic...

For logging the fps: Maybe you could just constantly get the content of the DOM element with the FPS text and save it?


sagh0900
Registered User
Quote
2012-11-14 14:55:42

wrote:
For the color part, as fragment shader, use something like this:

ifdef GL_ES
precision highp float;
endif
uniform sampler2D texture1;
uniform sampler2D texture2;

varying vec2 v_texCoord1;
varying vec2 v_texCoord2;

void main()
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}

Like in this tutorial: http://www.ambiera.com/copperlic...

For logging the fps: Maybe you could just constantly get the content of the DOM element with the FPS text and save it?


Thanks for the reply, yea at least I want to be able to access "FPS" dom element which is printing the FPS. How can I do that?

Don't the copperlicht have in-built material function to code the colors? I mean is that mandatory to use the explicit shader program?


niko
Moderator
Quote
2012-11-15 06:40:04

Yes, you could also alternatively change the colors in all vertices of the mesh. Then you don't need any shader.
I think you might get the fps dom element using
CL3D.gCCDebugOutput.FPSRootText



sagh0900
Registered User
Quote
2012-11-15 14:11:09

wrote:
Yes, you could also alternatively change the colors in all vertices of the mesh. Then you don't need any shader.
I think you might get the fps dom element using
CL3D.gCCDebugOutput.FPSRootText



Please provide me code snippet for color coding, I need all the cubes to be green in color, for that how can i set the color without taking help of shader program.

and

CL3D.gCCDebugOutput.FPSRootText
is returning "object text" as an output. I even tried to convert it to number by typecasting, it is returning NaN. Please, I want bit quick reply on these two since my time constraint demanding so. I hope you understand


niko
Moderator
Quote
2012-11-16 08:25:53

It's a DOM element. You get its value using CL3D.gCCDebugOutput.FPSRootText.nodevalue.


sagh0900
Registered User
Quote
2012-11-16 15:44:33

wrote:
It's a DOM element. You get its value using CL3D.gCCDebugOutput.FPSRootText.nodevalue.



Thanks, I'm able to access.
But for coloring cubes, without custom shader program, how could I do that? sample snippet please. i'm using CubeSceneNode.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

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


   






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