Tagged: dev Toggle Comment Threads | Keyboard Shortcuts

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

    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 22:39 on 2017-02-10 Permalink | Reply
    Tags: , , dev, , ,   

    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 23:05 on 2017-01-31 Permalink | Reply
    Tags: dev, , ,   

    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 19:56 on 2017-01-29 Permalink | Reply
    Tags: Camera, dev, 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: dev, , , , 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 20:13 on 2017-01-10 Permalink | Reply
    Tags: dev, ,   

    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!

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

    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 12:54 on 2017-01-04 Permalink | Reply
    Tags: dev, , ,   

    012-new-project_734

    Updates the engine wiki done:

    • guide for project setup with cmake
    • guide for project import in netbeans

    I realise that the installation procedure is not complete yet, and it must be done before fosdem. It’s becoming urgent!

     
  • frankiezafe 23:42 on 2017-01-03 Permalink | Reply
    Tags: , dev, , ,   

    screenshot01032017_233404150

    Today, a lot of bug fixes on the basic classes of the polymorph packages.

    New: it is now possible to declare the resources folders in the XML! The common resources.cfg of Ogre can be replaced by a configuration.xml, placed in the same folder as the exec.

    The resources.cfg was looking like this:

    [Essential]
    Zip=../media/packs/PolymorphTrays.zip

    [General]
    FileSystem=../media
    FileSystem=../media/materials/scripts
    FileSystem=../media/materials/textures
    FileSystem=../media/models

    In the XML, it’s converted to this, with control over recursivity and read access.

        <resources>
            <group name=”Essential”>
                <resource path=”../media/packs/PolymorphTrays.zip” type=”Zip”/>
            </group>
            <group name=”General”>
                <resource path=”../media/models” type=”FileSystem” recursive=”1″ readonly=”0″/>
                <resource path=”../media/materials” type=”FileSystem” recursive=”1″ readonly=”0″/>
                <resource path=”../media/materials/textures” type=”FileSystem” recursive=”1″ readonly=”0″/>
            </group>
        </resources>

    The sreenshot comes from an evolution of the XML example, see Dynamic scenes loading

     
  • frankiezafe 22:27 on 2016-12-17 Permalink | Reply
    Tags: , dev, management,   

    I reopened today the #peel project, left aside 3/4 month ago. I was a bit worried about opening the IDE because a lot of things have changed.

    Indeed, during the development of Tuning Score, I didn’t do the same mistake as the oneS i did with peel.

    When I’ve started peel, my ideas about the polymorph package, and therefore the architecture of the whole project, were really vague. Due to the lack of global view, I have developped a lot of things in peel, such as a custom camera rig, a custom project format in xml and the classes to manage it, etc, etc.

    The approach was quite different for Tuning Score. From the start, the code specific to the game has been separated form the “core”. The core has given the polymorph package. It is full of virtual methods, and, excepts crucial stuff, the rest of the important methods and params are public or protected. For programmers, this means it can be easily overloaded.

    While I was starting the refactoring on peel, the benefits became crystal clear: I needed to replace the previous xml parser class by the one of polymorph. But for peel, i need a custom structure of data. By creating a custom class “PeelObjectManager” that extends “polymorph::PObjectManager” and “polymorph::PXmlParser”, the code to parse the custom xml tags has been done in 30 minutes 🙂

    I think it will take 30 to 40 hours to have peel on track again.

    Some screenshots will pop-up very soon, and several new features in the package:

    • sound spacialisation in pd
    • camera rig configuration via xml
    • objects parenting via xml
    • graph engine, usable for state engine, etc., with 2d overlay
    • there might be other things…
     
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