示例#1
0
        /// <summary>
        /// Assigns a 2D texture to the shader parameter with the specified name.
        /// </summary>
        /// <param name="name">Name of the shader parameter.</param>
        /// <param name="value">Value of the parameter.</param>
        public void SetTexture2D(string name, Texture2D value)
        {
            IntPtr texturePtr = IntPtr.Zero;

            if (value != null)
            {
                texturePtr = value.GetCachedPtr();
            }

            Internal_SetTexture2D(mCachedPtr, name, texturePtr);
        }
示例#2
0
        /// <summary>
        /// Creates a new 2D render texture using existing textures as render destinations.
        /// </summary>
        /// <param name="colorSurface">Color texture to render color data to.</param>
        /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
        public RenderTexture2D(Texture2D colorSurface, Texture2D depthStencilSurface = null)
        {
            IntPtr[] colorSurfaceInstances = new IntPtr[1];
            colorSurfaceInstances[0] = colorSurface.GetCachedPtr();

            IntPtr depthStencilInstance = IntPtr.Zero;
            if (depthStencilSurface != null)
                depthStencilInstance = depthStencilSurface.GetCachedPtr();

            Internal_Create(this, colorSurfaceInstances, depthStencilInstance);
        }
示例#3
0
        /// <summary>
        /// Creates a new 2D render texture using one or multiple color textures and a depth/stencil texture.
        /// </summary>
        /// <param name="colorSurfaces">Color texture(s) to render color data to. </param>
        /// <param name="depthStencilSurface">>Optional depth/stencil texture to render depth/stencil data to.</param>
        public RenderTexture2D(Texture2D[] colorSurfaces, Texture2D depthStencilSurface = null)
        {
            IntPtr[] colorSurfaceInstances = new IntPtr[colorSurfaces.Length];

            for(int i = 0; i < colorSurfaces.Length; i++)
                colorSurfaceInstances[i] = colorSurfaces[i] != null ? colorSurfaces[i].GetCachedPtr() : IntPtr.Zero;

            IntPtr depthStencilInstance = IntPtr.Zero;
            if (depthStencilSurface != null)
                depthStencilInstance = depthStencilSurface.GetCachedPtr();

            Internal_Create(this, colorSurfaceInstances, depthStencilInstance);
        }
示例#4
0
        /// <summary>
        /// Creates a new 2D render texture using existing textures as render destinations.
        /// </summary>
        /// <param name="colorSurface">Color texture to render color data to.</param>
        /// <param name="depthStencilSurface">Optional depth/stencil texture to render depth/stencil data to.</param>
        public RenderTexture2D(Texture2D colorSurface, Texture2D depthStencilSurface = null)
        {
            IntPtr[] colorSurfaceInstances = new IntPtr[1];
            colorSurfaceInstances[0] = colorSurface.GetCachedPtr();

            IntPtr depthStencilInstance = IntPtr.Zero;

            if (depthStencilSurface != null)
            {
                depthStencilInstance = depthStencilSurface.GetCachedPtr();
            }

            Internal_Create(this, colorSurfaceInstances, depthStencilInstance);
        }
示例#5
0
        /// <summary>
        /// Creates a new 2D render texture using one or multiple color textures and a depth/stencil texture.
        /// </summary>
        /// <param name="colorSurfaces">Color texture(s) to render color data to. </param>
        /// <param name="depthStencilSurface">>Optional depth/stencil texture to render depth/stencil data to.</param>
        public RenderTexture2D(Texture2D[] colorSurfaces, Texture2D depthStencilSurface = null)
        {
            IntPtr[] colorSurfaceInstances = new IntPtr[colorSurfaces.Length];

            for (int i = 0; i < colorSurfaces.Length; i++)
            {
                colorSurfaceInstances[i] = colorSurfaces[i] != null ? colorSurfaces[i].GetCachedPtr() : IntPtr.Zero;
            }

            IntPtr depthStencilInstance = IntPtr.Zero;

            if (depthStencilSurface != null)
            {
                depthStencilInstance = depthStencilSurface.GetCachedPtr();
            }

            Internal_Create(this, colorSurfaceInstances, depthStencilInstance);
        }
示例#6
0
        /// <summary>
        /// Assigns a 2D texture to the shader parameter with the specified name.
        /// </summary>
        /// <param name="name">Name of the shader parameter.</param>
        /// <param name="value">Value of the parameter.</param>
        public void SetTexture2D(string name, Texture2D value)
        {
            IntPtr texturePtr = IntPtr.Zero;
            if (value != null)
                texturePtr = value.GetCachedPtr();

            Internal_SetTexture2D(mCachedPtr, name, texturePtr);
        }