skofrant
Member
Hi All
How to get the exact effect of animated 2D fog in a game maker studio 1.4??
Something similar to this video
Could anyone help me to rewrite my code so that I could get a similar effect to the film?
Thanks
I tried to use shaders. But that's not the effect here on this video. My code looks like this:
SHADER
shrFOG
objFog
CREATE
DRAW GUI BEGIN
How to get the exact effect of animated 2D fog in a game maker studio 1.4??
Something similar to this video
Could anyone help me to rewrite my code so that I could get a similar effect to the film?
Thanks
I tried to use shaders. But that's not the effect here on this video. My code looks like this:
SHADER
shrFOG
HTML:
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}
objFog
CREATE
HTML:
u_color = shader_get_uniform(shrFog, "color");
u_octaves = shader_get_uniform(shrFog, "OCTAVES");
u_time = shader_get_uniform(shrFog, "TIME");
DRAW GUI BEGIN
HTML:
shader_set(shrFog);
shader_set_uniform_f(u_color, 0.35, 0.48, 0.95);
shader_set_uniform_i(u_octaves, 4);
shader_set_uniform_f(u_time, current_time * 0.001);
// shader uzywa UV, mozesz tez stworzyc mesha dla post processow
draw_background(bgJazzJackrabbit, 0, 0);
shader_reset();