private static void Postfix(SceneContext __instance)
        {
            SRGuu.OnGameLoaded(__instance);

            // ReSharper disable once ObjectCreationAsStatement
            new GameObject("SystemUpdater", typeof(SystemUpdater));
        }
Exemplo n.º 2
0
        public void Sphere()
        {
            SceneContext.AddActor(new Actor(new DirectionalLightComponent()
            {
                Name = "StaticLight",
                RelativeTranslation = new Vector3(-0.2f, -2.1f, 1.85f),
            }));

            Material material = new Material
            {
                DiffuseTexture  = Texture.GetFromFile("Textures/woodenbox.png"),
                SpecularTexture = Texture.GetFromFile("Textures/woodenbox_specular.png"),
                Ambient         = 0.5f,
                PipelineType    = PipelineType.Deferred,
            };

            SceneContext.AddActor(new Actor(new SphereComponent()
            {
                Name      = "Sphere1",
                Transform = GetTestTransform(),
                Material  = material,
            }));

            RenderAndCompare(nameof(Sphere));
        }
Exemplo n.º 3
0
        public void OnStart(SceneContext ec, Scene previous = null)
        {
            Console.WriteLine("start");
            Random r    = new Random();
            Entity test = null;
            //for (int i = 0; i < 5; i++)
            //{
            double x = r.Next(100);
            double y = r.Next(100);

            string           concat = "{'x':" + x + ",'y':" + y + ", 'type':'test', 'rotation':5,'material':{'type':'SimpleTexturedMaterial','textureName':'table'},'mesh':{'type':'QuadMesh','width':12.0,'height':8.0},attributes:[{'type':'ActorData','speed':1,'rotationspeed':20,'speedmultiplicator':1.2,'maxspeed':0.005}],behaviours:['MovementInputHandlerBehaviour']}";
            EntityDefinition asd    = JsonConvert.DeserializeObject <EntityDefinition>(concat);

            test = EntityFactory.Instance.Generate(asd);

            EntityFactory.Instance.GenerateByName("TEST_WEAPON", (float)x, (float)y + 5);



            //}
            InputConfig ic = InputConfig.Instance;
            Crosshair   ch = new Crosshair(
                new Axis[] { ic.MOUSE, ic.RIGHT_AXIS }, ic.LEFT_MOUSE, ic.RIGHT_MOUSE,
                test, this.worldManager.World)
            {
                CursorSensitivity = 10, CursorRange = 50, CursorSize = 5, CursorImage = ec.SceneResourceManager.GetTexture("crosshair")
            };

            this.camera.TrackingBody = ch.Sensor;

            ec.Hud.Add(ch);
            // test = EntityFactory.Instance.Generate(asd);
        }
Exemplo n.º 4
0
 public void RenderAlpha(SceneContext sc, CommandList cl, IRenderContext rc, Vector3 cameraLocation)
 {
     foreach (var child in _children.OrderByDescending(x => x.DistanceFrom(cameraLocation)))
     {
         child.RenderAlpha(sc, cl, rc, cameraLocation);
     }
 }
Exemplo n.º 5
0
 public void Render(SceneContext sc, CommandList cl, IRenderContext rc)
 {
     foreach (var child in _children)
     {
         child.Render(sc, cl, rc);
     }
 }
Exemplo n.º 6
0
    protected void DestroyAll()
    {
        // We need to use DestroyImmediate so that all the IDisposable's etc get processed immediately before
        // next test runs
        GameObject.DestroyImmediate(_sceneContext.gameObject);
        _sceneContext = null;

        var allRootObjects = new List <GameObject>();

        // We want to clear all objects across all scenes to ensure the next test is not affected
        // at all by previous tests
        // TODO: How does this handle cases where the test loads other scenes?
        for (int i = 0; i < SceneManager.sceneCount; i++)
        {
            allRootObjects.AddRange(
                SceneManager.GetSceneAt(i).GetRootGameObjects());
        }

        // We also want to destroy any objects marked DontDestroyOnLoad, especially ProjectContext
        allRootObjects.AddRange(ProjectContext.Instance.gameObject.scene.GetRootGameObjects());

        foreach (var rootObj in allRootObjects)
        {
            // Make sure not to destroy the unity test runner objects that it adds
            if (!_unityTestRunnerObjects.Contains(rootObj))
            {
                // Use DestroyImmediate for other objects too just to ensure we are fully
                // cleaned up before the next test starts
                GameObject.DestroyImmediate(rootObj);
            }
        }
    }
Exemplo n.º 7
0
        public void Box(TestCase test)
        {
            if (test.CompareWith != null)
            {
                Compare(nameof(Box), test, test.CompareWith);
            }
            else
            {
                Material material = new Material
                {
                    SpecularTexture = Texture.GetFromFile("Textures/woodenbox_specular.png"),
                    Ambient         = test.Ambient,
                    PipelineType    = test.Pipeline,
                };
                if (test.DiffuseSource == "Texture")
                {
                    material.DiffuseTexture = Texture.GetFromFile("Textures/woodenbox.png");
                }
                else
                {
                    material.Color = new Vector4(0, 1, 0, 1);
                }

                SceneContext.AddActor(new Actor(new DebugCubeComponent()
                {
                    Name      = "Box1",
                    Transform = GetTestTransform(),
                    Material  = material,
                }));

                RenderAndCompare(nameof(Box) + test.ToString());
            }
        }
Exemplo n.º 8
0
 public SceneContextRegistryAdderAndRemover(
     SceneContext sceneContext,
     SceneContextRegistry registry)
 {
     _registry     = registry;
     _sceneContext = sceneContext;
 }
Exemplo n.º 9
0
        public override void CreateDeviceObjects(GraphicsDevice gd, CommandList cl, SceneContext sc, ResourceScope scope)
        {
            if ((scope & ResourceScope.Map) == 0)
            {
                return;
            }

            var renderer = sc.Models.GetRenderer <SpriteModelRenderer>();

            var disposeFactory = new DisposeCollectorResourceFactory(gd.ResourceFactory, _disposeCollector);

            (var atlasImage, var vertexBuffers) = SPRResourceUtils.CreateSpriteAtlas(SpriteModel.SpriteFile, gd, disposeFactory, sc.TextureLoader);

            //TODO: disable mipmapping for certain sprites?
            var texture = sc.MapResourceCache.AddTexture2D(gd, disposeFactory, new ImageSharpTexture(atlasImage, true), $"{SpriteModel.Name}_atlas");

            VertexBuffers = vertexBuffers;

            IndexBuffer = SPRResourceUtils.CreateIndexBuffer(gd, disposeFactory);

            RenderColorBuffer = disposeFactory.CreateBuffer(new BufferDescription((uint)Marshal.SizeOf <Vector4>(), BufferUsage.UniformBuffer | BufferUsage.Dynamic));

            var view = sc.MapResourceCache.GetTextureView(gd.ResourceFactory, texture);

            ResourceSet = disposeFactory.CreateResourceSet(new ResourceSetDescription(
                                                               renderer.Layout,
                                                               sc.ProjectionMatrixBuffer,
                                                               sc.ViewMatrixBuffer,
                                                               sc.WorldAndInverseBuffer,
                                                               view,
                                                               sc.MainSampler,
                                                               sc.LightingInfoBuffer,
                                                               RenderColorBuffer));
        }
Exemplo n.º 10
0
    ////////////////////////////////////////////////////////////////

    void SetupParallaxLayers()
    {
        AssetDataCamera assetDataCamera = AssetManager.GetAssetData <AssetDataCamera>();
        SceneContext    context         = SceneContext.MetaContext();

        m_ParallaxCoreObject = new GameObject("~ ParallaxRenderer");
        m_ParallaxCoreObject.transform.parent = GameCore.Get().transform;

        for (int i = 0; i < assetDataCamera._ParallaxMaxLayers; i++)
        {
            GameObject parallaxObject = new GameObject("Layer " + i);
            parallaxObject.transform.parent = m_ParallaxCoreObject.transform;
            SpriteRenderer spriteRenderer = parallaxObject.AddComponent <SpriteRenderer>();
            spriteRenderer.sprite           = null;
            spriteRenderer.sortingLayerName = "Background";
            spriteRenderer.sortingOrder     = i;
            spriteRenderer.drawMode         = SpriteDrawMode.Tiled;
            spriteRenderer.tileMode         = SpriteTileMode.Continuous;

            ParallaxLayer layer = new ParallaxLayer()
            {
                Renderer     = spriteRenderer,
                DimensionsWS = Vector2.one
            };

            m_ParallaxLayers.Add(layer);
        }

        context.Unset();
    }
Exemplo n.º 11
0
        public void CreateDeviceObjects(GraphicsDevice gd, CommandList cl, SceneContext sc, ResourceScope scope)
        {
            var factory = new DisposeCollectorResourceFactory(gd.ResourceFactory, _disposeCollector);

            BonesBuffer = factory.CreateBuffer(new BufferDescription((uint)(Marshal.SizeOf <Matrix4x4>() * MDLConstants.MaxBones), BufferUsage.UniformBuffer | BufferUsage.Dynamic));

            RenderArgumentsBuffer = factory.CreateBuffer(new BufferDescription((uint)Marshal.SizeOf <StudioRenderArguments>(), BufferUsage.UniformBuffer | BufferUsage.Dynamic));

            TextureDataBuffer = factory.CreateBuffer(new BufferDescription((uint)Marshal.SizeOf <StudioTextureData>(), BufferUsage.UniformBuffer | BufferUsage.Dynamic));

            _sharedLayout = factory.CreateResourceLayout(new ResourceLayoutDescription(
                                                             new ResourceLayoutElementDescription("Projection", ResourceKind.UniformBuffer, ShaderStages.Vertex),
                                                             new ResourceLayoutElementDescription("View", ResourceKind.UniformBuffer, ShaderStages.Vertex),
                                                             new ResourceLayoutElementDescription("WorldAndInverse", ResourceKind.UniformBuffer, ShaderStages.Vertex),
                                                             new ResourceLayoutElementDescription("Bones", ResourceKind.UniformBuffer, ShaderStages.Vertex),
                                                             new ResourceLayoutElementDescription("RenderArguments", ResourceKind.UniformBuffer, ShaderStages.Vertex | ShaderStages.Fragment),
                                                             new ResourceLayoutElementDescription("TextureData", ResourceKind.UniformBuffer, ShaderStages.Vertex),
                                                             new ResourceLayoutElementDescription("Sampler", ResourceKind.Sampler, ShaderStages.Fragment),
                                                             new ResourceLayoutElementDescription("LightingInfo", ResourceKind.UniformBuffer, ShaderStages.Fragment)));

            TextureLayout = factory.CreateResourceLayout(new ResourceLayoutDescription(
                                                             new ResourceLayoutElementDescription("Texture", ResourceKind.TextureReadOnly, ShaderStages.Fragment)));

            var vertexLayouts = new[]
            {
                new VertexLayoutDescription(
                    new VertexElementDescription("Position", VertexElementSemantic.TextureCoordinate, VertexElementFormat.Float3),
                    new VertexElementDescription("TextureCoords", VertexElementSemantic.TextureCoordinate, VertexElementFormat.Float2),
                    new VertexElementDescription("Normal", VertexElementSemantic.Normal, VertexElementFormat.Float3),
                    new VertexElementDescription("VertexBoneIndex", VertexElementSemantic.TextureCoordinate, VertexElementFormat.UInt1),
                    new VertexElementDescription("NormalBoneIndex", VertexElementSemantic.TextureCoordinate, VertexElementFormat.UInt1))
            };

            for (var cullMode = CullBack; cullMode < CullModeCount; ++cullMode)
            {
                for (var maskMode = MaskDisabled; maskMode < MaskModeCount; ++maskMode)
                {
                    for (var additiveMode = AdditiveDisabled; additiveMode < AdditiveModeCount; ++additiveMode)
                    {
                        _pipelines[cullMode, maskMode, additiveMode] = CreatePipelines(
                            gd, sc, vertexLayouts, _sharedLayout, TextureLayout, factory,
                            cullMode == CullBack,
                            maskMode == MaskEnabled,
                            additiveMode == AdditiveEnabled);
                    }
                }
            }

            SharedResourceSet = factory.CreateResourceSet(new ResourceSetDescription(
                                                              _sharedLayout,
                                                              sc.ProjectionMatrixBuffer,
                                                              sc.ViewMatrixBuffer,
                                                              sc.WorldAndInverseBuffer,
                                                              BonesBuffer,
                                                              RenderArgumentsBuffer,
                                                              TextureDataBuffer,
                                                              sc.MainSampler,
                                                              sc.LightingInfoBuffer
                                                              ));
        }
Exemplo n.º 12
0
 public float RaycastDistance(Vector3 origin, Vector3 direction, float maxDistance = Mathf.Infinity)
 {
     return(RaycastDistance(origin, direction,
                            (1 << SceneContext.GetStaticForegroundLayer()) | (1 << SceneContext.GetDynamicForegroundLayer()),
                            maxDistance
                            ));
 }
Exemplo n.º 13
0
        public override void OpenSpritebatch(SceneContext context)
        {
            context.GraphicsDeviceManager.GraphicsDevice.Clear(Color.CornflowerBlue);

            context.GraphicsDeviceManager.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
            context.SpriteBatch.Begin(0, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, this.cam.View);
        }
Exemplo n.º 14
0
 public void CreateResources(SceneContext sc)
 {
     foreach (var child in _children)
     {
         child.CreateResources(sc);
     }
 }
Exemplo n.º 15
0
        public void Update(SceneContext c, GameTime gt)
        {
            foreach (Type t in this.behaviours)
            {
                EntityBehaviour eb = this.behaviourInstances[t];
                if (eb.IsEnabled)
                {
                    eb.Update(c, this, gt);
                }
            }

            foreach (Entity e in this.children)
            {
                e.Update(c, gt);
            }

            if (this.mesh != null)
            {
                this.mesh.Update(gt);
            }

            if (this.material != null)
            {
                this.material.Update(gt);
            }
        }
Exemplo n.º 16
0
        public void CreateDeviceObjects(GraphicsDevice gd, CommandList cl, SceneContext sc)
        {
            ResourceFactory factory = gd.ResourceFactory;

            _vertexBuffer      = factory.CreateBuffer(new BufferDescription(Vertices.SizeInBytes(), BufferUsage.VertexBuffer));
            _indexBuffer       = factory.CreateBuffer(new BufferDescription(Indices.SizeInBytes(), BufferUsage.IndexBuffer));
            _vertexBuffer.Name = "SpriteVertexBuffer";
            _indexBuffer.Name  = "SpriteIndexBuffer";
            cl.UpdateBuffer(_vertexBuffer, 0, Vertices);
            cl.UpdateBuffer(_indexBuffer, 0, Indices);

            if (_pipelines != null)
            {
                foreach (var pipeline in _pipelines)
                {
                    pipeline.Value.Dispose();
                }
            }

            var keys = new[]
            {
                new SpriteShaderKey(true, true),
                new SpriteShaderKey(true, false),
                new SpriteShaderKey(false, true),
                new SpriteShaderKey(false, false)
            };

            _perSpriteResourceLayout = factory.CreateResourceLayout(PerSpriteLayoutDescription);
            _pipelines = keys.ToDictionary(x => x, x => BuildPipeline(gd, sc, x));
            _disposeCollector.Add(_vertexBuffer, _indexBuffer, _perSpriteResourceLayout);
        }
Exemplo n.º 17
0
        void RunSingleTest()
        {
            if (string.IsNullOrEmpty(TestMethod))
            {
                Log.Error("No test method given!");
                EditorApplication.isPlaying = false;
                return;
            }

            Log.Info("Running single test '{0}'", TestMethod);

            var seperatorIndex    = TestMethod.IndexOf("/");
            var fixtureTypeName   = TestMethod.Substring(0, seperatorIndex);
            var fixtureMethodName = TestMethod.Substring(seperatorIndex + 1);

            var installer = gameObject.AddComponent <ZenjectIntegrationTestSingleInstaller>();

            installer.Fixture = GetComponentsInChildren <ZenjectIntegrationTestFixture>()
                                .Where(x => x.GetType().Name == fixtureTypeName).Single();

            installer.TestMethod = installer.Fixture.GetType()
                                   .GetMethods().Where(x => x.Name == fixtureMethodName).Single();

            var context = SceneContext.CreateComponent(gameObject);

            context.ParentNewObjectsUnderRoot = true;

            context.Installers = new List <MonoInstaller>()
            {
                installer
            };

            context.Run();
        }
Exemplo n.º 18
0
        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            var movingLight = SceneContext.GetActor("MovingLight")?.GetComponent <LightComponent>();

            if (movingLight != null)
            {
                movingLight.RelativeTranslation = new Vector3(LightTween.Value.X, LightTween.Value.Y, 2.0f);
            }

            var actt = SceneContext.GetActor("GroupActor1");

            if (actt != null)
            {
                var compp = actt.GetComponent <SceneComponent>("CompGroup1");
                compp.RelativeRotation = new Quaternion(0, 0, BoxTween.ScaledPosition);
            }

            if (CurrentMouseWorldPositionIsValid)
            {
                var cursor = SceneContext.GetActor("GroundCursor")?.RootComponent;
                if (cursor != null)
                {
                    cursor.RelativeTranslation = new Vector3(CurrentMouseWorldPosition.X, CurrentMouseWorldPosition.Y, cursor.RelativeTranslation.Z);
                }
            }
        }
Exemplo n.º 19
0
        public IEnumerator Setup()
        {
            if (firstTimeSetUpRan)
            {
                yield break;
            }

            // Extenject throws some exceptions during tests.
            LogAssert.ignoreFailingMessages = true;

            GameObject   context      = new GameObject();
            SceneContext sceneContext = context.AddComponent <SceneContext>();

            testObject = context.AddComponent <ConfigTestObject>();

            ConfigurationTestsInstaller installer = ScriptableObject.CreateInstance <ConfigurationTestsInstaller>();

            testConfiguration = ScriptableObject.CreateInstance <TestConfiguration>();
            testConfiguration.ConfigurationName = "TestConfig.cfg";

            installer.ConfigurationsToInstall =
                new ConfigurationScriptableHolder[] { testConfiguration };

            sceneContext.ScriptableObjectInstallers = new[] { installer };

            Object.Instantiate(context);

            yield return(new WaitForEndOfFrame());

            firstTimeSetUpRan = true;
        }
 public override void Update(SceneContext c, Entity e, GameTime gt)
 {
     if (this.shootAction.IsDown)
     {
         this.Shoot(c, e);
     }
 }
Exemplo n.º 21
0
 public override void Notify()
 {
     if (SceneContext.GetStateName().Equals("Select"))
     {
         SceneContext.GetState().Handle();
     }
 }
Exemplo n.º 22
0
    protected override void SetupScene()
    {
        // it's not required, but we should have a least one light.
        SceneContext.AddActor(new Actor(new PointLightComponent()
        {
            Name = "StaticLight",
            RelativeTranslation = new Vector3(2f, -2.5f, 3.25f),
        }));

        #region construct
        var sphere = Mesh.CreateSphere();

        var cylinder1 = Mesh.CreateCylinder(slices: 16);
        cylinder1.Scale(0.3f, 0.3f);
        cylinder1.Translate(new Vector3(0, 0, 0.05f));
        sphere.AddMesh(cylinder1, filterMaterialId: 0, newMaterialId: 1);

        var cylinder2 = Mesh.CreateCylinder();
        cylinder2.Scale(0.05f, 0.05f);
        cylinder2.Translate(new Vector3(0, 0, 0.3f));
        sphere.AddMesh(cylinder2, filterMaterialId: 0, newMaterialId: 2);
        #endregion

        var comp = new StaticMeshComponent(sphere)
        {
            Name = "Bomb",
            RelativeTranslation = new Vector3(0, 0, 0.55f),
            RelativeScale       = new Vector3(2),
            RelativeRotation    = new Vector3(0.15f, 0.15f, 0f).ToQuaternion(),
        };

        #region materials
        comp.AddMaterial(new Material
        {
            Color            = new Vector4(0.2f, 0.2f, 0.2f, 1),
            Ambient          = 0.5f,
            Shininess        = 64.0f,
            SpecularStrength = 1f,
        });

        comp.AddMaterial(new Material
        {
            Color            = new Vector4(0.1f, 0.1f, 0.1f, 1),
            Ambient          = 0.5f,
            Shininess        = 32.0f,
            SpecularStrength = 0.5f,
        });

        comp.AddMaterial(new Material
        {
            Color            = new Vector4(0.5f, 1 / 255f * 165 * 0.5f, 0, 1),
            Ambient          = 0.5f,
            Shininess        = 32.0f,
            SpecularStrength = 0.5f,
        });
        #endregion

        SceneContext.AddActor(new Actor(comp));
    }
Exemplo n.º 23
0
        public void Update(SceneContext c, GameTime gt)
        {
            if (!c.IsFlagSet(HudMouse.FLAG_SHOW_HUD_MOUSE))
            {
                return;
            }

            //  InputConfig ic = InputConfig.Instance;

            float dx = 0;
            float dy = 0;

            foreach (Axis a in this.listeningAxises)
            {
                if (a.WasMoved)
                {
                    dx = a.DX;
                    dy = a.DY;
                    break;
                }
            }

            //if (ic.RIGHT_AXIS.WasMoved)
            //{
            //    dx = ic.RIGHT_AXIS.DX;
            //    dy = ic.RIGHT_AXIS.DY;
            //}
            //else
            //{
            //    dx = ic.MOUSE.DX;
            //    dy = -ic.MOUSE.DY;
            //}

            this.Position -= new Vector2(dx, dy) * gt.ElapsedGameTime.Milliseconds * this.Sensitivity;

            if (Position.X < 0)
            {
                this.Position = new Vector2(0, this.Position.Y);
            }

            if (this.Position.Y < 0)
            {
                this.Position = new Vector2(this.Position.X, 0);
            }


            int w = c.GraphicsDeviceManager.GraphicsDevice.Viewport.Width;
            int h = c.GraphicsDeviceManager.GraphicsDevice.Viewport.Height;

            if (Position.X > w)
            {
                this.Position = new Vector2(w, this.Position.Y);
            }

            if (Position.Y > h)
            {
                this.Position = new Vector2(this.Position.X, h);
            }
        }
Exemplo n.º 24
0
 internal static void PreSceneLoad(SceneContext t)
 {
     if (Levels.isMainMenu())
     {
         return;
     }
     PreSaveGameLoaded?.Invoke(t);
 }
Exemplo n.º 25
0
 public override void Render(GraphicsDevice gd, CommandList cl, SceneContext sc, RenderPasses renderPass)
 {
     cl.SetVertexBuffer(0, _vb);
     cl.SetIndexBuffer(_ib, IndexFormat.UInt16);
     cl.SetPipeline(renderPass == RenderPasses.ReflectionMap ? _reflectionPipeline : _pipeline);
     cl.SetGraphicsResourceSet(0, _resourceSet);
     cl.DrawIndexed((uint)s_indices.Length, 1, 0, 0, 0);
 }
Exemplo n.º 26
0
 public override void Render(GraphicsDevice gd, CommandList cl, SceneContext sc, RenderPasses renderPass)
 {
     cl.SetPipeline(_pipeline);
     cl.SetGraphicsResourceSet(0, _resourceSet);
     cl.SetVertexBuffer(0, _vb);
     cl.SetIndexBuffer(_ib, IndexFormat.UInt16);
     cl.DrawIndexed(6, 1, 0, 0, 0);
 }
Exemplo n.º 27
0
 public ZenjectSceneLoader(
     [InjectOptional]
     SceneContext sceneRoot,
     ProjectKernel projectKernel)
 {
     _projectKernel  = projectKernel;
     _sceneContainer = sceneRoot == null ? null : sceneRoot.Container;
 }
Exemplo n.º 28
0
 public override void Render(GraphicsDevice gd, CommandList cl, SceneContext sc, RenderPasses renderPass)
 {
     cl.SetVertexBuffer(0, _vb);
     cl.SetIndexBuffer(_ib);
     cl.SetPipeline(_pipeline);
     cl.SetResourceSet(0, _resourceSet);
     cl.Draw((uint)s_indices.Length, 1, 0, 0, 0);
 }
Exemplo n.º 29
0
 public void Render(GraphicsDevice gd, CommandList cl, SceneContext sc, RenderPasses renderPass, IRenderable r)
 {
     cl.SetPipeline(_pipeline);
     cl.SetGraphicsResourceSet(0, sc.MainSceneViewResourceSet);
     cl.SetVertexBuffer(0, _vb);
     cl.SetIndexBuffer(_ib, IndexFormat.UInt16);
     cl.DrawIndexed(6, 1, 0, 0, 0);
 }
Exemplo n.º 30
0
 public override void Render(GraphicsDevice gd, CommandList cl, SceneContext sc, RenderPasses renderPass)
 {
     cl.SetPipeline(_pipeline);
     cl.SetGraphicsResourceSet(0, UseTintedTexture ? sc.DuplicatorTargetSet1 : sc.DuplicatorTargetSet0);
     cl.SetVertexBuffer(0, _vb);
     cl.SetIndexBuffer(_ib, IndexFormat.UInt16);
     cl.DrawIndexed(6, 1, 0, 0, 0);
 }
Exemplo n.º 31
0
 public Test1Screen()
 {
     sceneContext = new SceneContext(this);
     TransitionOnTime = TimeSpan.FromSeconds(1.5);
     TransitionOffTime = TimeSpan.FromSeconds(0.5);
 }