コード例 #1
0
ファイル: ScreenController.cs プロジェクト: MSylvia/disaster5
        public void Update()
        {
            drawScreen.Update();

            Raylib.BeginDrawing();
            Raylib.BeginTextureMode(renderTexture);
            Raylib.ClearBackground(Color.BLACK);

            Raylib.BeginMode3D(camera);

            ModelRenderer.RenderQueue();

            Raylib.EndMode3D();
            Raylib.EndTextureMode();

            Raylib.ClearBackground(Color.BLACK);


            Raylib.DrawTexturePro(
                renderTexture.texture,
                new Rectangle(0, 0, renderTexture.texture.width, -renderTexture.texture.height),
                new Rectangle(0, 0, 640, 480),
                Vector2.Zero,
                0,
                Color.RAYWHITE
                );

            drawScreen.Render();
            Raylib.EndDrawing();

            Debug.Label("swap window");
        }
コード例 #2
0
ファイル: ScreenController.cs プロジェクト: Sievaxx/disaster5
        public void Update()
        {
            drawScreen.Update();

            Raylib.BeginDrawing();

            Raylib.BeginTextureMode(renderTexture);
            Raylib.ClearBackground(Color.BLACK);
            Raylib.BeginMode3D(camera);
            ModelRenderer.RenderQueue();
            Raylib.EndMode3D();
            Raylib.EndTextureMode();

            Raylib.ClearBackground(Color.BLACK);
            //Console.WriteLine(renderTexture.depth.id);

            Raylib.BeginShaderMode(postProcessShader);
            Raylib.SetShaderValueTexture(postProcessShader, Raylib.GetShaderLocation(postProcessShader, "depthTexture"), renderTexture.depth);
            unsafe
            {
                Vector4 screenDims = new Vector4(screenWidth, screenHeight, windowWidth, windowHeight);
                IntPtr  pointer    = new IntPtr(&screenDims);
                Raylib.SetShaderValue(
                    postProcessShader,
                    Raylib.GetShaderLocation(postProcessShader, "screenSize"),
                    pointer,
                    ShaderUniformDataType.SHADER_UNIFORM_VEC4
                    );
            }

            Raylib.DrawTexturePro(
                renderTexture.texture,
                new Rectangle(0, 0, renderTexture.texture.width, -renderTexture.texture.height),
                new Rectangle(0, 0, windowWidth, windowHeight),
                Vector2.Zero,
                0,
                Color.WHITE
                );
            Raylib.EndShaderMode();
            drawScreen.Render();
            Rlgl.rlDrawRenderBatchActive();

            Raylib.EndDrawing();

            Debug.Label("swap window");
        }