public void Use() { UniformBuffer.Use(); if (!LockBlendState) { BlendState.Execute(); } if (!LockFaceCullState) { FaceCullState.Execute(); } if (!LockDepthState) { DepthState.Execute(); } if (!LockMaskState) { MaskState.Execute(); } if (!LockStencilState) { StencilState.Execute(); } if (RenderStack.Graphics.Configuration.useGl1) { GL.Material( MaterialFace.FrontAndBack, MaterialParameter.AmbientAndDiffuse, UniformBuffer.Floats("surface_diffuse_reflectance_color").Value ); GL.Material( MaterialFace.FrontAndBack, MaterialParameter.Specular, UniformBuffer.Floats("surface_specular_reflectance_color").Value ); float r = UniformBuffer.Floats("surface_roughness").Value[0]; float shininess = (1 - r) * 128.0f; GL.Material( MaterialFace.FrontAndBack, MaterialParameter.Shininess, shininess ); } }