Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Anyone have recommendations for resources for learning to write shaders?


I've always enjoyed watching The Art of Code[1], Freya[2] also has a good number of videos on it.

But that is just vertex shaders for things like Shadertoys.

There is much more to computer graphics or GPGPU than this though, Im still learning about that myself X).

[1] https://www.youtube.com/watch?v=eKtsY7hYTPg [2]https://www.youtube.com/watch?v=kfM-yu0iQBk


My experience with writing shaders (such as for physically based rendering) is that the shading languages (MSL, GLSL, HLSL) are easy to switch between. The hard part is understanding the physics and understanding how GPUs work internally.

My main approach to writing shaders is to look at existing programs (e.g. Blender) and see what techniques are in use. The Google Filament renderer documentation [0] is also really good when it comes to BDSF functions.

Some papers from Unreal Engine might also help, such as "Real Shading in Unreal Engine 4" [1]

[0] https://google.github.io/filament/Filament.md.html

[1] https://cdn2.unrealengine.com/Resources/files/2013SiggraphPr...


If you want to make nice looking materials and effects, you need a combination of good lighting (comes from the rendering engine, not the material), and artistic capabilities/talent. Art is a lot harder to teach than programming I feel, or at least I don't know how to teach it.

Programming the shaders themselves are pretty simple imo, they're just pure functions that return color data or triangle positions. The syntax might be a little different than you're used to depending on the shader language, but it should be easy enough to pick up in a day.

If you want to write compute shaders for computation, then it gets a lot more tricky and you need to spend some time learning about memory accesses, the underlying hardware, and profiling.



The book of shaders is fantastic:

http://www.thebookofshaders.com/


FYI apparently the www.* link doesn't actually have the menu for some reason? It's just the world graphic and a blank menu bar.

You need to visit http://thebookofshaders.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: