public void DrawShadow(GLFrameworkEngine.GLContext control, BfresRender parentRender) { var shadowRender = GLFrameworkEngine.GlobalShaders.GetShader("SHADOW"); control.CurrentShader = shadowRender; GL.Disable(EnableCap.CullFace); foreach (var mesh in this.Meshes) { if (!mesh.IsVisible || mesh.IsDepthShadow || mesh.IsCubeMap || !ModelData.Skeleton.Bones[mesh.BoneIndex].Visible) { continue; } //Set light space matrix // Matrix4 lightSpace = control.ShadowRenderer.getProjectionViewMatrix(); // shadowRender.SetMatrix4x4("lightSpaceMatrix", ref lightSpace); //Draw the mesh mesh.vao.Enable(shadowRender); mesh.Render(control, shadowRender); } GL.Enable(EnableCap.CullFace); GL.UseProgram(0); }
public void DrawDepthBuffer(GLFrameworkEngine.GLContext control, BfresRender parentRender) { if (disposed || !IsVisible) { return; } foreach (BfresMeshAsset mesh in this.Meshes) { if (!mesh.IsVisible || mesh.IsDepthShadow || mesh.IsCubeMap || mesh.UseColorBufferPass) { continue; } RenderMesh(control, mesh, 1); } control.CurrentShader = null; GL.Enable(EnableCap.DepthTest); GL.Disable(EnableCap.TextureCubeMapSeamless); GL.Disable(EnableCap.AlphaTest); GL.Disable(EnableCap.Blend); GL.Enable(EnableCap.CullFace); GL.CullFace(CullFaceMode.Back); GL.UseProgram(0); }
public void DrawShadowModel(GLFrameworkEngine.GLContext control, BfresRender parentRender) { if (disposed || !IsVisible) { return; } foreach (BfresMeshAsset mesh in this.Meshes) { if (!mesh.IsVisible || mesh.IsDepthShadow || mesh.IsCubeMap || mesh.UseColorBufferPass) { continue; } var lightSpaceMatrix = control.Scene.ShadowRenderer.GetLightSpaceMatrix(); var mtxMdl = this.ParentRender.Transform.TransformMatrix; control.CurrentShader.SetMatrix4x4("mtxMdl", ref mtxMdl); control.CurrentShader.SetMatrix4x4("lightSpaceMatrix", ref lightSpaceMatrix); DrawSolidColorMesh(control.CurrentShader, mesh); } }
public void Draw(GLContext context) { BoundingBoxRender.Draw(context, Min, Max); }
public virtual void OnBeforeDraw(GLContext context) { }
public virtual void Render(GLContext control, ShaderProgram shader) { }
public virtual void DrawCubeMapScene(GLContext control) { }
public virtual void DrawCaustics(GLContext control, GLTexture gbuffer, GLTexture linearDepth) { }
public virtual void DrawGBuffer(GLContext control) { }
public virtual void DrawShadowModel(GLContext control) { }
public virtual void DrawModel(GLContext control, Pass pass, Vector4 highlightColor) { }