Commit be347a9d32f0ab2136a7516fd940eff138911c77

Authored by DarkGod
1 parent da9d7289

Trees and some big plants will gently swing in the wind

... ... @@ -201,6 +201,7 @@ function _M:makeTrees(base, max, bigheight_limit, tint)
201 201 display_h = treeid < (bigheight_limit or 9) and 1 or 2,
202 202 image = (base or "terrain/tree_alpha")..treeid..".png",
203 203 tint = tint,
  204 + shader = "tree",
204 205 }
205 206 end
206 207
... ...
... ... @@ -136,6 +136,7 @@ newEntity{
136 136 change_level = 1,
137 137 change_zone = "wilderness",
138 138 nice_editer = grass_editer,
  139 + shader = "tree",
139 140 }
140 141
141 142 newEntity{
... ...
... ... @@ -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{
... ...
  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 +}
... ...
  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 +}
... ...