I found that after doing some research : http://www.opengl.org/sdk/tools/gDEBugger/
it can trace opengl calls apparently, to be tested ?
826 2012-10-19 19:46:47
Re: Performance Profiling (26 replies, posted in Engine)
827 2012-10-19 09:41:29
Re: Some tutorials (21 replies, posted in Tutorials/Examples)
The tutorial is very instructive, with the addition of sounds and how to publish a game you will cover the most important features and give a global view of what Maratis is. What else, maybe a basic GUI with some text would be also nice what do you think ? (using enableCameraLayer)
828 2012-10-19 09:25:47
Re: Performance Profiling (26 replies, posted in Engine)
Also, check some stuff that can make it slow like :
- power of two texture
- mipmap
- mesh export if you are using the 3dsmax exporter, be aware that it is still less optimized than the Blender exporter (vertices are duplicated)
I'm thinking about something that could slow your machine, in MGLContext.cpp look at "sendTextureImage"
your machine probably doesn't support "glGenerateMipmapEXT" :
you'll see a commented section using "gluBuild2DMipmaps" (what I was using before),
I suggest you try removing glGenerateMipmapEXT to see if it is faster, if it is we should use gluBuild2DMipmaps if opengl < 2.0
829 2012-10-19 07:23:32
Re: Speedometer on another scene (2 replies, posted in Scripting)
Hi,
Maratis can only run one script at a time, from the current scene, for you the "CarGame" scene I think.
Just access directly your gui text from the main scene :
GuiScene = getScene("GuiScene")
GuiText = getObject(GuiScene, "Text2")
and in the update :
setText(GuiText, string.format("%.1f", speed))
830 2012-10-19 07:15:55
Re: crashing scene based on sponza (27 replies, posted in General)
Hi, is it possible for you to send me the file that makes it crash ?
I'll try to debug it.
831 2012-10-18 20:17:01
Re: Performance Profiling (26 replies, posted in Engine)
Hi, good, I guess the GL Rendering context is a bit too brut force as it doesn't check if something is supported before enable it, there is some cleaning to do on this.
Im not sure to get the infinite update thing you said. I taught your laptop only support fixed renderer anyway ?
What fonction exactly runs slow ?
832 2012-10-18 20:10:35
Re: Some tutorials (21 replies, posted in Tutorials/Examples)
I will add something that I hope will close this non constructive talk.
Special_ops comes here to share something out of free kindness, I think very important to control langage but there is a line to draw between mistake and offense. Mistakes are mistakes, and can be corrected, there is no reason to be rude, it's not a way to say things, much important the thing is, and welcome people.
Now, lets continue on the original topic, and discuss this work, ideas, and mistakes if there is.
833 2012-10-18 15:32:14
Re: Some tutorials (21 replies, posted in Tutorials/Examples)
Hi, welcome,
that's great, it's very clear !
I'm waiting to see the following part.
Thank you
834 2012-10-18 12:14:29
Re: Headless mode? (1 replies, posted in General)
Hi,
it depend, if you don't need inputs or opengl you can skip MWindow init and just create a console application.
Otherwise there is probably an option to add in MWindow to have a background hidden window (depending on the platform)
835 2012-10-12 09:09:28
Re: Performance Profiling (26 replies, posted in Engine)
It's hard to profile the 3d card rendering in detail, because we don't know how the card execute the rendering exactly. OpenGL just send orders, and the sending itself is not always the bottleneck (exept when using very big dynamic meshs).
The 200ms missing can also be the system been late because of the slow rendering ? inputs waiting list etc.
836 2012-10-08 18:26:19
Re: terrain ? (59 replies, posted in General)
Hi,
I'll use 'P' in select mode, like you said.
Go to edit mode, in face mode, use the top-view, and the border select tool "B"
select the triangles you want to split, press 'P' > "selection"
You are not forced to split the mesh, but if your terrain is really big, it will be faster.
837 2012-10-08 10:44:28
Re: Performance Profiling (26 replies, posted in Engine)
Ho, you are on linux ok,
on my desktop computer I have a (only 3 years old) Nvidia good 3d card,
but it's not supported on the new linux, because nvidia refuse to update their drivers for the new xfree.
Technically I could have it accelerated by installing an old linux using an old xfree.
If glxgear works good for you, a non-textured cube should work fine in Maratis. If not, the cause could be a particular opengl instruction, even not used but activated : Alpha-blending, alpha-testing, mip-mapping... something like that maybe.
Did you check your mesa driver ?
838 2012-10-08 10:34:38
Re: terrain ? (59 replies, posted in General)
Hi,
- copy/paste the shaders in a text editor, and save two files in your project, par exemple :
- MyProject/shaders/terrain.vert (vertex shader)
- MyProject/shaders/terrain.frag (fragment shader)
- in Blender, select the "CustomShader" mode in the Material and link the two whader :
- use the texture slots according to what Alinor said
839 2012-10-07 19:34:54
Re: Performance Profiling (26 replies, posted in Engine)
mh, that's bad because you probably have ok directx drivers, they should provide at least a decent opengl 1.2 drivers...
840 2012-10-06 09:49:38
Re: Performance Profiling (26 replies, posted in Engine)
I tryed to put a printf on both the renderer and tested with various examples, it never seemed to run at the same time on maratis, but I didn't try on maratisPlayer. It seem hard to happen as there is only one renderer in MEngine.
The only thing that could explain it if it really happen would be the system switching the renderers all the time...
Check how much time MEngine::setRenderer is called, it should be called only one time per project loading.
841 2012-10-05 21:20:03
Re: Performance Profiling (26 replies, posted in Engine)
::deleteQuery is strange, because it is suposed to be called only in the destructor of MStandardRenderer.
It is used for occlusion query, and it make me think that it could be a component that can slow your computer,
as occlusion query is a recent feature not always supported.
Is Maratis also slow in your machine when you are using the FixedRenderer ? (for example Sponza fps demo)
FixedRenderer is not using shaders nor occlusion query.
842 2012-10-05 15:30:07
Re: Performance Profiling (26 replies, posted in Engine)
Hi, that's interesting, a very good idea.
One thing about recording the drawing time is that graphicLoop will only show you how much time sending the data is taking, to have also the rending time of the graphic card you have to include the swap buffer call.
Did you try with a bigger scene, the total time of the frame I believe is 8 ms which is vey short ?
getCurrentScene 14% can seem strange, but 2 us is nothing.
About your netbook, did you try testing another opengl engine or a demo ?
843 2012-10-04 09:41:14
Re: GamePlugin? (4 replies, posted in General)
Hi, be sure you compile in release mode and save the Game.dylib (don't forget the Maj of the name ) in your project directory, same place the .mproj file is.
Also, read this tutorial if you don't know it : http://www.maratis3d.org/?p=500
844 2012-09-29 16:05:06
Re: Shaders and Mouse Clicking (7 replies, posted in Scripting)
yes, we'll add it by default for next version.
If you want doing something with lua only, if your game is 2d you could use a ghost box and detect it's collision with objects.
For 3d it's a bit more complex, it's possible to use rayHit :
- link an object to the camera, it will act as a cursor (it will stick to the cam)
- move the cursor using the mouse position multiplied by a ratio
- you can find the ray using the cursor position and the camera position :
beginRay = cameraPosition
endRay = cameraPosition + (cursorPosition - cameraPosition)*factor
845 2012-09-29 08:37:42
Re: Shaders and Mouse Clicking (7 replies, posted in Scripting)
rayHit doesn't return the object but the intersection point,
to know if it hit an object, the object is passed in argument :
point = rayHit(start, end, object)
if point then
-- there is a hit with object
end
Mikey shared a additional script function (written in c++) :
http://forum.maratis3d.com/viewtopic.php?id=434
Here is the function code :
int pickObject(void)
{
MEngine * engine = MEngine::getInstance();
MScriptContext * script = engine->getScriptContext();
if (script->getArgsNumber() == 3)
{
MOCamera * camera = (MOCamera *)script->getPointer(0);
float x = script->getFloat(1);
float y = script->getFloat(2);
MPhysicsContext * physics = engine->getPhysicsContext();
unsigned int width, height;
engine->getSystemContext()->getScreenSize(&width, &height);
MVector3 rayO = camera->getTransformedPosition();
MVector3 rayD = camera->getUnProjectedPoint(MVector3(x * float(width), (1 - y) * float(height), 1));
rayD = rayO + ((rayD - rayO).getNormalized() * (camera->getClippingFar() - camera->getClippingNear()));
unsigned int objId;
if (physics->isRayHit(rayO, rayD, &objId))
{
MLevel * level = engine->getLevel();
MScene * scene = level->getCurrentScene();
unsigned int entCount = scene->getEntitiesNumber();
for (unsigned int i = 0; i < entCount; ++i)
{
MOEntity * entity = scene->getEntityByIndex(i);
MPhysicsProperties * phyProps = entity->getPhysicsProperties();
if (phyProps)
{
if (phyProps->getCollisionObjectId() == objId)
{
script->pushPointer(entity);
return 1;
}
}
}
}
}
return 0;
}
Used like that in lua :
obj = pickObject(Camera, x, y)
if obj then
...
end
This is the way to add the function through a game plugin (to do in StartPlugin) :
MEngine* engine = MEngine::getInstance();
MScriptContext* script = engine->getScriptContext();
if(script)
script->addFunction("pickObject", pickObject);
846 2012-09-29 08:28:23
Re: print() function? (1 replies, posted in Scripting)
Hi, the print function writes to the command line.
The command line window is normally visible on windows, but on mac and linux, to see it you have to open maratis from a terminal.
Then all the print will be visibile inside the terminal window.
847 2012-09-25 13:49:20
Re: Physics (5 replies, posted in Editor)
I think the y mouse needs to be inverted :
Your camera is not in ortho mode ?
MVector3 cameraPos = camera->getTransformedPosition();
MVector3 mousePos3d = camera->getUnProjectedPoint(MVector3(x*width, height - y*height, 1));
MVector3 vec = (mousePos3d - cameraPos).getNormalized();
MVector3 rayO = pos + vec*camera->getClippingNear();
MVector3 rayD = pos + vec*camera->getClippingFar();
848 2012-09-25 11:54:00
Re: Physics (5 replies, posted in Editor)
Is there a way to display physic bodies ?
> But we'll add that on the TODO list
849 2012-09-25 11:53:00
Re: Physics (5 replies, posted in Editor)
There is no physics display in editor,
but you can use the box.mesh, cylinder.mesh, cone.mesh and sphere.mesh of "Small Demos" example
to build a collision body, set it invisible and then attach an object to it.
The rotation/scale etc transform the bodies yes.
850 2012-09-25 10:05:11
Re: Hey, new user (1 replies, posted in General)
Hi, welcome !
Don't hesitate asking your questions in the forum, there is also some interesting topics that you might find useful,
as a start you will find some reading here (and on the wiki) : http://www.maratis3d.org/?page_id=53
And thank you for your offer, if you know game communities it's nice if you can spread the word and share translated tutorials !
See you around