Resources
Skyline resources; Third party applications, Demo Scenes, Action plug-ins, Action Scripts, Presets etc any thing that can be used by Skyline

new fullscreen effects

new fullscreen effects

Postby kohelo » 22 Oct 2017, 02:33

there is contributions to collection of fs effects:

Image
Large
Title: underwater

Syntaxis: Ogre v2.

Step1: adding to underwater.compositor file

Code: Select all
compositor_node Underwater
{
   in 0 rt_input
   in 1 rt_output

   custom_id Ogre/Postprocess

   target rt_output
   {
      pass render_quad
      {
         // convert the previous render target to a black and white image, add some noise, distort it,
         // then render to scene aligned quad
         material Postprocess/Underwater
         input 0 rt_input
      }
   }
   
   out 0 rt_output
   out 1 rt_input
}


and

Code: Select all
compositor_node PostprocessingSampleStdRenderer
{
   //Temporary textures one of them that we don't use, but the rest of simple compositors (Bloom,
   //Invert, Glass, etc) will take as 2nd input, and then ping pong between rt0 and rt1 to avoid creating
   //more than 2 RTs. In Ogre 1.x; each compositor created an implicit RT, which could quickly
   //turn very VRAM intensive.
   //
   //Another advantage from this approach (besides saving tons of VRAM) is that HDR renderers can
   //pass RTs with floating point formats, thus for example, a simple compositor wouldn't lose
   //precision converting from FP16 to RGB888.
   texture rt0 target_width target_height PF_R8G8B8
   texture rt1 target_width target_height PF_R8G8B8

   target rt0
   {
      pass clear
      {
         colour_value 0.2 0.4 0.6 1
      }

      pass render_scene
      {
         //lod_update_list   off               //Turn Lod off?
         shadows            ShadowMapDebuggingShadowNode
         overlays         off
      }

   //   pass render_quad
   //   {
   //      quad_normals   camera_direction
   //      material PostprocessingSample/Sky
   //   }
   }
   
   //Play nice with Multi-GPU setups by telling the API there is no inter-frame dependency.
   //On APIs that support discard_only (e.g. DX11) the driver may just ignore the colour value,
   //and use a different memory region (i.e. the value read from a pixel of a discarded buffer
   //without having written to it is undefined)
   target rt1
   {
      pass clear
      {
         colour_value   0 1 0 1
         buffers         colour
         discard_only   true
      }
   }
   
   out 0 rt0
   out 1 rt1
}



and

Code: Select all
compositor_node FinalComposition
{
   in 0 rt_output
   // Take input texture #1 and use the local name "rtN" for reference in this scope
   in 1 rtN

   target rt_output
   {
      //Play nice with Multi-GPU setups by telling the API there is no inter-frame dependency.
      //On APIs that support discard_only (e.g. DX11) the driver may just ignore the colour value,
      //and use a different memory region (i.e. the value read from a pixel of a discarded buffer
      //without having written to it is undefined)
      pass clear
      {
         colour_value   1 0 0 1
         buffers         colour
         discard_only   true
      }

      pass render_quad
       {
         //Ignore the alpha channel
         material Ogre/Copy/4xFP32
          input 0 rtN
      }
      
      pass render_scene
      {
         lod_update_list   off

         //Render Overlays
         overlays   on
         rq_first   254
         rq_last      255
      }
   }
}


and

Code: Select all
workspace UnderwaterPostprocessingSampleWorkspace
{

   connect PostprocessingSampleStdRenderer Underwater

   connect_output FinalComposition 0
   connect Underwater 0 FinalComposition 1
}




save file.

Step2: add to "Underwater.material" file.

Code: Select all
fragment_program OldTV_ps_GLSL glsl
{
   source Glass_ps.glsl
    default_params
   {
         param_named Image int 0
         param_named Rand int 1
         param_named Noise int 2
   }
}

fragment_program OldTV_ps_HLSL hlsl
{
   source Underwater_ps.hlsl
   target ps_5_0 ps_4_0 ps_4_0_level_9_1 ps_4_0_level_9_3
   entry_point main
}

fragment_program OldTV_ps unified
{
   delegate OldTV_ps_GLSL
   delegate OldTV_ps_HLSL
}


material Postprocess/Underwater
{
   technique
   {

      pass
      {
         depth_check off
         depth_write off

         cull_hardware none

         vertex_program_ref Ogre/Compositor/Quad_vs
         {
         }

         fragment_program_ref OldTV_ps
         {
                param_named distortionFreq float 2.7
                param_named distortionScale float 0.05
                param_named distortionRoll float 0.93
                param_named interference float 0.05
                param_named frameLimit float 0.040
                param_named frameShape float 0.026
                param_named frameSharpness float 2.1
            
                param_named_auto time_0_X time_0_x 120
                param_named_auto sin_time_0_X sintime_0_x 120            
         }

         texture_unit
         {
                tex_coord_set 0
            tex_address_mode clamp
            filtering linear linear linear
         }

         //texture_unit
         //{
         //   texture Random3D.tga 3d
         //   tex_address_mode wrap
         //   filtering linear linear linear
         //}

         //texture_unit
         //{
         //   texture NoiseVolume.tga 3d
         //   tex_address_mode wrap
         //   filtering linear linear point
         //}
      }
   }
}


save file.

Conclusion:

For enabling compositor, add "UnderwaterPostprocessingSampleWorkspace" in name compositor creator.
For complete working, need presents standart ogre2 missing demo files like "material Ogre/Copy/4xFP32" and others (only in script chain).
User avatar
kohelo
Skyline Contributor
Skyline Contributor
 
Posts: 23
Joined: 02 Apr 2016, 15:25
Skill: Programmer

Re: new fullscreen effects

Postby SolarPortal » 22 Oct 2017, 11:44

Thank you @kohelo, we shall try to integrate this into skyline, but we have some jobs to do relating to workspaces to enable the use of multiple post fx
Conceive, Quantify & Do!
Remember skyline is in beta, and with your help; we can improve it for future users.
Always give as much information as possible when asking for help.

Specs: OS: Win 10 64bit, CPU: Intel i7 3770 3.4ghz x 8 core, GPU: Nvidia GTX 750 Ti, Ram: 16gig DDR3
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 2810
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: new fullscreen effects

Postby SolarPortal » 05 Nov 2017, 14:04

just tried it and it fit in easily :)

the "Underwater_ps.hlsl" is missing though... thanks for the addition to the engine :)
Conceive, Quantify & Do!
Remember skyline is in beta, and with your help; we can improve it for future users.
Always give as much information as possible when asking for help.

Specs: OS: Win 10 64bit, CPU: Intel i7 3770 3.4ghz x 8 core, GPU: Nvidia GTX 750 Ti, Ram: 16gig DDR3
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 2810
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Resources

Who is online

Users browsing this forum: No registered users and 1 guest