예제 #1
0
 public override void OnApplyUniforms(RenderQueue renderQueue, GameCamera camera)
 {
     renderQueue.SetUniform(ShaderId, "model", model);
     renderQueue.SetUniform(ShaderId, "view", camera.ViewMatrix);
     renderQueue.SetUniform(ShaderId, "proj", camera.ProjMatrix);
     renderQueue.SetUniform(ShaderId, "lightdir", new Vector3(1, 1, 1));
     renderQueue.SetUniform(ShaderId, "viewpos", camera.Position);
 }
예제 #2
0
        public override void OnApplyUniforms(RenderQueue renderQueue, GameCamera camera)
        {
            renderQueue.SetUniform(this.ShaderId, "model", camera.WorldMatrix); // Should be identity

            renderQueue.SetUniform(ShaderId, "view", camera.ViewMatrix);
            renderQueue.SetUniform(ShaderId, "proj", camera.ProjMatrix);
            renderQueue.SetUniform(ShaderId, "viewpos", camera.Position);
            renderQueue.SetUniform(ShaderId, "lightdir", new Vector3(-1, 1, -1));
        }
예제 #3
0
        public override void OnApplyUniforms(RenderQueue renderQueue, GameCamera camera)
        {
            // TODO We are doing a lot of binds that do not need be be done everytime we
            // Render one of these cubes. So we should put some smarts into the render queue
            // at some stage to not needing to do all these rebinds.

            // Simple solution at some stage would be to create a renderObjectSet to inherit from

            // But also at some stage look at doing instanced rendering and dynamic/static batching...

            // This is once per set of this render object
            renderQueue.SetUniform(this.ShaderId, "texture1", 0);
            renderQueue.SetUniform(this.ShaderId, "texture2", 1);
            renderQueue.SetUniform(this.ShaderId, "view", camera.ViewMatrix);
            renderQueue.SetUniform(this.ShaderId, "proj", camera.ProjMatrix);

            // This is per instance of this render object
            renderQueue.SetUniform(this.ShaderId, "model", m_Model);
        }
예제 #4
0
 public override void OnApplyUniforms(RenderQueue renderQueue, GameCamera camera)
 {
     renderQueue.SetUniform(ShaderId, "view", camera.GetLookAtMatrix());
     renderQueue.SetUniform(ShaderId, "proj", camera.ProjMatrix);
     renderQueue.SetUniform(ShaderId, "skybox", 0);
 }
예제 #5
0
 public override void OnApplyUniforms(RenderQueue renderQueue, GameCamera camera)
 {
     renderQueue.SetUniform(this.ShaderId, "model", Matrix4.Identity);
     renderQueue.SetUniform(this.ShaderId, "view", camera.ViewMatrix);
     renderQueue.SetUniform(this.ShaderId, "proj", camera.ProjMatrix);
 }