Tagged: Ogre3D Toggle Comment Threads | Keyboard Shortcuts

  • frankiezafe 00:38 on 2017-10-19 Permalink | Reply
    Tags: , , Ogre3D,   

    Editing ogre materials:

     
  • frankiezafe 11:19 on 2017-09-27 Permalink | Reply
    Tags: , , Ogre3D, refactoring   

    Working an important refactoring of the classes for the next release of the engine (v0.2). The works will starts beginning of 2018.

    There is a complete description of the new classes here: https://bitbucket.org/polymorphteam/pe.2.0/wiki/pobject

     
  • frankiezafe 19:48 on 2017-09-24 Permalink | Reply
    Tags: , , , Ogre3D   

    PLine, a class to draw … lines! It might seems stupid, but drawing lines is no the default purpose of a game engine. Drawing a line that connect 2 objects for instance is painfull to do with a parallelepiped, especially when you need its thickness to stay constant!

    The class PLine is there to help. You define once the number of vertices it contains, and you can modify their position at each draw.

    PLine is using the marvellous Ogre’s ManualObject and is updated only when needed thanks to Ogre::RenderQueueListener. A drawback of this flexibility is the independence to the hierarchy: if the line is attached to another object, it is not influenced by its transformation…

    Note: see http://www.ogre3d.org/forums/viewtopic.php?f=2&p=538467#p538467

     
  • frankiezafe 20:35 on 2017-09-22 Permalink | Reply
    Tags: , , , Ogre3D, ,   

    1K spheres, 7 static boxes.

    It has been a hard day: the communication between Bullet and Ogre has been completely reviewed:

    • update of the physical world is now linked to the Ogre rendering cycle through Ogre::RenderQueueListener, meaning a more consistent frame cycle;
    • PObjects (any renderable object in the scene) are smart enough to update the correct engine, ogre when no physic, bullet when physic is enabled;
    • anti-explosion tests are refusing to parent 2 objects having physic enabled.

    The work is not finished yet, and a serious stress test should be done.

    See samples/0.1/example.bulletspring in the repository for the code of the example.

     
    • xuv 21:45 on 2017-09-22 Permalink | Reply

      After the popcorn test, the lottery test. Nice 🙂

  • frankiezafe 19:40 on 2017-06-17 Permalink | Reply
    Tags: , , Ogre3D,   

    Working on a two passes material, the shadow pass being potentially added automatically in the material by enabling shadows.

    Here is how it looks:

    material two_pass_shadows
    {
      receive_shadows on

      technique
      {
        
        shadow_caster_material shadowscaster
        
        pass standard
        {
          ambient 0.0 0.0 0.0 1.0
          diffuse 0.8 0.8 0.8 1.0
          specular 0.0 0.0 0.0 1.0 0.0
          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
          
          // SUPER IMPORTANT TO AVOID FLICKERING
          depth_bias 0 -1
          
          texture_unit
          {
            texture rock.jpg
            tex_address_mode wrap
            scale 1 1
            colour_op modulate
          }
          
        }
        
        pass pssm
        {
          scene_blend add
          
          // SUPER IMPORTANT TO AVOID FLICKERING
          depth_bias 0 0
          
          vertex_program_ref ShadowsPssm_vert
          {
          }
          fragment_program_ref ShadowsPssm_pix
          {
          }
          texture_unit
          {
            content_type shadow
            tex_address_mode border
            tex_border_colour 1 1 1 1
          }
          texture_unit
          {
            content_type shadow
            tex_address_mode border
            tex_border_colour 1 1 1 1
          }
          texture_unit
          {
            content_type shadow
            tex_address_mode border
            tex_border_colour 1 1 1 1
          }
        }
        
      }
    }

    There is still issue with wireframe materials for instance ( polygon_mode wireframe ). Another issue is the poor definition of the shadows once the camera is a bit further.

    As shown in this image, there is a clear cut in definition when going from the near texture (green one, 2048) to the second one (red one, 1024). I guess I have to look much closer to the distance steps.

     
    • xuv 03:06 on 2017-06-19 Permalink | Reply

      Nice. We want moarrr screenshots :-D.
      Could you also make the last one work in realtime? Pleeez.

    • FdeCd 08:13 on 2017-06-19 Permalink | Reply

      cool!! And if you had blur that could be fix the definition problem… or not?
      Can’t wait to test it 😉

  • frankiezafe 19:26 on 2017-06-16 Permalink | Reply
    Tags: devporn, , Ogre3D   

    Juste pour vos yeux, le dump d’un matériau Ogre:

     PMaterial:
        group: General
        name: shadows_pssm_cube
        receive shadows: 1
        transparency cast shadows: 0
        size: 3862
        techniques: 1
            technique[0]
                name:
                scheme: Default
                lod index: 0
        passes: 1
            pass[0]
                name: 0
            ** programs:
                vertex program: Shadows_pssm_vs
                fragment program: Shadows_pssm_ps
                compute program:
                shadow caster fragment program:
                shadow caster vertex program:
                tesselation domain program:
                tesselation hull program:
            ** colors:
                ambient: ColourValue( R:255, G:255, B:255, A:255 )
                diffuse: ColourValue( R:255, G:255, B:255, A:255 )
                emissive: ColourValue( R:0, G:0, B:0, A:255 )
                fog colour: ColourValue( R:255, G:255, B:255, A:255 )
                self illumination: ColourValue( R:0, G:0, B:0, A:255 )
                specular: ColourValue( R:0, G:0, B:0, A:255 )
            ** values:
                alpha reject value: 0
                depth bias constant: 0
                depth bias slope scale: 0
                fog density: 0.001
                fog end: 1
                fog start: 0
                hash: 0
                index: 0
                iteration depth bias: 0
                light count per iteration: 1
                light mask: -1
                max simultaneous lights: 8
                num shadow content textures: 3
                num texture unit states: 4
                pass iteration count: 1
                point attenuation constant: 1
                point attenuation linear: 0
                point attenuation quadratic: 0
                point max size: 0
                point min size: 0
                point size: 1
                shininess: 0
                start light: 0
            ** booleans:
                alpha coverage enabled: 0
                ambient light only: 0
                colour write enabled: 1
                depth check enabled: 1
                depth write enabled: 1
                fog override: 0
                iterate per light: 0
                light clip plane enabled: 0
                light scissoring enabled: 0
                lighting enabled: 1
                loaded: 1
                normalised normals: 0
                point attenuation enabled: 0
                point sprite enabled: 0
                polygon mode overrideable: 1
                programmable: 1
                run only for one light type: 0
                transparent: 0
                transparent sorting enabled: 1
                transparent sorting forced: 0
            ** enums:
                alpha reject function: CMPF_ALWAYS_PASS
                culling mode: CULL_CLOCKWISE
                depth function: CMPF_LESS_EQUAL
                dest blend factor: SBF_ZERO
                dest blend factor alpha: SBF_ZERO
                fog mode: FOG_NONE
                illumination stage: IS_UNKNOWN
                manual culling mode: MANUAL_CULL_BACK
                only light type: LT_POINT
                polygon mode: PM_SOLID
                scene blending operation: SBO_ADD
                scene blending operation alpha: SBO_ADD
                shading mode: SO_GOURAUD
                source blend factor: SBF_ONE
                source blend factor alpha: SBF_ONE
    TEXTURE UNIT COUNT = 4
    NUM TEXTURE UNIT STATES = 4
            textures: 4
                texture[0]
                    animation duration: 0
                    binding type: 0
                    colour blend fallback dest: 1
                    colour blend fallback src: 2
                    content type: 0
                    current frame: 0
                    desired format: 0
                    gamma: 1
                    alpha: 0
                    name: 0
                    num frames: 1
                    num mipmaps: -1
                    parent: 0x7f2a55d47a98
                    referenced MRT index: 18446463019639570529
                    texture anisotropy: 1
                    texture border colour: ColourValue(0, 0, 0, 1)
                    texture compare enabled: 0
                    texture compare function: 6
                    texture coord set: 0
                    texture mipmap bias: 0
                    texture name: cube.png
                    texture name alias: difftex
                    texture rotate: Radian(0)
                    texture transform: Matrix4( row0{1 0 0 0 } row1{0 1 0 0 } row2{0 0 1 0 } row3{0 0 0 1 })
                    texture type: 2
                    texture U scale: 1
                    texture U scroll: 0
                    texture V scale: 1
                    texture V scroll: 0
                texture[1]
                    animation duration: 0
                    binding type: 0
                    colour blend fallback dest: 1
                    colour blend fallback src: 2
                    content type: 1
                    current frame: 0
                    desired format: 0
                    gamma: 1
                    alpha: 0
                    name: 1
                    num frames: 0
                    num mipmaps: -1
                    parent: 0x7f2a55d47a98
                    referenced MRT index: 18446463019639570529
                    texture anisotropy: 1
                    texture border colour: ColourValue(1, 1, 1, 1)
                    texture compare enabled: 0
                    texture compare function: 6
                    texture coord set: 0
                    texture mipmap bias: 0
                    texture name:
                    texture name alias:
                    texture rotate: Radian(0)
                    texture transform: Matrix4( row0{1 0 0 0 } row1{0 1 0 0 } row2{0 0 1 0 } row3{0 0 0 1 })
                    texture type: 2
                    texture U scale: 1
                    texture U scroll: 0
                    texture V scale: 1
                    texture V scroll: 0
                texture[2]
                    animation duration: 0
                    binding type: 0
                    colour blend fallback dest: 1
                    colour blend fallback src: 2
                    content type: 1
                    current frame: 0
                    desired format: 0
                    gamma: 1
                    alpha: 0
                    name: 2
                    num frames: 0
                    num mipmaps: -1
                    parent: 0x7f2a55d47a98
                    referenced MRT index: 18446463019639570529
                    texture anisotropy: 1
                    texture border colour: ColourValue(1, 1, 1, 1)
                    texture compare enabled: 0
                    texture compare function: 6
                    texture coord set: 0
                    texture mipmap bias: 0
                    texture name:
                    texture name alias:
                    texture rotate: Radian(0)
                    texture transform: Matrix4( row0{1 0 0 0 } row1{0 1 0 0 } row2{0 0 1 0 } row3{0 0 0 1 })
                    texture type: 2
                    texture U scale: 1
                    texture U scroll: 0
                    texture V scale: 1
                    texture V scroll: 0
                texture[3]
                    animation duration: 0
                    binding type: 0
                    colour blend fallback dest: 1
                    colour blend fallback src: 2
                    content type: 1
                    current frame: 0
                    desired format: 0
                    gamma: 1
                    alpha: 0
                    name: 3
                    num frames: 0
                    num mipmaps: -1
                    parent: 0x7f2a55d47a98
                    referenced MRT index: 18446463019639570529
                    texture anisotropy: 1
                    texture border colour: ColourValue(1, 1, 1, 1)
                    texture compare enabled: 0
                    texture compare function: 6
                    texture coord set: 0
                    texture mipmap bias: 0
                    texture name:
                    texture name alias:
                    texture rotate: Radian(0)
                    texture transform: Matrix4( row0{1 0 0 0 } row1{0 1 0 0 } row2{0 0 1 0 } row3{0 0 0 1 })
                    texture type: 2
                    texture U scale: 1
                    texture U scroll: 0
                    texture V scale: 1
                    texture V scroll: 0

     
  • frankiezafe 15:29 on 2017-06-16 Permalink | Reply
    Tags: assets, Ogre3D, ,   

    Back to shadows problem, currently implementing a clean version of the Parallel-split shadow maps (pssm) in a way it could be packed nicely in the standard assets of the engine.

    , source: https://www.researchgate.net/publication/220805307_Parallel-split_shadow_maps_for_large-scale_virtual_environments

    End of the day

    PSSM shadows are applied “correctly” in the materials. Still a lot do to to be able to set the shadows from the xml…

     
  • frankiezafe 19:45 on 2017-04-24 Permalink | Reply
    Tags: , Ogre3D, , ,   

    Long time no see, but polymorph engine development is back on track!

    The XML describing a polymorph’s project is now able to configure the Ogre’s compositor, understand the post-processing module.

    The first screenshot is using a custom compositor with this configuration:

    <workspace name="TuningScoreWS">
      <script group="General" workspace="CustomCompositor" />
      <colors>
        <color name="background_center" value="0,1,0" node="0" pass="1" index="4"/>
        <color name="background_border" value="1,0,0" node="0" pass="1" index="8"/>
      </colors>
      <variables>
        <variable name="centerx" value="0.5" node="0" pass="1" index="0"/>
        <variable name="centery" value="0.5" node="0" pass="1" index="1"/>
        <variable name="radius" value="0.9" node="0" pass="1" index="2"/>
        <variable name="ratio" value="1.777777778" node="0" pass="1" index="3"/>
      </variables>
    </workspace>
    

    The required files for this compositor (shaders & nodes) can be found in the samples example.compositor.

    The second screenshot is using a default compositor, where only the background color can be modified.

    <workspace name="Default">
      <colors>
        <color name="background" value="1,0,0"/>
      </colors>
    </workspace>
    

    The documentation about the XML is here: https://bitbucket.org/polymorphteam/pe.2.0/wiki/xml-specifications

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

    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: , , , Ogre3D   

    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.

     
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