Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • frankiezafe 21:10 on 2017-02-22 Permalink | Reply
    Tags: , , ,   

    Several hours of work later, the class PMaterial is fully integrated to PNode. This part has been tricky: materials and textures are shared objects, managed by managers below the objects.

    The approach is to create PMaterial on demand, when you call pnode.getMaterial, for instance. Once created, it stays in the pnode until you destroy it or overwrite the material with another.

    This limits the memory consumption and force the coder to always retrieve the material pointer from the pnode, and not to store it.

    Another cool feature of the pnode.getMaterial is that the material can be created RT if the mesh doesn’t specify one.

    On the PMaterial level, it is becoming very easy to add the methods to access the different layers of the Ogre material.

    For instance, here is the code used to create the 2 materials applied on the balls in the image above:

    pmat_even.create( "Test", "Nice material" );
    pmat_even.diffuse( 1, 0, 0 );
    // activation of fog
    pmat_even.fogMode( Ogre::FOG_EXP );
    pmat_even.fogDensity( 0.1 );
    pmat_even.fogDistance( 10, 15 );
    pmat_even.fogColor( 0.4, 0.4, 0.4 ); // same as background
    // cloning pmat_even in pmat_odd
    pmat_odd.clone( &pmat_even );
    pmat_odd.fogColor( 0.8, 0.8, 0.8 );
    pmat_odd.shading( Ogre::SO_FLAT );
    // adding a pass on the material
    pmat_odd.addPass();
    // there are now 2 passes in technique 0 of this material
    uint tid = 0;
    uint pid = 1;
    pmat_odd.emissive( 1,0,1, tid,pid );
    pmat_odd.shading( Ogre::SO_FLAT, tid,pid );
    pmat_odd.polygon( Ogre::PM_WIREFRAME, tid,pid );
    

    It’s super easy to clone a material, at creation or via the clone method. The second pass of the odd material have to be set manually. Passes are not cloneable (yet?).

    As you may notice, mentioning the technique or pass to attack is optional. If your material has only one technique and one pass, the call is very short. Once you beginning to build a more complex material, adding 2 uint at the end of your arguments should not be too difficult…

    The material of the cube is also created manually:

    PMaterial pmat2( pmat_even );
    // disabling the fog
    pmat2.fogMode( Ogre::FOG_NONE );
    pmat2.diffuse( 1, 1, 1 );
    // checking the number of textures
    if ( pmat2.getTextureUnitCount( ) == 0 ) {
    	// adding one 
    	pmat2.addTexture( "General", "child-computer.jpg" );
    } else {
    	// modifying the first one
    	pmat2.setTexture( "General", "child-computer.jpg" );
    }
    cube.material( &pmat2, true );
    

    More, soon!

     
  • frankiezafe 13:38 on 2017-02-17 Permalink | Reply
    Tags: , , ,   

    new class in package: PMaterial.

    This class is an helper that simplify the access to the multiple layers of Ogre’s materials.
    There are 3 levels in a material:

    • technique
    • pass
    • texture units

    The usual Ogre way to access to modify a pass diffuse is looking like this:

    Ogre::MaterialPtr ptr =  Ogre::MaterialManager::getSingleton( ).load( "mat", "group" );
    ptr.getTechnique(0)->getPass(0)->setDiffuse( 1,0,0 );
    

    Using PMaterial, it looks like this:

    polymorph::PMaterial ptr;
    ptr.load( "mat", "group" );
    ptr.diffuse( 1,0,0 );
    

    Selection of technique and pass is optional. The image above shows the fog configuration:

    pmat.fogMode( Ogre::FOG_EXP );
    pmat.fogDensity( 0.1 );
    pmat.fogDistance( 10, 30 );
    pmat.fogColor( 0.4, 0.4, 0.4 );
    

    All methods are not yet there, do not worry, they will come soon.

     
  • frankiezafe 19:57 on 2017-02-12 Permalink | Reply
    Tags: , festival, report   

    Screenshake, quick and dirty report 

    Just coming back from screenshake festival in antwerpen (be). I only spent a few hours there, here is several interesting projects presented.

    Catacombs of Solaris

    itch.io

    Triennale Game Collection

    More especially 2 games:

    steam

    Lieve Oma

    itch.io

    Everything

    everything-game.com

    Guys i’ve met

    A nice afternoon 🙂

     
  • frankiezafe 22:39 on 2017-02-10 Permalink | Reply
    Tags: , , , , ,   

    I’ve learned something really important today: an OpenGL context can be accessed by one and ONLY one thread! See Under what circumstances would glGenBuffers/glGenBuffersARB fail?.

    And this is the first time I feel annoyed by the singleton approach of Ogre3D. In my asset converter util, I use Ogre object, the MeshManager mainly, to convert xml files to .mesh files. Due to the limitation of OpenGL and the singleton pattern, I can’t declare a new OpenGL context in my conversion thread by using the Ogre managers…

    I struggled for several hours with that before find the post on stackoverflow.

    This implies a freeze during mesh conversion, wich prevent me to animate a progress bar and keeping the conversion strickly in background.

    I’ll work on the loading and display of the processed meshes next week.

     
  • frankiezafe 18:46 on 2017-02-08 Permalink | Reply
    Tags: , , ,   

    I’m currently working on a more user friendly mesh, skeleton & materials converter.

    For the little story, when you export a model from blender, the blender addon outputs xml files. These files have to be parsed by the OgreXMLConverter to produce the final files. *.mesh & *.skeleton files are binaries.

    It’s a tedious process, especially when you want to organise your files in the folder structure of the application.

    The polymorph xml converter wlll make this a bit more handy (when ready):

    • hotfolder: define the folder where the blender exports lands after export;
    • output models: define the folder where the .mesh files will be exported after conversion;
    • output skeleton: define the folder where the .skeleton files will be exported after conversion;
    • output material: define the folder where the .material files will be moved;
    • output textures: define the folder where images will be moved;

    These paths will be saved in a preference file next to the application, to avoid having to reset them each time you open the application.

    A demo will come once it will starts to work. For the moment, only the GTK filechooser is plugged in.

     
  • frankiezafe 18:25 on 2017-02-01 Permalink | Reply
    Tags: , , tech demo,   

    Technical demo.

    Based on the patches started yesterday evening, the example.pd shows how PD can be used with its user interface to interact RT with the engine. Once the work is done, by commenting a #define in the main class, you switch to release mode, without changing anything to the patch!

    Parts of the video:

    1. edition: puredata used with ogre3d
    2. release: libpd loads the pd patch inside of ogre3d

    As explained in this post, the edition is based on an OSC communication between the two apps, it works with the basic puredata.

    There is 2 VERY important objects in this patch:

    • pobject_in: it can parse osc messages as well as internal messages (when used in release mode); it also create 4 internal senders pobject_in_trans, pobject_in_rot, pobject_in_scale & pobject_in_all; no need to be plugged to the pobject_in box, you can receive the messages anywhere in your patches;
    • pobject_out: it can pack osc messages for the engine as well as internal messages (when used in release mode); it also create 4 internal receivers pobject_out_trans, pobject_out_rot, pobject_out_scale & pobject_out_all; no need to be plugged to the pobject_out box, you can send messages from anywhere in your patches;

    On the C++ side, the PdEngine has to be set in edition or release mode to works properly with pd. The communication with pd happens through the same methods. The idea here is to make the two modes transparent to the user, even if the c++ guy has to know what he’s doing :).

    Keep in mind it’s a demo and there is a lot of optimisation to do on the C++ level, but it gives a good idea of the integration of the 2 libraries.

    And, yeah, i’ll have to check how to record the sound with ffmpeg on linux…

     
  • frankiezafe 23:05 on 2017-01-31 Permalink | Reply
    Tags: , , ,   

    3D – puredata communication

    Starting to work on the first external to enable an easy integration of puredata in the polymorph engine.

    The idea is simple: you place a pobject_in object in your patch to receive position (translation), rotation and scale of the 3D objects.

    In edit mode, meaning you have pd with ui and the game running aside, info will go through OSC, allowing a RT modification of the patch.

    In release mode, the patch will be loaded by the application thanks to libpd.

    The pobject_in will work seamlessly in the 2 modes: in edition, you just add an udpreceive object and link it to pobject_in. Once edition is done, if you want to be clean, you just remove the udpreceive. In release, the info will come through a special receive object, polymorph_pobject_in_RT, already included in the pobject_in.

    LibPD being integrated since several month it shouldn’t be too hard to adapt the required methods on the C++ side. I’ll work on this tomorrow, I hope to have a cool demo for sunday!

     
  • frankiezafe 15:45 on 2017-01-30 Permalink | Reply
    Tags: , , , ,   

    Polymorph @FOSDEM

    Hello to all,

    I’m (very) glad to remind you that Polymorph and its engine will be presented at FOSDEM this year, in the devroom “Open Game Development“.

    The presentation is focused on the engine, why we did it and how we propose to conceive interactive 3D and video games.

    I hope to see you there, even if all presentations are streamed 🙂

    Best regards,

    François Zajéga

    Practical info:

    • date: Sunday 5th of February 2017
    • hour: 15h30 – 15h55
    • location: ULB, Campus du Solbosch, Av. F. D. Roosevelt 50, 1050 Bruxelles, room AW1.126

    For complete practical information: https://fosdem.org/2017/practical/transportation/

     
  • frankiezafe 19:56 on 2017-01-29 Permalink | Reply
    Tags: Camera, , matrix, ,   

    New example showing how to go from world space to camera space.

    A bit of explanation.

    The black sphere is attached to the pink camera. Therefore, it is located in the camera space, meaning that its position, rotation and scale depends on the camera ones. By default, the sphere is static in the point of view of pink camera.

    The pink camera is rotating around the world center.

    An empty, represented as a XYZ axis, follows the mouse position.
    If the space bar is hit, position & orientation of the empty is converted into camera coordinates.

    Vector3 p = custom_cam.worldToCam( empty.getTrans( ) );
    Quaternion q = custom_cam.worldToCam( empty.getOrientation( ) );
    

    The values are then applied on the sphere:

    ball_cam.move( p );
    ball_cam.orientation( q );
    

    By doing so, the ball is placed at the exact same location and orientation as the empty, relatively to the pink camera.

    note: the 256×256 square at the top left of the images is made with overlay manager, not yet simplified in polymorph namespace.

    The example is available in samples/0.1/example.cam_space

     
  • frankiezafe 22:03 on 2017-01-22 Permalink | Reply
    Tags: , , , , RTT   

    Currently working on PCamera class (a class to manage … camera!). The new samples/0.1/example.cam shows how to create one and render it onto a texture.

    In these images, the pink texture on the cube is the rendering of the camera rotating in the center of the scene, the tall pink cone. It is very ogry to send the camera to the texture:


    RenderTexture * rt = texture->getBuffer( )->getRenderTarget( );
    custom_wp = compositorMgr->addWorkspace( sceneMgr, rt, custom_cam.getOgreCam( ), cwName, true );
    custom_mat->getTechnique( 0 )->getPass( 0 )->createTextureUnitState( )->setTexture( texture );

    There should be a way to make this a bit more handy, I’ll look into it sooner.

     
  • frankiezafe 13:08 on 2017-01-17 Permalink | Reply
    Tags: , , , , , ,   

    screenshot01172017_125756932

    New example ready for skeletons manipulation.

    In the example, the skeleton debugging is enabled by default. It shows the bones hierarchy and the local orientation of each bone.

    There is 3 transformation spaces for bones, inherited from Ogre3D:

    • LOCAL
    • PARENT
    • WORLD

    All methods to get or set orientation, scale and position are sensitive to this value, except the moveBone methods, not yet finished.

    The example shows also the different ways to retrieve information about the skeleton: list of bone’s name, list of bone objects, access via name, id or pointer, etc.

    The beautiful model i destroy if from Sophie Khan and distributed by #additivism.

     
  • eurydice 11:23 on 2017-01-17 Permalink | Reply
    Tags: , ,   

    AMazingGameSS0

    AMazingGameSS1

    First little game without pretention done while learning Openframeworks and C++ during my traineeship !

     
  • frankiezafe 23:59 on 2017-01-13 Permalink | Reply
    Tags: , , , , visualisation   

    screenshot01132017_235526088

    screenshot01132017_235531770

    screenshot01132017_235541017

    Working on a debugging view for skeletons, a good way to learn how #ogre3d is storing skeletal data. There’s a scaling issue: the points in the face are not correctly placed, they should be at the lips borders, at the basis of the nose and closer to the eyebrows.

    The visualisation is not the same as in blender: bones are linked to their parent head, not tail. It’s simply because the information about the size of the bone is not available in ogre. The only information available for a bone are its position and orientation.

    A fix will come soon!

     
  • frankiezafe 17:33 on 2017-01-12 Permalink | Reply
    Tags: , , , , ,   

    screenshot01122017_171204940

    Preparation of a 3d model for skeleton example. The model is from Sophie Kahn and distributed by #additivism (their selection is really good!).

    Image of the model in the 3d additivism cookbook:

    rhino

    First step was to reduce (a lot) the number of faces of the model ( around 75% ), generate a UV map and link it to an armature, in blender, obviously. Note that the armature is displayed using Envelope. I never use it to work, but i find it lovely for screenshots.

    rhino-screenshot-002

    rhino-screenshot-001

    The skinning was tricky, due to the mesh mess. There are no arms for instance.

    After the export and conversion via OgreXMLconverter, the model has been easily imported in the engine.

    A lot of fine-tuning has been done on the material, to display solid and wireframe + having a light emission of the wireframe pass in the shadows.

    Here is the material definition:

    pass sophiekhan-mat
    {
    	ambient 0.8 0.8 0.8 1.0
    	diffuse 0.8 0.8 0.8 1.0
    	specular 0.02 0.05 0.05 1.0 0.1
    	emissive 0.0 0.0 0.0 1.0
    
    	alpha_to_coverage off
    	colour_write on
    	cull_hardware clockwise
    	depth_check on
    	depth_func less_equal
    	depth_write on
    	illumination_stage 
    	light_clip_planes off
    	light_scissor off
    	lighting on
    	normalise_normals off
    	polygon_mode solid
    	scene_blend one zero
    	scene_blend_op add
    	shading gouraud
    	transparent_sorting on
    
    }
    pass sophiekhan-wf
    {
    	ambient 0.0 0.0 0.0 1.0
    	diffuse 0.85 0.7 0.75 1.0
    	specular 0.5 0.5 0.5 1.0 30.2
    	emissive 0.31 0.26 0.2 1.0
    	polygon_mode wireframe
    	transparent_sorting on
    }
    

    Other screenshots:

    screenshot01122017_171414743

    screenshot01122017_171208673

     
  • frankiezafe 19:24 on 2017-01-11 Permalink | Reply
    Tags: , , glitch, , , , ,   

    screenshot01112017_142211314

    screenshot01112017_142217797

    screenshot01112017_142624367

    screenshot01112017_150924058

    screenshot01112017_150940710

    screenshot01112017_150945944

    screenshot01112017_155054726

    screenshot01112017_155102542

    screenshot01112017_160911261

    screenshot01112017_160926611

    screenshot01112017_161703380

    screenshot01112017_161732695

    screenshot01112017_161750328

    screenshot01112017_161757179

    screenshot01112017_161810645

    screenshot01112017_170923978

    screenshot01112017_171052215

    screenshot01112017_171406017

    screenshot01112017_172418511

    screenshot01112017_185234271

    Cool day today: the creation of the example.glitch was quite fun.
    The example demonstrate a bit more extensively the usage of the ogre’s compositor (see here) and the interaction with shaders.

    If you test the example, ckeck CustomApp::createCompositor: you’ll find comments about how to interact with the shader’suniform.

    The superb model in this scene is gearthing4 by shivinteger, distributed by #additivism.

     
    • xuv 00:57 on 2017-01-12 Permalink | Reply

      Wow. Looks awesome. Indeed, add some sound and it’s a finished piece. 🙂

  • frankiezafe 20:13 on 2017-01-10 Permalink | Reply
    Tags: , ,   

    screenshot01102017_200308117

    screenshot01102017_200310217

    screenshot01102017_200315718

    screenshot01102017_200318951

    screenshot01102017_200328133

    screenshot01102017_200347400

    New example about compositor and shader (example.compositor).

    The example concerns the definition of a custom compositor. In Ogre3d, a compositor is a serie of post-processing nodes attached to the camera. It is the place where the image displayed at each frame is created.

    In the example, there’s a shader attach to the background of the window that renders a blurred circle. The shader params can be modifed RT via the mouse.

    • Moving the mouse change the red and green channels of the center color.
    • Dragging with left button modify the radius of the circle.
    • Dragging with right button modify the center of the circle.
      • Compositor is a really strong feature of Ogre, even if it’s a quite difficult one!

     
  • xuv 17:35 on 2017-01-09 Permalink | Reply
    Tags: , installation, ,   

    Polymorph Engine on ArchLinux 

    Thanks to the great work and tutorial from @frankiezafe, I managed to compile and run the basic examples of Polymorph on an ArchLinux system. I had to make a few changes to the documentation and find the right flags for some libraries (instructions here). But everything seems to be running smoothly. More tests to come later, I guess.

    ArchLinux screenshot running Polymorph Engnie basic sample

    Save

     
  • frankiezafe 13:24 on 2017-01-09 Permalink | Reply
    Tags: , , repository   

    selection_748

    Big revision of the repository structure this morning.

    • assets: contains blender project & python scripts, ogre 2.0 materials, puredata & processing patches;
    • custom: Ogre classes overload or common configuration files, to deplou in SDK folder;
    • empty.0.1: an empty project to start with;
    • package: the polymorph engine, containing source code;
    • samples: a folder containing examples to be used as tutorials;
    • scripts: bash scripts to install polymorph and its examples.

    A lot of doc to be written!

     
  • frankiezafe 22:19 on 2017-01-06 Permalink | Reply
    Tags: , , ,   

    vlcsnap-2017-01-06-22h09m58s983

    vlcsnap-2017-01-06-22h10m17s864

    vlcsnap-2017-01-06-22h11m41s989

    First version of an installation script for linux is ready. It updates system libs, gather repositories, compiles and installs a big bunch of libraries and finally launch a basic example.

    Test machine specs:

    • xubuntu 16.04 64bits (running in a VM)
    • 4 core CPU
    • 2048MB of RAM
    • a weak internet connection

    Complete duration: 25m.

    Find the script and a manual procedure here: https://bitbucket.org/polymorphteam/pe.2.0/wiki/sdk-setup-linux-debian

    See the video log here: https://vimeo.com/198400034

     
  • frankiezafe 18:14 on 2017-01-04 Permalink | Reply
    Tags: , ,   

    install-party

    Planning an install party (next tuesday 10/01/2016 TO BE CONFIRMED) at the WTC with @xuv & @ptr_h to test the installation guide of the polymorph engine. If you want to be part of it, no probl’, everybody is welcome, just let me know!

    Note: the installation guide will be completed this week for linux. A guide for windows will follow.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel