{"id":18497971,"url":"https://github.com/pouyakary/two-more-shaders","last_synced_at":"2025-06-21T23:38:10.537Z","repository":{"id":82963799,"uuid":"137511892","full_name":"pouyakary/two-more-shaders","owner":"pouyakary","description":"A Diffuse and A Phong Shader to complete my collection of hand made shaders :D","archived":false,"fork":false,"pushed_at":"2018-06-15T17:32:29.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T05:24:34.641Z","etag":null,"topics":["computer-graphics","diffuse-shader","glsl","kary-comments","phong-lighting","phong-shader","processing","processing-graph","reflection","rendering","shader"],"latest_commit_sha":null,"homepage":null,"language":"GLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pouyakary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2018-06-15T16:51:01.000Z","updated_at":"2018-06-15T17:32:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8d0f9e6-c63d-40e8-99b8-8786fea7407b","html_url":"https://github.com/pouyakary/two-more-shaders","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pouyakary/two-more-shaders","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouyakary%2Ftwo-more-shaders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouyakary%2Ftwo-more-shaders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouyakary%2Ftwo-more-shaders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouyakary%2Ftwo-more-shaders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pouyakary","download_url":"https://codeload.github.com/pouyakary/two-more-shaders/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouyakary%2Ftwo-more-shaders/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261211724,"owners_count":23125546,"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":["computer-graphics","diffuse-shader","glsl","kary-comments","phong-lighting","phong-shader","processing","processing-graph","reflection","rendering","shader"],"created_at":"2024-11-06T13:36:47.545Z","updated_at":"2025-06-21T23:38:05.518Z","avatar_url":"https://github.com/pouyakary.png","language":"GLSL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Diffuse and Phong Shaders\n\nAs you may probably know, I got crazy and [wrote a whole Gouraud Shader for CPU](https://github.com/pmkary/basic-gouraud-shader). Since then I wanted my shaders to be complete and so, using the power of GLSL and Processing these are the last two shaders one might need:\n\n![Pouya Kary's Phong and Diffuse Shaders in GLSL](https://user-images.githubusercontent.com/2157285/41479920-082bb6ba-70e2-11e8-8b59-1df9e32b1399.png)\n\n## How to run them?\nYou should have [Processing](https://processing.org/) installed and then, all you need is to open the `pde` files and run them.\n\n## References\n- Notes from [Dr. Purbenyamin](http://faculty.iauctb.ac.ir/a-purbenyamin-comp/en)'s Graphics II Class \u0026mdash; Much of the work was made based on these notes.\n- [Phong Shading Formula](http://www.cs.northwestern.edu/~ago820/SIG98/sig98_talk_web2/sld037.htm) \u0026mdash; for the Formula of course (ends to be needless of `cos`)\n- [The Phong Model, Introduction to the Concepts of Shader, Reflection Models and BRDF](http://www.scratchapixel.com/lessons/3d-basic-rendering/phong-shader-BRDF) from _Scratch A Pixel_ \u0026mdash; I used this to find the best `Ks` and `n` values.\n- [Illumination for Computer Generated Pictures](http://www.cs.northwestern.edu/~ago820/cs395/Papers/Phong_1975.pdf) \u0026mdash; The original paper Dr. Bui Tuong Phong. Because you should always start from the origin.\n- Apple Technical Report #43: [Phong Shading Reformulation for Hardware Renderer Simplification](http://dicklyon.com/tech/Graphics/Phong_TR-Lyon.pdf) \u0026mdash; Although I ended up not using their idea, it was the most optimized way to go.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpouyakary%2Ftwo-more-shaders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpouyakary%2Ftwo-more-shaders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpouyakary%2Ftwo-more-shaders/lists"}