internal static void DrawSky(ref Camera camera) { var skybox = Game.Lighting.Skybox; var skyboxRO = Game.Workspace.RenderObjectProvider.SkyboxRO; SkyboxPass.Use(ref Context); var skyboxConstants = Game.Lighting.SkyboxConstantBuffer; skyboxConstants.Update(ref Context); Context.VertexShader.SetConstantBuffers(0, camera.Constants.Buffer, skyboxConstants.Buffer); lock (skybox) { Context.PixelShader.SetShaderResources(0, skybox.Cubemap?.Texture, skybox.Starfield); skyboxRO.Draw(ref Context, ref camera); } DepthStencilView dsv = camera.DepthStencilBuffer; if (dsv != null) { Context.ClearDepthStencilView(dsv, DepthStencilClearFlags.Depth, 1, 0); } }
public override void Create() { m_ScriptablePass = new SkyboxPass { renderPassEvent = injectionPoint, Scale = 1.0f / ratioScale, mask = mask }; }