public static void DrawSkyBox(Matrix4 RotationMatrix) { GL.Enable(EnableCap.DepthTest); GL.DepthFunc(DepthFunction.Lequal); GL.Enable(EnableCap.CullFace); GL.CullFace(CullFaceMode.Front); GL.Enable(EnableCap.LineSmooth); GL.Enable(EnableCap.StencilTest); GL.StencilOp(StencilOp.Keep, StencilOp.Keep, StencilOp.Replace); SFGraphics.GLObjects.Shaders.Shader shader = OpenTKSharedResources.shaders["HDRSkyBox"]; shader.UseProgram(); // enable seamless cubemap sampling for lower mip levels in the pre-filter map. GL.Enable(EnableCap.TextureCubeMapSeamless); Matrix4 proj = Matrix4.Identity; shader.SetMatrix4x4("projection", ref proj); Matrix4 rot = RotationMatrix; shader.SetMatrix4x4("rotView", ref rot); // shader.SetTexture("environmentMap", diffusePbr, 16); DrawCube(); }
public void SetMaterialValues(NUD.Material nudMaterial, SFGraphics.GLObjects.Shaders.Shader shader) { var material = new GenericMaterial(); NudUniforms.SetMaterialPropertyUniforms(material, nudMaterial); material.SetShaderUniforms(shader); }
public void ShaderNotLinked() { var shader = new SFGraphics.GLObjects.Shaders.Shader(); Assert.AreEqual(-1, shader.GetUniformLocation("memes")); }