Tagged: tutorial Toggle Comment Threads | Keyboard Shortcuts

  • frankiezafe 17:36 on 2018-06-05 Permalink | Reply
    Tags: , security, tutorial   

    How to create and load savegames

    Creation of files with encryption in godot.

    https://godottutorials.blogspot.com/2015/06/how-to-create-savegames.html

     
  • frankiezafe 14:11 on 2017-10-11 Permalink | Reply
    Tags: , , , tutorial   

    Ogre3d really deserves some attention to deliver its full potential. A good example is the management of different version of shaders in a single program. In the image here above, the graphical cards are very different: the laptop has a low-end integrated intel chipset, the workstation is working with a GTX 980. The supported opengl version: glsl120 max for the laptop, vp40 for the gtx.

    This information is dumped in terminal when the application starts, search for something like this:

    Supported Shader Profiles: arbfp1 arbvp1 fp20 fp30 fp40 glsl glsl100 glsl110 glsl120 gp4fp gp4gp gp4vp gpu_fp gpu_gp gpu_vp nvgp4 vp30 vp40

    Once identified, we can now prepare a program script to select shaders automatically.

    In the .material:

    material shader_tester
    {
      technique{
        pass
        {
          fragment_program_ref tester_pix
          {
          }
        }
      }
    }

    In the .program:

    fragment_program tester_pix_glsl glsl
    {
      source tester_pix_120.glsl
    }

    fragment_program tester_pix_glsl_330 glsl
    {
      source tester_pix_330.glsl
      syntax fp40
    }

    fragment_program tester_pix unified
    {
      delegate tester_pix_glsl
      delegate tester_pix_glsl_330
    }

    The crucial instruction here is the syntax definition in fragment_program tester_pix_glsl_330. The available flags are listed here: Declaring Vertex/Geometry/Fragment Programs. The fragment_program tester_pix_glsl has no syntax flag, it will be used as the default one.

    Shaders are stupidly simple in this case.

    tester_pix_120.glsl

    void main() {
      gl_FragColor = vec4( 0,1,0,1 );
    }

    tester_pix_330.glsl

    #version 330
    void main() {
      gl_FragColor = vec4( 1,0,0,1 );
    }

    And that’s it for the automatic selection of shaders in ogre.

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

    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 20:13 on 2017-01-10 Permalink | Reply
    Tags: , , tutorial   

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

    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 19:35 on 2016-11-20 Permalink | Reply
    Tags: , , tutorial   

    selection_709

    Here is the output and the code of the empty example. It is using polymorph package.

    Once installed (the tricky part, soon fixed with a magic installation script), you just have to extends PolymorphApplication class and start working.

    As you may notice, the class CustomApp does nothing on its own. It just calls the mother class’ methods. The purpose of this empty project is to enlight crucial methods to overwrite in order to start coding something.

    I’m now working on a basic example, showing how to add primitives, load meshes, add lights and animate them.

     
    • frankiezafe 21:34 on 2016-11-20 Permalink | Reply

      @xuv & @balt : i think it’s important to be obvious on what is polymorph and what is ogre by keeping the namespaces as they are. For instance, creating a PNode requires to call polymorph::PNode. When you want to create a vec3, there you have to call Ogre::Vector3.
      In the example above, the using namespace is only used in cpp => for all class params (.h), they have to be set this way. It will be explained in the basic example.
      What d’u think?

      • xuv 14:19 on 2016-11-21 Permalink | Reply

        @frankiezafe : seems coherent.

        • frankiezafe 15:53 on 2016-11-21 Permalink | Reply

          i’ve started working on a “PObject”, wich is a common ground for PNodes, PLights and PSounds. It’s a abstract object defining anyhting located in the 3d world, with possibility to attach them together or add physics on them.
          Result: ultra tuff conceptual work, using an abstract class + a template class for PObject – will work in a few days.

  • frankiezafe 18:53 on 2016-10-12 Permalink | Reply
    Tags: , , , tutorial   

    Documentation about how to prepare meshes (structure, materials, etc.) usable by bullet in polymorph engine.

    >> https://bitbucket.org/polymorphteam/pe.2.0/wiki/blender-bullet-primitives

    The documentation of the project is not yet ready, as you might see if you surf a bit in the wiki…

    polymorph-physics-primitives-im

     
  • frankiezafe 08:56 on 2016-10-06 Permalink | Reply
    Tags: , tutorial   

    Notes about cones for tutorial.

    mine-screenshot02

    mine-screenshot01

    Report:
    Original Vertices: 1155
    Exported Vertices: 6527
    Original Faces: 2192
    Exported Triangles: 2222
    MESHES: 2
    MATERIALS: 22
    Extended Report:
    MESHES:
    . mine-physics
    . mine
    MATERIALS:
    . sphere_physcis01
    . cone_physics01
    . cone_physics02
    . cone_physics03
    . cone_physics04
    . cone_physics05
    . cone_physics06
    . cone_physics07
    . cone_physics08
    . cone_physcis09
    . cone_physcis10
    . cone_physcis11
    . cone_physcis12
    . cone_physics13
    . cone_physcis14
    . cone_physcis15
    . cone_physics16
    . cone_physics17
    . cone_physcis18
    . cone_physics19
    . cone_physics20
    . mine-mat

     
  • frankiezafe 18:17 on 2016-10-03 Permalink | Reply
    Tags: , , , tutorial,   

    How to prepare meshes and its physical version in blender usable in polymorph engine?

    How it’s looking like once done in the right way:

    For this mesh (a kind of quad pods not very well done):

    triball-screenshot01

    You can resume the shape with:

    • 4 boxes, surrounding the legs of the shape
    • and 4 spheres, surrounding the ends of each legs.

    To do so, design the collider using cubes and sphere (low resolution ones, i’ve used 10×5 just because it will look nicer in the screenshots :)).

    Attribute a different material to each part using this naming convention:

    • material for boxes starts with “box_”;
    • material for spheres starts with “sphere_”.

    The different colors of materials is just to make the screenshot clearer.

    triball-screenshot02

    Apply a triangulate modifier to ensure you don’t have any ngon in your meshes.

    Once all this is done, export the meshes using blender2ogre addon.

    The importation steps will be described in the full tutorial, with the complete documentation.

     
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