1
0
Fork 0

Merge branch 'master' of git://gitorious.org/fg/fgdata

This commit is contained in:
BARANGER Emmanuel 2012-08-06 15:47:38 +02:00
commit 93364b3d31
2 changed files with 24 additions and 2 deletions

View file

@ -701,12 +701,34 @@ var Path = {
}
};
# Image
# ==============================================================================
# Class for an image element on a canvas
#
var Image = {
new: func(parent, id)
{
var m = {
parents: [Image, Element.new(parent, "image", id, arg)]
};
m.color = _createColorNodes(m._node, "color");
m.sourceRect = m._node.getNode("source", 1);
return m;
},
setFile: func(file)
{
me.set("file", file);
}
};
# Element factories used by #Group elements to create children
Group._element_factories = {
"group": Group.new,
"map": Map.new,
"text": Text.new,
"path": Path.new
"path": Path.new,
"image": Image.new
};
# Canvas

View file

@ -59,7 +59,7 @@ void main() {
vec3 dirt = vec3(1.0);
if (filmWear) {
dirt = texture2D(film_tex, initialCoords + vec2(0.0, osg_SimulationTime * 7.7)).rgb;
dirt = texture2D(film_tex, initialCoords*vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x ) + vec2(0.0, osg_SimulationTime * 7.7)).rgb;
}
vec4 color = texture2D( lighting_tex, c1 );