private void RenderShader(Action render, XMaterial material, Camera camera, LightSource[] lights) { using (new ProfilerEvent("Surface effect: Shader")) { Engine.State.FfpLighting = false; if (SurfaceShader != null) { using (new ProfilerEvent(() => "Apply " + SurfaceShader)) SurfaceShader.Apply(render, material, camera, lights); } } }
private SurfaceShader LoadSurfaceShader( string materialName ) { SurfaceShader shader = new SurfaceShader( this ); shader.Name = materialName; shader.BaseTextureName = materialName; try { shader.LoadTextures( pn3D.Device ); } catch { return null; } return shader; }