Commit be347a9d32f0ab2136a7516fd940eff138911c77
1 parent
da9d7289
Trees and some big plants will gently swing in the wind
Showing
5 changed files
with
40 additions
and
1 deletions
... | ... | @@ -41,7 +41,7 @@ for i = 1, 4 do |
41 | 41 | newEntity{ base = "JUNGLE_GRASS", define_as = "JUNGLE_GRASS_PATCH"..(i+5+8+3), add_displays={class.new{z=3,image = "terrain/jungle/jungle_dirt_var_"..i.."_64_01.png"}} } |
42 | 42 | end |
43 | 43 | for i = 1, 4 do |
44 | - newEntity{ base = "JUNGLE_GRASS", define_as = "JUNGLE_GRASS_PATCH"..(i+5+8+3+4), add_displays={class.new{z=3,image = "terrain/jungle/jungle_plant_0"..i..".png"}} } | |
44 | + newEntity{ base = "JUNGLE_GRASS", define_as = "JUNGLE_GRASS_PATCH"..(i+5+8+3+4), add_displays={class.new{z=3,image = "terrain/jungle/jungle_plant_0"..i..".png", shader="tree"}} } | |
45 | 45 | end |
46 | 46 | |
47 | 47 | newEntity{ | ... | ... |
game/modules/tome/data/gfx/shaders/tree.frag
0 → 100644
1 | +uniform sampler2D tex; | |
2 | +uniform float tick; | |
3 | +uniform vec2 mapCoord; | |
4 | + | |
5 | +void main(void) | |
6 | +{ | |
7 | + float time = tick / 1000.0; | |
8 | + vec2 xy = gl_TexCoord[0].xy; | |
9 | + if (xy.y <= 0.5) xy.x = xy.x + (0.5-xy.y) * sin(time + mapCoord.x / 40 + mapCoord.y) / 14.0; | |
10 | + gl_FragColor = texture2D(tex, xy) * gl_Color; | |
11 | +} | ... | ... |
game/modules/tome/data/gfx/shaders/tree.lua
0 → 100644
1 | +-- ToME - Tales of Maj'Eyal | |
2 | +-- Copyright (C) 2009 - 2014 Nicolas Casalini | |
3 | +-- | |
4 | +-- This program is free software: you can redistribute it and/or modify | |
5 | +-- it under the terms of the GNU General Public License as published by | |
6 | +-- the Free Software Foundation, either version 3 of the License, or | |
7 | +-- (at your option) any later version. | |
8 | +-- | |
9 | +-- This program is distributed in the hope that it will be useful, | |
10 | +-- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | +-- GNU General Public License for more details. | |
13 | +-- | |
14 | +-- You should have received a copy of the GNU General Public License | |
15 | +-- along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | +-- | |
17 | +-- Nicolas Casalini "DarkGod" | |
18 | +-- darkgod@te4.org | |
19 | + | |
20 | +return { | |
21 | + frag = "tree", | |
22 | + vert = nil, | |
23 | + args = { | |
24 | + }, | |
25 | + clone = false, | |
26 | +} | ... | ... |
-
Please register or login to post a comment