Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
Hello to all the OS3D community,
I am completely new to OS3D and I am a trying to make android AR tutorials for my students on different scolar subjects, to make learning more attractive. I have followed a video tutorial to use AR with OS3D and i succeeded to make a 3D object follows a trained image marker without problem and then export the apk to android device. All this works very well.
So now i'm trying to go a step further, but i am stuck by different problems for which I really don't find solutions so far, could you please help me about those :
1) CPU USAGE: I apologize for this probably dumb question, but first i have a concern about cpu usage. Since OS3D is loaded, the OS3D process make cpu load at 50% permanently, so quickly the fan goes to max and the pc heats a lot.
As my pc is quite old, i can understand it is highly sollicited for 3D rendering, but even when i open a new project where there is nothing in the scene (no 3D object, default_light desactivated) i don't understand why it needs all this cpu.
At first i believed that the toolbar button Play/Stop has purpose to start or stop 3D rendering, but then i have understood that 3D rendering is done in real time permanently. So I have look up in render settings, but didn't find an option to desactivate real time rendering or something to limit fps (it is at about 400 for now) or to lower render quality, because for my old pc i don't need so much quality to just make some test. I have unchecked all options in rendering settings window, but cpu still always at 50% (using directX or OpenGl).
So could you please explain me, what is the 3D motor rendering, although there is absolutely nothing in the scene, and is it possible to desactivate this real time rendering or lower its quality when i don't need it, for example when i am just working in the edit zone to try differents plugits.
2) ACCENTUED CHARACTER: I use OS3D in french language, and I have a problem with text (create in a custom interface for example) that use french accent that are not recognized when exporting to android app. When testing it on Windows 7 everything is fine, but when export to android apk, accentued character (é,à,ç etc.) are replaced by "?". I try on 2 differents android devices (tablet & phone) with same result, although there is no problem when using the project on windows.
Scol voyager is set to french, project setting is set to french, OS3D option is set to language french, and when export to android I put FR for country when asking to sign apk. Does i forgot an option somewhere about that or are the french accentued character not supported by android apk compiled by OS3D ?
3) TEXT SMOOTHNESS: I have also a big concern about the quality of text rendering that seems not to be really smooth. For example, creating a text in plugit "custom interface", i choose a classic font Arial and police size 10 to 20 to test. But the text (in 2D) i obtain gives something like "aliased", not smooth (irregular) when i compare with exactly the same text and size i see in an text editor like Word. Is there something to do, to make characters appears more smooth ?
4) PLUGIT ADDSOURCECODE: Last thing, could you please help me to use plugit "addsourcecode", for example to be able to call directly a method of some instance. I have look some examples, but didn't manage to make it work:
For example, i make an instance of the plugit "custom interface" named MyCustomInterface, and inside create a text named myText and give it some value ("hello" or anything else).
If now i want to change the value of this text with an instance of the plugit addsourcecode, using action "set Text" of the plugit "custom interface", to replace the text by another text contained in a global var named Myvar:
is there something like that ?
fun main(inst)
Scene.MyCustomInterface.myText.setText(Myvar);
0;;
Thanks a lot for any help you could provide me.
Last edited by ARappy (15-Aug-2019 18:15:41)
Offline
Hello, thanks for sharing your issues with us
1) Yes, OS3D is a bit CPU expensive, but any software involving 3D is. However, changing rendering settings will have little effect, as it mainly affects the GPU (unless you don't have a dedicated GPU in your computer, in which case OS3D rely on the integrated graphics). If you happen to have further CPU problems with more complex scene, know that the CPU usage of OS3D is highly dependent of the number of items there is in your scene.
Also, when the scene is stopped, some rendering options are disabled such as shadows and SSAO, so it is already a lower quality rendering.
Do you know what is the model of your CPU ? On the computer I'm currently using, I have a Intel Core i7 3770K (a 7 years old high-end CPU) and it is at about 33% load with little more than OS3D open.
We hope to improve CPU performance the day we will be able to switch to Ogre 2 or another 3D engine, but it won't be soon.
2) It is an issue we are aware of, and is due to the fact that the underlying font system is different on windows and the others platforms. Only windows supports special character for now, but we are currently working on bringing special characters to every platform.
3) No, there is nothing to improve that right now. We might take a look at that later, but it is not our priority
4) No, there is no way to do something like that. Is there a reason that you do not want to use a classic link ?
If you need to use a variable, you can use the "Var" plugIT to store your value, then retrieve it with the "GetValue" action, which will trigger the "Value" event containing the stored value that you can directly link to the CustomInterface.Text.setText action.
Alternatively, you can use a "global var" plugIT and retrieve it by writing %MyVarName% inside any link parameter. Just be careful when using several global var not to mix them up.
Offline
Hi Xeonadow,
Thank you very much for all those precisions. Things are very clear for point 2) & 3), but here is some precisions for point 1) & 4) I liked to ask (sorry for the length of all this):
1) HGH CPU USAGE:
I really apologize about this because my question is probably stupid, as i'm new to 3D. I understand what you say, but there must be still something i don't get about what is doing Ogre in OS3D.
Before to choose OS3D for its wonderful simplicity, i have tried some other 3D engine like Babylon.js or Unity. In none of them, my old cpu is overloaded permanently, especialy with empty scene at load.
When not playing the scene, they just show the scene with the 3D objects, and i can rotate the scene, zoom on it, but it don't needs such cpu usage, because i'm just "building" a scene, not "rendering" it (sorry for the imprecision of my vocabulary).
In Unity for example, when i was trying a little project (add mesh, doing little C# code ..) without "playing" the scene, the 3D previsualisation of the scene that is shown by unity don't make the cpu get high, it stays at a few percent, especially for a static scene (no animation to render, only static 3D mesh).
It's only when playing (render) the scene when you click on the play |> button that the cpu goes high as expected for an old pc. I probably didn't understand, but it doesn't seems there is a permanent render at high fps, as Ogre does in OS3D.
So if you don't "play" the scene, why Ogre has to render the scene continuously and at so much fps ? I don't know if "fps" has the same meaning here than in video game for example, but who needs 400 fps in a simple application ? I really goes at about 400 fps immediately since i launched OS3D, athough the scene is empty, i haven't done anything yet and the play button is on stop.
Do you know if maybe there is some ini file somewhere in Ogre folder to limit fps, at least during developping the project ?
4) PLUGIT ADDSOURCECODE:
I know how to use var and global var in the link parameter, but it is not sufficient for what i'm trying to do.
If i ask question about how to get any instance of the project programmatically, it is because you can't access all the properties (attributes) of one of the plugit by links. This is limited to the "action" & "event" they exposed in their links, and only a few of them exists.
For example, when using plugit "Custom Interface" to create a text or a button, you can change the value of a text, but not its color, or something else.
If I wish to change color during runtime (to make a text blink for example), or the font size, or the image used in a button etc, there is no "action" or "event" for it. All the things you can do easily when all instances of the scene can be accessed by code (as in Babylon with js or Unity with C#).
As there is also an underlying language under OS3D (Scol), why can't we use it to access directly any instance present in the scene, to be able to change dynamically any of its property ? Because of course we are not going to make a plugit for each properties we want to change.
To give you another example, at the moment i was stucked by the lack of a plugit to manage string variable (like substring, replace, left, right, find etc..).
I hoped to be able to do it with ADDSOURCECODE plugit, because there is all what i need in scol to do it (strfind, strlen, substr..). But I didn't understand how ADDSOURCECODE can exchange data with the scene, and now i think it can't.
So I have writen my own plugit to do string manipulation using those scol functions and it works, but it would be more simple to be able to do it from a scol interface like ADDSOURCECODE plugit.
I have looked in ADDSOURCECODE code and at line 57, the scol command that run the user script on a channel is:
_scriptc ch script;
Unfortunately scol function "_scriptc" doesn't return a value, so it is not possible to use ADDSOURCECODE plugit to return a value from the code you write inside, and get it back in the links of the plugit, to change something on runtime.
Do you know if it possible to use "execch" instead of "_scriptc" :
https://redmine.scolring.org/projects/s … xecch.html
that seems somehow equivalent to "_scriptc" but can return a value.
I have to try to replace it in the actual code of ADDSOURCECODE plugit and adapts its parameters that are differents, but I always get compilation error. It is something like :
execch ch script arg;
If execch could return me a value created by the user script written in ADDSOURCECODE (make a substring of a string for example), then i can easily return this value to an event link for the next plugit.
And if ADDSOURCECODE plugit could return a value, that could helps me a lot to use more scol functions and make things more dynamic.
Thank you anyway for your appreciated concern.
Last edited by ARappy (26-Aug-2019 20:17:09)
Offline
Well I prevent CPU burn for mobile platforms considering desktop computers to get the maximum performances.
But yes you're right it's never really needed to get 400FPS... some purist like to see a lots of FPS on the apps but for no reasons.
I've limited the FPS to 250FPS for all platforms in next release, so we will keep a good fluidity on edition and apps, and keep compatibility for 144hz screens and VR when the app allow it.
Well this should keep your CPU quiet
If you feel ready to code in Scol, you should consider to create your own plugIT from scratch.
You can start here: https://redmine.scolring.org/projects/s … ate_plugIT
and here: https://redmine.scolring.org/projects/o … dules.html
open other plugits code to get samples.
When it's done do not hesitate to send it to us, so we will review the code and possibly distribute it in next releases.
Offline
Hello arkeon,
Thanks for your answer.
In fact, I already have done a string plugit as it is essential to my project. It embeds different usual string functions (find a string in a bigger string, replace or do substring). It works well, but it is probably not nicely coded as i have just begun to learn scol. I can send it if you want to review it, and see if it can help. Can i send it in pm as there is probably some improvement and bugs correction to do, before expose it, as it is for the moment.
Also would you have some clue to the use of execch scol function in addsourcecode plugit ? Is it possible to used it instead of _scriptc, if they are somehow equivalent as i believe ?
Thank you
Offline
Pages: 1