Skip to content
Snippets Groups Projects
Commit fffcfef2 authored by dg's avatar dg
Browse files

clouds

git-svn-id: http://svn.net-core.org/repos/t-engine4@5407 51575b47-30f0-44d4-a5cc-537603b46e54
parent 4e90c533
No related branches found
No related tags found
No related merge requests found
#extension GL_EXT_gpu_shader4: enable
uniform sampler2D tex;
uniform float tick;
uniform vec2 mapCoord;
uniform vec2 texSize;
float rand(vec2 co){
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
void main(void)
{
vec2 uv = gl_TexCoord[0].xy;
vec2 r = rand(mapCoord / texSize);
vec4 c = texture2D(tex, uv);
c.a *= 0.3 + (((1 + r.x * sin(tick / 1000 + mapCoord.y)) / 2) * ((1 + r.y * cos(tick / 1000 + mapCoord.x)) / 2)) * 0.7;
gl_FragColor = c;
}
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
return {
frag = "cloud_anim",
vert = nil,
args = {
tex = { texture = 0 },
},
clone = false,
}
void main()
{
// Transforming The Vertex
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex+vec3(10.0,10.0,0.0);
}
\ No newline at end of file
game/modules/tome/data/gfx/shockbolt/terrain/clouds/cloud_normal_001.png

10.9 KiB

game/modules/tome/data/gfx/shockbolt/terrain/clouds/cloud_normal_002.png

10.8 KiB

game/modules/tome/data/gfx/shockbolt/terrain/clouds/cloud_normal_003.png

10.8 KiB

......@@ -18,4 +18,12 @@
-- darkgod@te4.org
load("/data/general/grids/basic.lua")
load("/data/general/grids/void.lua")
newEntity{
define_as = "CLOUD",
type = "floor", subtype = "cloud",
name = "floor", image = "terrain/clouds/cloud_normal_002.png",
display = '~', color_r=255, color_g=255, color_b=255, back_color=colors.DARK_GREY,
shader = "cloud_anim",
}
\ No newline at end of file
......@@ -38,11 +38,11 @@ return {
zoom = 3,
sqrt_percent = 45,
noise = "fbm_perlin",
floor = "FLOOR",
wall = "WALL",
up = "FLOOR",
down = "FLOOR",
door = "FLOOR",
floor = "CLOUD",
wall = "OUTERSPACE",
up = "CLOUD",
down = "CLOUD",
door = "CLOUD",
},
},
post_process = function(level)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment