1,351

(5 replies, posted in Engine)

"addBehavior" is indispensable to add a behavior to the engine.

The first argument is the name of the behavior (as it will appear in maratis interface).
The second argument is a filter, for example, if your behavior should be only applying to a Camera, you should set "M_OBJECT3D_CAMERA". "M_OBJECT3D" means it's available for all 3d objects.
The third argument is a pointer to a function returning a new behavior.

1,352

(5 replies, posted in Tutorials/Examples)

nice,

about your texture filename problem (you rename it manually in the mesh file),
copy your texture into your "maratisProject/maps" folder before you link it to your material in blender,
then directly export the mesh in the "maratisProject/meshs" folder, so the filename will be automatically local.

1,353

(9 replies, posted in General)

Hi,

yes, all the working data is xml to able manual correction an team working
(text files can be merged using svn when multiple people are working in the same project).

Xml to binary as a publishing process is planned, but not finished yet (only font text is done), as you imagine, it's not easy to build a huge tool like that without budget. We are searching for contributors, do you know c++ programming by any chance ? You can help us adding this feature.

1,354

(5 replies, posted in Engine)

I'll try to send you that,
tell me by mail why you are not able to use visual anymore ?

1,355

(5 replies, posted in Tutorials/Examples)

Hello Raven67854, that's wonderful you started creating this tutorials !
I should maybe create a new forum section called "Tutorials/Examples" and
add a link to your videos in Maratis website : http://www.maratis3d.org/?page_id=53

When you have more videos you can also to post it to Blendernation I think.

Thanks !!

1,356

(59 replies, posted in General)

For Maratis shaders, uniform sampler2D Texture[8]; correspond to the texture slots of the Material.

but where must we put the textures ? in blender texture slots ? if it's right, the blend texture is on the first slot and the others the followers ?

For example, but you can do it in the order you want.

if I import the CustomShader in a .txt in blender, is that work ?

A shader written for Maratis will not be previewed in Blender, it can be adapted but Blender don't use the exact same technique.

and it is possible to make the same trick with normal/specular map ?

You can. For example uses the slots like that :

0:normalMap
1:specularMap
2:blendMap
3:blendA
4:blendB
5:blendC
6:blendD

In your shader you will get the texture data like that :

vec4 normalMap = texture2D(Texture[0], texCoord[0]);
vec4 specularMap = texture2D(Texture[1], texCoord[1]);
vec4 blendMap = texture2D(Texture[2], texCoord[2]);
etc

1,357

(3 replies, posted in Scripting)

Maratis uses Lua 5.1.4. I started working on Maratis long time ago, but I'm using Lua only since a couple of years.

It's also possible to extend the Maratis lua functions in c++ from a game plugin,
or by extending this code (where Maratis lua functions are declared) : http://code.google.com/p/maratis/source … Script.cpp

1,358

(3 replies, posted in Scripting)

Hi !

It's good to hear you are interested in using Maratis, I'm a huge fan of point and clic adventure games,
it's in fact because of Monkey Island, Day of the Tentacle and Broken Sword that I wanted to make video-games.

About your questions, some advanced functionalities can be used with the c++ SDK. I hope we can add new lua functions soon but for now the lua implementation only feature basic mouse (clic, mouse position...).

- For implementing cursor and game interface I made a tutorial here : http://www.maratis3d.org/?p=563
- About mouse interaction on triggers you can send a ray from the camera to the mouse position and see if it interact with an invisible mesh (trigger). There is a ray-tracing function doing that in the c++ SDK, I can also give you some code.
Same for the character moving, the ray intersection can give you the 3d point where the character needs to go.

I hope to see your work soon,

Anaël.

1,359

(59 replies, posted in General)

When writing a custom shader, you can use up to 8 textures in total.
For example, you can write a shader using 4 terrain textures + 1 blending texture,
while using each component (R, G, B, A) of the blending texture to blend each terrain texture.

But it's highly possible that a game like guild war is splitting the geometry according to texture use for performance,
mixing A+B in one area, A+C in another etc...

1,360

(47 replies, posted in Engine)

http://www.maratis3d.org/wp-content/uploads/2011/06/iphoneShadows.jpg

I just added OpenGLES2 and a simplified Standard renderer smile
Shaders and dynamic shadows are now working on iOS !

But of course pixel shaders and dynamic shadows are slow, specially for the iPad (because of the fillrate).
There is still some optimization to do, but if you want to use the StandardRenderer and not the FixedRenderer, the best is to write custom shaders with a special care to optimization depending on the object (use simple vertex lightning for characters and small objects, reduce the lights number and the texture passes, etc).

For your shaders to run both on desktop and embedded system, add this on top :

#ifdef GL_ES
precision highp float;
#endif

Cheers !

1,361

(47 replies, posted in Engine)

good to know for the text,

about getTouchPosition etc, it's normally on, as a function call in lua,
or using MInputContext in cpp. You can see where the lua function is declared inside "trunk/dev/Maratis/Common/MScript/MScript.cpp".

and about the StandardRenderer, it's not incompatible, but we didn't had time to include and test the openglES2 context inside the xcode project. In dev/Additional/OpenGLES/MContexts are the GLES1 and GLES2 contexts (only GLES1 is included for now).

If you want you can try to include the GLES2 context, it still untested so your feedback will be a great help to improve the iphone port.

1,362

(47 replies, posted in Engine)

Thanks smile

I saw that the .font loader is not added in the iphone project, i'll update svn when i have some time,

EAGLView.mm is missing 2 lines of code :

"#include <MLoaders/MBinFontLoader.h>" (it's commented)
and "engine->getFontLoader()->addLoader(M_loadBinFont);" (to be added in initRenderingContext after "mesh loader")


The files MBinFontLoader.h and MBinFontLoader.cpp maybe also need to be added to the xcode project.

1,363

(47 replies, posted in Engine)

A look through the code led me to think "ACCEL_X", "ACCEL_Y", and "ACCEL_Z"

yes, there is also new lua functions for multitouch : "getTouchPosition(id)", "getLastTouchPosition(id)", "getTouchPhase(id)"

getTouchPhase return 0 to 4 :

0 : Begin
1 : Update
2 : End
3 : Cancelled
4 : None

About text, we have not been able to link freetype to ios yet, but the maratis binary font loader is working,
when loading a font (ttf) using Maratis editor you'll see that a ".font" file is generated, use this file to replace the ".ttf" file.

This will be automated in the future.

1,364

(64 replies, posted in General)

sad that's too bad, I hope some linux fan we'll be interested to have a look,
I didn't find time yet, too much things to do...

Hop to see you later.

1,365

(1 replies, posted in Tutorials/Examples)

cool ! smile

that's a good example, it's a good trick to use texture offset for animated water,
rivers, or water fall.

1,366

(5 replies, posted in Engine)

yes, I think particles will be the next step,
I already have some code.

1,367

(5 replies, posted in Engine)

News from the 28 May 2011 :

- IPhone publishing, multitouch/accelerometer support, OpenGLES1 (OpenGLES2 started) : Thanks to Skumancer
- Fixed renderer and standard renderer optim
- Automatic occlusion culling (Standard renderer only)
- General bug fixes and improvements

Current sources can be found here (svn) :
http://code.google.com/p/maratis/source/checkout

We are still searching a Linux contributor to port the MWindow class to Linux,
and others to add features like new script functions and behaviors, Collada mesh loader, etc.

Thank you !

Anaël.

1,368

(1 replies, posted in Engine)

If you are using the downloaded Windows version of Maratis, you will need Microsoft Visual Studio to build a game plugin (dll), there is a free version of it : http://forum.maratis3d.com/viewtopic.php?id=90

> The game plugin examples for Maratis are including a visual project file, so you can open the project and compile without anything complex to do.


I know you can also call the Visual Studio compiler from Code::Block, but I never tried it.

Do you only want to use the Maratis Engine ? Do you know you can create plugins to add additional c++ code while using the editor ?

There is a tutorial explaining how to create a plugin :
http://www.maratis3d.org/?p=500

1,369

(6 replies, posted in News)

Jack Andrew : You don't understand, you mean about making HUD in c++ ?
There is a tutorial here : http://www.maratis3d.org/?p=563

1,370

(59 replies, posted in General)

You can use a "CustomShader" Material, and write your own glsl shader,
to blend multiple textures in glsl, using 2 or 3 textures as sources, and one texture used as blending texture.

Here is a very basic fragment shader blending 2 textures :


uniform sampler2D Texture[8];
varying vec2 texCoord[3];

void main(void)
{
    vec4 texture0 = texture2D(Texture[0], texCoord[0]); // first textures               
    vec4 texture1 = texture2D(Texture[1], texCoord[1]); // second texture
    vec4 texture2 = texture2D(Texture[2], texCoord[2]); // blend texture

    float interp = texture2.x; // use the red component
    float invInterp = 1.0 - interp;

    gl_FragColor = texture0*invInterp + texture1*interp;
}

1,371

(47 replies, posted in Engine)

skumancer added multi-touch and accelerometer support to the iPhone publishing example and to MSDK,
updates on svn : http://code.google.com/p/maratis/source/checkout

Thank you a lot smile

1,372

(4 replies, posted in General)

the compilator is not finding MCore.lib,

I see you are using :
c:\Users\Rodolfo\Desktop\Maratis-3.02b-win32\Examples\SimpleGamePlugin\SimpleGamePlugin\

There is 2 times the repertory "SimpleGamePlugin"
try to use : c:\Users\Rodolfo\Desktop\Maratis-3.02b-win32\Examples\SimpleGamePlugin\

Or if you want to use a different repertory, just modify the additional path in the project settings.

1,373

(49 replies, posted in General)

it's actually not featuring this,
but it will planned in the future, I hope to find contributors help for this.

1,374

(4 replies, posted in General)

Hi,
first don't put MEngine.h or anything in the folder.

Your problem is that the visual project is not finding the paths.
If you want it to work without changing the paths, just unzip SimpleGamePlugin in "Maratis install path"/Examples/
it should work by default.

If you want to use a different folder, open the visual project settings, and change the additional include paths
and the additional library path to link to "Maratis install path"/SDK/MCore/Includes, "Maratis install path"/SDK/MEngine/Includes etc

1,375

(8 replies, posted in General)

Ok, si j'ai bien compris le code devrait fonctionner pour ce que tu veux faire,
commence par importer ton objet dans la scene et place une camera orientée vers Y,
l'idée est de déplacer l'objet et pas la camera (plus simple).

Ensuite utilise ce script, modifie-le si besoin,
il permet de faire tourner l'objet sur l'axe Z lorsque la souris bouge et que le bouton droit est enfoncé.
L'objet est déplacé (similaire au pan) lorsque la souris bouge et que le bouton gauche est enfoncé :

-- get objects
Object = getObject("Object")

dx = 0.0
dy = 0.0

centerCursor()
mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y")

-- scene update
function onSceneUpdate()

    if isKeyPressed(MOUSE_BUTTON3) then
        rotate(Object, {0, 0, -1}, dx*100)
    elseif isKeyPressed(MOUSE_BUTTON1) then
        translate(Object, {dx*100, 0, -dy*100})
    end
   
    -- get mouse direction
    dx = getAxis("MOUSE_X") - mx
    dy = getAxis("MOUSE_Y") - my

    -- center cursor
    centerCursor()
   
    mx = getAxis("MOUSE_X")
    my = getAxis("MOUSE_Y")   
   
end