|
@@ -32,10 +32,14 @@ class GlslOut {
|
|
|
var isVertex : Bool;
|
|
|
var allNames : Map<String, Int>;
|
|
|
public var varNames : Map<Int,String>;
|
|
|
+ public var flipY : Bool;
|
|
|
|
|
|
public function new() {
|
|
|
varNames = new Map();
|
|
|
allNames = new Map();
|
|
|
+ #if js
|
|
|
+ flipY = true;
|
|
|
+ #end
|
|
|
}
|
|
|
|
|
|
inline function add( v : Dynamic ) {
|
|
@@ -189,7 +193,7 @@ class GlslOut {
|
|
|
case Texture2D:
|
|
|
// convert S/T (bottom left) to U/V (top left)
|
|
|
// we don't use 1. because of pixel rounding (fixes artifacts in blur)
|
|
|
- decl("vec4 _texture2D( sampler2D t, vec2 v ) { return texture2D(t,vec2(v.x,0.999999-v.y)); }");
|
|
|
+ decl("vec4 _texture2D( sampler2D t, vec2 v ) { return texture2D(t,vec2(v.x,"+(flipY?"0.999999-v.y":"v.y")+")); }");
|
|
|
default:
|
|
|
}
|
|
|
add(GLOBALS.get(g));
|