Example #1
0
        public PipelineUniform TryGetUniform(string name)
        {
            PipelineUniform ret = null;

            Uniforms.TryGetValue(name, out ret);
            return(ret);
        }
Example #2
0
 public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, Matrix4 mat, bool transpose)
 {
     //GL.UniformMatrix4((int)uniform.Opaque, 1, transpose, (float*)&mat);
     GL.Uniform4((int)uniform.Sole.Opaque + 0, 1, (float *)&mat.Row0);
     GL.Uniform4((int)uniform.Sole.Opaque + 1, 1, (float *)&mat.Row1);
     GL.Uniform4((int)uniform.Sole.Opaque + 2, 1, (float *)&mat.Row2);
     GL.Uniform4((int)uniform.Sole.Opaque + 3, 1, (float *)&mat.Row3);
 }
Example #3
0
 public void SetPipelineUniform(PipelineUniform uniform, float value)
 {
     if (uniform.Owner == null)
     {
         return;                                    //uniform was optimized out
     }
     GL.Uniform1((int)uniform.Sole.Opaque, value);
 }
Example #4
0
        public void SetPipelineUniformSampler(PipelineUniform uniform, Texture2d tex)
        {
            int n = ((int)uniform.Sole.Opaque) >> 24;

            //set the sampler index into the uniform first
            if (sActiveTexture != n)
            {
                sActiveTexture = n;
                var selectedUnit = (TextureUnit)((int)TextureUnit.Texture0 + n);
                GL.ActiveTexture(selectedUnit);
            }

            //now bind the texture
            GL.BindTexture(TextureTarget.Texture2D, (int)tex.Opaque);
        }
Example #5
0
		public unsafe void SetPipelineUniform(PipelineUniform uniform, Vector4[] values)
		{
			if (uniform.Owner == null) return; //uniform was optimized out
			var v = new global::SlimDX.Vector4[values.Length];
			for (int i = 0; i < values.Length; i++)
				v[i] = values[i].ToSlimDXVector4();
			foreach (var ui in uniform.UniformInfos)
			{
				var uw = ui.Opaque as UniformWrapper;
				uw.CT.SetValue(dev, uw.EffectHandle, v);
			}
		}
Example #6
0
		public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose)
		{
			if (uniform.Owner == null) return; //uniform was optimized out

			foreach (var ui in uniform.UniformInfos)
			{
				var uw = ui.Opaque as UniformWrapper;
				uw.CT.SetValue(dev, uw.EffectHandle, mat.ToSlimDXMatrix(!transpose));
			}
		}
Example #7
0
		public void SetPipelineUniformSampler(PipelineUniform uniform, Texture2d tex)
		{
			int n = ((int)uniform.Sole.Opaque)>>24;

			//set the sampler index into the uniform first
			if (sActiveTexture != n)
			{
				sActiveTexture = n;
				var selectedUnit = (TextureUnit)((int)TextureUnit.Texture0 + n);
				GL.ActiveTexture(selectedUnit);
			}

			//now bind the texture
			GL.BindTexture(TextureTarget.Texture2D, (int)tex.Opaque);
		}
Example #8
0
		public void SetPipelineUniform(PipelineUniform uniform, float value)
		{
			if (uniform.Owner == null) return; //uniform was optimized out
			GL.Uniform1((int)uniform.Sole.Opaque, value);
		}
Example #9
0
		public void SetPipelineUniform(PipelineUniform uniform, Vector4 value)
		{
			GL.Uniform4((int)uniform.Sole.Opaque, value.X, value.Y, value.Z, value.W);
		}
Example #10
0
 public void SetPipelineUniform(PipelineUniform uniform, Vector4 value)
 {
     GL.Uniform4((int)uniform.Sole.Opaque, value.X, value.Y, value.Z, value.W);
 }
Example #11
0
 public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose)
 {
 }
Example #12
0
		public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose)
		{
			fixed(Matrix4* pMat = &mat)
				GL.UniformMatrix4(uniform.Id.ToInt32(), 1, transpose, (float*)pMat);
		}
Example #13
0
		public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, Matrix4 mat, bool transpose)
		{
			GL.UniformMatrix4(uniform.Id.ToInt32(), 1, transpose, (float*)&mat);
		}
Example #14
0
		public void SetPipelineUniform(PipelineUniform uniform, bool value)
		{
			GL.Uniform1(uniform.Id.ToInt32(), value ? 1 : 0); 
		}
Example #15
0
 public unsafe void SetPipelineUniform(PipelineUniform uniform, Vector4[] values)
 {
     fixed(Vector4 *pValues = &values[0])
     GL.Uniform4((int)uniform.Sole.Opaque, values.Length, (float *)pValues);
 }
Example #16
0
 public void SetPipelineUniform(PipelineUniform uniform, Vector2 value)
 {
     GL.Uniform2((int)uniform.Sole.Opaque, value.X, value.Y);
 }
Example #17
0
 public void SetPipelineUniform(PipelineUniform uniform, bool value)
 {
 }
Example #18
0
 public void SetPipelineUniformSampler(PipelineUniform uniform, Texture2d tex)
 {
 }
Example #19
0
 public void SetPipelineUniform(PipelineUniform uniform, float value)
 {
 }
Example #20
0
		public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, Matrix4 mat, bool transpose)
		{
			//GL.UniformMatrix4((int)uniform.Opaque, 1, transpose, (float*)&mat);
			GL.Uniform4((int)uniform.Sole.Opaque + 0, 1, (float*)&mat.Row0);
			GL.Uniform4((int)uniform.Sole.Opaque + 1, 1, (float*)&mat.Row1);
			GL.Uniform4((int)uniform.Sole.Opaque + 2, 1, (float*)&mat.Row2);
			GL.Uniform4((int)uniform.Sole.Opaque + 3, 1, (float*)&mat.Row3);
		}
Example #21
0
		public void SetPipelineUniform(PipelineUniform uniform, Vector4 value)
		{
			GL.Uniform4(uniform.Id.ToInt32(), value.X, value.Y, value.Z, value.W);
		}
Example #22
0
 public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose)
 {
     fixed(Matrix4 *pMat = &mat)
     GL.UniformMatrix4((int)uniform.Sole.Opaque, 1, transpose, (float *)pMat);
 }
Example #23
0
		public void SetPipelineUniform(PipelineUniform uniform, bool value)
		{
			GL.Uniform1((int)uniform.Sole.Opaque, value ? 1 : 0); 
		}
Example #24
0
		public void SetPipelineUniform(PipelineUniform uniform, Vector2 value)
		{
			GL.Uniform2(uniform.Id.ToInt32(), value.X, value.Y);
		}
Example #25
0
		public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose)
		{
			fixed(Matrix4* pMat = &mat)
				GL.UniformMatrix4((int)uniform.Sole.Opaque, 1, transpose, (float*)pMat);
		}
Example #26
0
		public void SetPipelineUniform(PipelineUniform uniform, float value)
		{
			GL.Uniform1(uniform.Id.ToInt32(), value);
		}
Example #27
0
		public void SetPipelineUniform(PipelineUniform uniform, Vector2 value)
		{
			GL.Uniform2((int)uniform.Sole.Opaque, value.X, value.Y);
		}
Example #28
0
		public unsafe void SetPipelineUniform(PipelineUniform uniform, Vector4[] values)
		{
			fixed (Vector4* pValues = &values[0])
				GL.Uniform4(uniform.Id.ToInt32(), values.Length, (float*)pValues);
		}
Example #29
0
		public unsafe void SetPipelineUniform(PipelineUniform uniform, Vector4[] values)
		{
			fixed (Vector4* pValues = &values[0])
				GL.Uniform4((int)uniform.Sole.Opaque, values.Length, (float*)pValues);
		}
Example #30
0
		public void SetPipelineUniformSampler(PipelineUniform uniform, IntPtr texHandle)
		{
			//set the sampler index into the uniform first
			//now bind the texture
			if(sActiveTexture != uniform.SamplerIndex)
			{
				sActiveTexture = uniform.SamplerIndex;
				var selectedUnit = (TextureUnit)((int)TextureUnit.Texture0 + uniform.SamplerIndex);
				GL.ActiveTexture(selectedUnit);
			}
			GL.BindTexture(TextureTarget.Texture2D, texHandle.ToInt32());
		}
Example #31
0
		public void SetPipelineUniformSampler(PipelineUniform uniform, Texture2d tex)
		{
	
		}
Example #32
0
 public void SetPipelineUniform(PipelineUniform uniform, bool value)
 {
 }
Example #33
0
		public void SetPipelineUniform(PipelineUniform uniform, float value)
		{
			if (uniform.Owner == null) return; //uniform was optimized out
			foreach (var ui in uniform.UniformInfos)
			{
				var uw = ui.Opaque as UniformWrapper;
				uw.CT.SetValue(dev, uw.EffectHandle, value);
			}
		}
Example #34
0
 public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose)
 {
 }
Example #35
0
		public void SetPipelineUniformSampler(PipelineUniform uniform, Texture2d tex)
		{
			if (uniform.Owner == null) return; //uniform was optimized out
			var tw = tex.Opaque as TextureWrapper;

			foreach (var ui in uniform.UniformInfos)
			{
				var uw = ui.Opaque as UniformWrapper;
				dev.SetTexture(uw.SamplerIndex, tw.Texture);

				dev.SetSamplerState(uw.SamplerIndex, SamplerState.AddressU, tw.WrapClamp);
				dev.SetSamplerState(uw.SamplerIndex, SamplerState.AddressV, tw.WrapClamp);
				dev.SetSamplerState(uw.SamplerIndex, SamplerState.MinFilter, tw.MinFilter);
				dev.SetSamplerState(uw.SamplerIndex, SamplerState.MagFilter, tw.MagFilter);
			}
		}
Example #36
0
 public void SetPipelineUniform(PipelineUniform uniform, Vector2 value)
 {
 }
Example #37
0
 public void SetPipelineUniform(PipelineUniform uniform, Vector2 value)
 {
 }
Example #38
0
 public void SetPipelineUniform(PipelineUniform uniform, float value)
 {
 }
Example #39
0
 public unsafe void SetPipelineUniform(PipelineUniform uniform, Vector4[] values)
 {
 }
Example #40
0
 public unsafe void SetPipelineUniform(PipelineUniform uniform, Vector4[] values)
 {
 }
Example #41
0
 public void SetPipelineUniformSampler(PipelineUniform uniform, IntPtr texHandle)
 {
 }
Example #42
0
 public void SetPipelineUniform(PipelineUniform uniform, bool value)
 {
     GL.Uniform1((int)uniform.Sole.Opaque, value ? 1 : 0);
 }