{"id":19817177,"url":"https://github.com/nvpro-samples/gl_vrs","last_synced_at":"2025-09-18T06:32:51.538Z","repository":{"id":228709391,"uuid":"773615870","full_name":"nvpro-samples/gl_vrs","owner":"nvpro-samples","description":"Variable Rate Shading in OpenGL","archived":false,"fork":false,"pushed_at":"2024-03-20T03:35:07.000Z","size":975,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-11-12T10:12:10.451Z","etag":null,"topics":["opengl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvpro-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-18T04:41:54.000Z","updated_at":"2024-10-16T23:28:34.000Z","dependencies_parsed_at":"2024-03-20T04:48:52.343Z","dependency_job_id":null,"html_url":"https://github.com/nvpro-samples/gl_vrs","commit_stats":null,"previous_names":["nvpro-samples/gl_vrs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fgl_vrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fgl_vrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fgl_vrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fgl_vrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvpro-samples","download_url":"https://codeload.github.com/nvpro-samples/gl_vrs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233456040,"owners_count":18678965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opengl"],"created_at":"2024-11-12T10:11:55.514Z","updated_at":"2025-09-18T06:32:46.233Z","avatar_url":"https://github.com/nvpro-samples.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Variable Rate Shading\n\n![Two screenshots of this sample side by side. On the left, the sample renders 1000 tori. The shading rate for the blue tori decreases as the distance to the center increases; in the periphery, they are not rendered at all. The green tori, on the other hand, are always rendered at full (1x1) shading rate. On the right, the sample shows the shading rate per pixel.](doc/gl_vrs.png)\n\n## This sample shows the functionality of Variable Rate Shading\n\nVariable Rate Shading is a hardware feature introduced with the NVIDIA Turing GPUs and exposed via the GL_NV_shading_rate_image extension.\n\nVariable Rate Shading allows the hardware to shade primitives at a different frequency than the rate of rasterization. The user can pick between various rates, including no shading, normal resolution, half resolution and quarter resolution. If the rendering uses multi sampling, the shading rate can be increased to allow for multiple samples within the same primitive to be shaded. This can reduce shader generated aliasing. The shading rate is defined for blocks of pixels with a constant rate within each block.\n\n\n## Sample showing a reduced shading rate\n\nThe sample lets the user pick predefined shading rates. Checking \"visualizeShadingRate\" will show a color-coded image of the shading rate per pixel.\n\nIt is possible to vary the shading rate per triangle in the vertex shader; in the sample, all green objects are selected for full shading rate. This can be deactivated from the menu.\n\nAs the reduction in shading rate can be subtle, the sample allows rendering at a lower resolution and \"zooming in\" via the \"framebuffer scaling\" setting.\n\n\n#### Building\nIdeally, clone this and other interesting [nvpro-samples](https://github.com/nvpro-samples) repositories into a common subdirectory. You will always need [nvpro_core](https://github.com/nvpro-samples/nvpro_core). The nvpro_core is searched either as a subdirectory of the sample, or one directory up.\n\nIf you are interested in multiple samples, you can use the [build_all](https://github.com/nvpro-samples/build_all) CMake as the entry point; it will also give you options to enable/disable individual samples when creating the solution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvpro-samples%2Fgl_vrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvpro-samples%2Fgl_vrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvpro-samples%2Fgl_vrs/lists"}