Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pouyakary/two-more-shaders
A Diffuse and A Phong Shader to complete my collection of hand made shaders :D
https://github.com/pouyakary/two-more-shaders
computer-graphics diffuse-shader glsl kary-comments phong-lighting phong-shader processing processing-graph reflection rendering shader
Last synced: 24 days ago
JSON representation
A Diffuse and A Phong Shader to complete my collection of hand made shaders :D
- Host: GitHub
- URL: https://github.com/pouyakary/two-more-shaders
- Owner: pouyakary
- Created: 2018-06-15T16:51:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T17:32:29.000Z (over 6 years ago)
- Last Synced: 2024-11-06T13:46:45.582Z (2 months ago)
- Topics: computer-graphics, diffuse-shader, glsl, kary-comments, phong-lighting, phong-shader, processing, processing-graph, reflection, rendering, shader
- Language: GLSL
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Diffuse and Phong Shaders
As 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:
![Pouya Kary's Phong and Diffuse Shaders in GLSL](https://user-images.githubusercontent.com/2157285/41479920-082bb6ba-70e2-11e8-8b59-1df9e32b1399.png)
## How to run them?
You should have [Processing](https://processing.org/) installed and then, all you need is to open the `pde` files and run them.## References
- Notes from [Dr. Purbenyamin](http://faculty.iauctb.ac.ir/a-purbenyamin-comp/en)'s Graphics II Class — Much of the work was made based on these notes.
- [Phong Shading Formula](http://www.cs.northwestern.edu/~ago820/SIG98/sig98_talk_web2/sld037.htm) — for the Formula of course (ends to be needless of `cos`)
- [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_ — I used this to find the best `Ks` and `n` values.
- [Illumination for Computer Generated Pictures](http://www.cs.northwestern.edu/~ago820/cs395/Papers/Phong_1975.pdf) — The original paper Dr. Bui Tuong Phong. Because you should always start from the origin.
- Apple Technical Report #43: [Phong Shading Reformulation for Hardware Renderer Simplification](http://dicklyon.com/tech/Graphics/Phong_TR-Lyon.pdf) — Although I ended up not using their idea, it was the most optimized way to go.