コード例 #1
0
        public void DrawPostFxMaterial(MaterialBase material, RenderTarget output, RenderTarget input, RenderView view, RenderBuffers buffers = null)
        {
#if UNIT_TEST_COMPILANT
            throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set.");
#else
            Internal_DrawPostFxMaterial2(unmanagedPtr, Object.GetUnmanagedPtr(material), Object.GetUnmanagedPtr(output), Object.GetUnmanagedPtr(input), ref view, Object.GetUnmanagedPtr(buffers));
#endif
        }
コード例 #2
0
 internal static extern void Internal_DrawPostFxMaterial2(IntPtr obj, IntPtr material, IntPtr output, IntPtr input, ref RenderView view, IntPtr buffers);
コード例 #3
0
        public void DrawScene(RenderTask task, RenderTarget output, RenderBuffers buffers, ref RenderView view, List <Actor> customActors = null, ActorsSources actorsSource = ActorsSources.ScenesAndCustomActors, HashSet <PostProcessEffect> customPostFx = null)
        {
#if UNIT_TEST_COMPILANT
            throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set.");
#else
            // Get unmanaged actors
            var actors = GetActors(customActors, out int actorsCount);

            // Get unmanaged postFx
            var postFx = GetPostFx(customPostFx, out int postFxCount);

            Internal_DrawScene(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), GetUnmanagedPtr(buffers), ref view, actors, actorsCount, actorsSource, postFx, postFxCount);
#endif
        }
コード例 #4
0
 internal static extern void Internal_DrawScene(IntPtr obj, IntPtr task, IntPtr output, IntPtr buffers, ref RenderView view, IntPtr[] customActors, int customActorsCount, ActorsSources actorsSource, IntPtr[] customPostFx, int customPostFxCount);
コード例 #5
0
ファイル: GPUContext.cs プロジェクト: klukule/FlaxAPI
        public void DrawScene(RenderTask task, RenderTarget output, RenderBuffers buffers, RenderView view, ViewFlags flags, ViewMode mode, Actor[] customActors = null, ActorsSources actorsSource = ActorsSources.ScenesAndCustomActors, HashSet <PostProcessEffect> customPostFx = null)
        {
#if UNIT_TEST_COMPILANT
            throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set.");
#else
            // Get unmanaged actors
            IntPtr[] actors      = null;
            int      actorsCount = 0;
            if (customActors != null)
            {
                actorsCount = customActors.Length;
                if (_cachedActors == null || _cachedActors.Length < actorsCount)
                {
                    _cachedActors = new IntPtr[Mathf.NextPowerOfTwo(actorsCount)];
                }
                actors = _cachedActors;

                for (int i = 0; i < actorsCount; i++)
                {
                    _cachedActors[i] = GetUnmanagedPtr(customActors[i]);
                }
            }

            // Get unmanaged postFx
            IntPtr[] postFx      = null;
            int      postFxCount = 0;
            if (customPostFx != null && customPostFx.Count > 0)
            {
                if (_cachedPostFxA == null)
                {
                    _cachedPostFxA = new List <PostProcessEffect>();
                }
                _cachedPostFxA.Capacity = Mathf.Max(_cachedPostFxA.Capacity, Mathf.NextPowerOfTwo(customPostFx.Count));

                foreach (var e in customPostFx)
                {
                    if (e && e.CanRender)
                    {
                        _cachedPostFxA.Add(e);
                    }
                }

                _cachedPostFxA.Sort(ComparePostFx);

                postFxCount = _cachedPostFxA.Count;
                if (_cachedPostFxB == null || _cachedPostFxB.Length < postFxCount)
                {
                    _cachedPostFxB = new IntPtr[_cachedPostFxA.Capacity];
                }
                postFx = _cachedPostFxB;

                for (int i = 0; i < postFxCount; i++)
                {
                    _cachedPostFxB[i] = GetUnmanagedPtr(_cachedPostFxA[i]);
                }

                _cachedPostFxA.Clear();
            }

            Internal_DrawScene(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), GetUnmanagedPtr(buffers), ref view, flags, mode, actors, actorsCount, actorsSource, postFx, postFxCount);
#endif
        }