Tagged: shadow Toggle Comment Threads | Keyboard Shortcuts

  • frankiezafe 23:24 on 2017-10-12 Permalink | Reply
    Tags: , , , , , , shadow,   

    (a bit more than a technical demo this time)
    After finishing the work on shadows, it was time to play with the different materials possibilities.

    To explain a bit what you are seeing:

    • at the top left, the 3 textures containing the shadow maps;
    • transparent walls (wireframes) are not take into account in the shadow map because they are using a specific material called invisible_for_shadows, i think the name is obvious;
    • the foggy volume above the ground is made of a stack of 25 thin boxes, using another cool material: solid_shadows_no_cast, they receive shadows but don’t cast them;
    • and the balls, using the solid_shadows material and having the standard behavior, but in wireframe, implying that fog is hollowed when you look through them.

    A cool feature is the ability to set the alpha of the shadows material per material. For the jelly fog, the material is looking like this:

    material screen_mat : solid_shadows_no_cast
    {
      technique
      {
        pass standard
        {
          diffuse 0.6 0.7 0.95 0.2
          emissive 0.2 0.3 0.45 0.4
          depth_write off
          scene_blend alpha_blend
        }
        pass pssm
        {
          fragment_program_ref ShadowsPssm_pix
          {
            param_named shadow_alpha float 0.2
          }
        }
      }
    }

    The speed control over the physic simulation (when everything freeze) is modifying the time multiplier of bullet. The call is looking like this:

    polymorph::PBullet::time_multiplier(0.85);

    Complete projects is accessible in the engine, under samples/0.1/example.pssm_shadows.

    I need to rest a bit, it has been a harsh road to get this packed. The last part of the job is to ensure the compatibility low opengl versions!

     
  • frankiezafe 19:50 on 2017-10-06 Permalink | Reply
    Tags: , pssm, shadow, ,   

    Tech info: 3 splits, 4096, 2048 & 1024 maps, 2 pass materials on all objects, gpu: GTX 980.

    Working on an “easy” to deploy shadow system for the engine. The work now is to make the activation of these as simple as possible.

    For the moment, the activtion has to be done manually through many steps: loading specific resources, activating them, modification of the default PolymorphApplication methods, etc.

    To make it simplier, the resources should be placed in zip, like the PolymorphTrays.zip (containing the UI style), and loaded via standard methods.

    Just to mention, I discovered the “import” feature in ogre’s materials, just wonderful! To modify the appearence of the balls in the video, one just have to inherit from a complex material called two_pass_shadows declared in the shadow package, in shadows_pssm.material file.

    import * from “shadows_pssm.material”
    material ball_mat : two_pass_shadows
    {
      technique
      {
        pass standard
        {
          diffuse 0.1 0.99 0.95 1.0
          texture_unit
          {
            texture retro.png
            colour_op alpha_blend
          }
        }
      }
    }

    see Script-Inheritance for details.

     
  • frankiezafe 21:13 on 2017-06-25 Permalink | Reply
    Tags: , , , , shadow,   

    Tutorial for shadow mapping: http://www.paulsprojects.net/tutorials/smt/smt.html

    Resources about shadow techniques:

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

    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 15:29 on 2017-06-16 Permalink | Reply
    Tags: assets, , , shadow   

    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…

     
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