Moving clouds ?

Users who are viewing this thread

Knight of calradia said:
Sounds intereting. Do you guys know any shader/shaders what would do it possible ?

It's pretty easy, you have various textures which act as layers, a pair will suffice.

Then on the pixel shader you mix them and add a slight horizontal scrolling in the UV coordinates of the top layer by using the
Code:
time_var
.
Fancier effects are common, but something like that will look fine enough for the untrained eye.

It requires some changes to the existing skybox shader, its in-brf shader reference and possible materials.

--

Edit: Something like this, pseudo-code, untested.
Code:
...

/* sample both textures in their respective coordinates, the second texture needs to be transparent */
float3 cloud_background = text2d(diffuse_sampler, uv).rgb;
float4 cloud_foreground = text2d(diffuse_sampler2, float2(u.x + (time_var*.4), v.y));

/* blend them using linear interpolation, modulating by the moving clouds alpha/transparency channel */
float3 final_color = lerp(cloud_background.rgb, cloud_foreground.rgb, cloud_foreground.a);

...
 
Or by particules method  :wink:

1 make a simple model with the good material (import in open brf) name it "prt_mesh_anim_clouds".

2 a clouds texture with 50% transparency ,save it in dxt5

3 the codes :

module_scene_props

  ("animated_cloud",0,"0","0",
  [
  (ti_on_scene_prop_init,
    [
    (neg|is_currently_night),
    (particle_system_add_new, "psys_anim_c"),
    ]),
  ]),




module_particle_systems

    ("anim_c",  psf_billboard_3d|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_anim_clouds",
    7, 9.0, 10, 0.0, 3.0, 3.0,    #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
    (0.7, 0.1), (1, 0.0),        #alpha keys
    (1.0, 1.0), (1, 1.0),      #red keys
    (1.0, 1.0), (1, 1.0),      #green keys
    (1.0, 1.0), (1, 1.0),      #blue keys
    (0.0, 4),  (1.0, 4.5),  #scale keys
    (9.0, 9.0, 0),          #emit box size
    (1.7, 1.5, 1.7),                #emit velocity#### <<< cruise control
    0.3,                      #emit dir randomness
    0.4,                      #rotation speed
    0.2                        #rotation damping
    ), 

On the scene : edit mode/put an animated cloud.

The same method used by my animated fog /and birds  :wink:
RUPH5.jpg
ei8Wi.jpg

Take my cloud texture if you want  :smile:  in pgn > you need to make  :50% or less/much transparency/save in DXT5
X76nS.png
 
FantasyWarrior said:
Or by particules method  :wink:

1 make a simple model with the good material (import in open brf) name it "prt_mesh_anim_clouds".

2 a clouds texture with 50% transparency ,save it in dxt5

3 the codes :

module_scene_props

  ("animated_cloud",0,"0","0",
  [
  (ti_on_scene_prop_init,
    [
    (neg|is_currently_night),
    (particle_system_add_new, "psys_anim_c"),
    ]),
  ]),




module_particle_systems

    ("anim_c",  psf_billboard_3d|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_anim_clouds",
    7, 9.0, 10, 0.0, 3.0, 3.0,    #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
    (0.7, 0.1), (1, 0.0),        #alpha keys
    (1.0, 1.0), (1, 1.0),      #red keys
    (1.0, 1.0), (1, 1.0),      #green keys
    (1.0, 1.0), (1, 1.0),      #blue keys
    (0.0, 4),  (1.0, 4.5),  #scale keys
    (9.0, 9.0, 0),          #emit box size
    (1.7, 1.5, 1.7),                #emit velocity#### <<< cruise control
    0.3,                      #emit dir randomness
    0.4,                      #rotation speed
    0.2                        #rotation damping
    ), 

On the scene : edit mode/put an animated cloud.

The same method used by my animated fog /and birds  :wink:
RUPH5.jpg
ei8Wi.jpg

Take my cloud texture if you want  :smile:  in pgn > you need to make  :50% or less/much transparency/save in DXT5
X76nS.png

Thanks a lot for both of you of your efforts, This will go to good use.

Greetings.
 
Back
Top Bottom