GetTexelOffset() private method

private GetTexelOffset ( ) : Vector2
return Vector2
Esempio n. 1
0
    // =============================================================================
    // =============================================================================
    // METHODS STATIC --------------------------------------------------------------
    private static void Render4TapQuad( RenderTexture dest, float offsetX, float offsetY )
    {
        GL.Begin( GL.QUADS );

        // Direct3D needs interesting texel offsets!
        Vector2 off = Vector2.zero;
        if( dest != null )
        {
            off = dest.GetTexelOffset()*0.75f;
        }

        Set4TexCoords( off.x, off.y, offsetX, offsetY );
        GL.Vertex3( 0f, 0f, 0.1f );

        Set4TexCoords( 1.0f + off.x, off.y, offsetX, offsetY );
        GL.Vertex3( 1f, 0f, 0.1f );

        Set4TexCoords( 1.0f + off.x, 1.0f + off.y, offsetX, offsetY );
        GL.Vertex3( 1f, 1f, 0.1f );

        Set4TexCoords( off.x, 1.0f + off.y, offsetX, offsetY );
        GL.Vertex3( 0f, 1f, 0.1f );

        GL.End();
    }
Esempio n. 2
0
 static public int GetTexelOffset(IntPtr l)
 {
     try {
         UnityEngine.RenderTexture self = (UnityEngine.RenderTexture)checkSelf(l);
         var ret = self.GetTexelOffset();
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Esempio n. 3
0
 static public int GetTexelOffset(IntPtr l)
 {
     try {
         UnityEngine.RenderTexture self = (UnityEngine.RenderTexture)checkSelf(l);
         var ret = self.GetTexelOffset();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int GetTexelOffset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.RenderTexture obj = (UnityEngine.RenderTexture)ToLua.CheckObject(L, 1, typeof(UnityEngine.RenderTexture));
         UnityEngine.Vector2       o   = obj.GetTexelOffset();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }