Beispiel #1
0
 public override void UpdateUniforms(Matrix4 view, Entity entity)
 {
     if (entity is Light)
         UpdateUniforms(view, (Light) entity);
 }
Beispiel #2
0
 public override void UpdateUniforms(Matrix4 view, Entity entity)
 {
     if (_viewMatrix >= 0)
         GL.UniformMatrix4(_viewMatrix, false, ref view);
     if (_modelMatrix >= 0)
     {
         var t = entity.Transform;
         GL.UniformMatrix4(_modelMatrix, false, ref t);
     }
     if (_modelRotationMatrix >= 0)
     {
         var t = entity.RotationMatrix;
         GL.UniformMatrix4(_modelRotationMatrix, false, ref t);
     }
     if (_modelViewMatrix >= 0)
     {
         var modelView = entity.Transform;
         if (!(entity is FullScreenQuad))
             modelView *= view;
         GL.UniformMatrix4(_modelViewMatrix, false, ref modelView);
     }
     if (_colorTexture >= 0)
         GL.Uniform1(_colorTexture, 2);
 }
Beispiel #3
0
 public virtual void UpdateUniforms(Matrix4 view, Entity entity)
 {
 }
Beispiel #4
0
 public override void UpdateUniforms(Matrix4 view, Entity entity)
 {
     if (_viewMatrix >= 0)
         GL.UniformMatrix4(_viewMatrix, false, ref view);
     if (_modelMatrix >= 0)
     {
         var t = entity.Transform;
         GL.UniformMatrix4(_modelMatrix, false, ref t);
     }
     if (_modelRotationMatrix >= 0)
     {
         var t = entity.RotationMatrix;
         GL.UniformMatrix4(_modelRotationMatrix, false, ref t);
     }
     if (_modelViewMatrix >= 0)
     {
         Matrix4 modelView;
         if (entity is FullScreenQuad)
             modelView = (entity as FullScreenQuad).Transform;
         else
             modelView = entity.Transform * view;
         GL.UniformMatrix4(_modelViewMatrix, false, ref modelView);
     }
     if (_texture >= 0)
     {
         GL.ActiveTexture(TextureUnit.Texture0);
         GL.BindTexture(TextureTarget.Texture2D, TextureLibrary.GetTexture(entity.TextureName));
         GL.Uniform1(_texture, 0);
     }
 }