Hacker News new | past | comments | ask | show | jobs | submit login
The Book of Shaders (thebookofshaders.com)
193 points by jashmenn on April 8, 2016 | hide | past | favorite | 15 comments



His editor is very good, live preview of shaders, colour pickers, sliders for scalars, breakpoints. Check it out here: http://editor.thebookofshaders.com


Which is the editor?


As a graphics programmer, I'm always a bit disappointed that materials on sharers tend to concentrate on fragment/pixel sharers and neglect vertex, geometry and tesselation shaders.

You can do pretty cool procedural stuff in a vertex shader (without any vertex data inputs). It's a necessity for animated models.

There's even less material on geometry and tesselation available.

This book seems to have rather nice pixel shading tricks but I'd like to see some stuff about the other stages too.


There are always (commercial) books like the "OpenGL 4.0 Shading Language Cookbook, the "OpenGL Programming Guide" or the "OpenGL SuperBible".


A useful previous discussion: https://news.ycombinator.com/item?id=9215582


You guys soul should check out this https://www.shadertoy.com


yeah, while you're at it check out inigo quilez's website, as he's (i think?) one of the founders of shadertoy. he's a graphics master. his website holds a ton of incredibly useful and interesting graphics techniques, a bunch of raymarching stuff, procedural generation techniques, etc. an absolute goldmine if you're into graphics, graphics-related math, demoscene, or anything of that ilk.

http://www.iquilezles.org/


http://shaderfrog.com/ is cool too, neat to visualize it right in the browser


I've got some OpenGL links on Github. There's a small section on Shaders. I added the above links: https://github.com/melling/ComputerGraphics/blob/master/open...


I'm a huge fan of http://shdr.bkcore.com since it lets me try out shaders in the same context I'm probably going to use them (on models as materials) with good old Suzanne, the blender monkey head.


This is amazing resource!

Though there is some unexpected behaviour on the site. After load, it always automatically scrolls down to the last editor window, as all editors seems to be selected on load. This is on Chrome Version 49.0.2623.110 (64-bit)


Can somebody explain to me the meaning of the variable names "st" and "pct" on this page[0]? I understand the code itself, but I can't puzzle out what the letters stand for.

[0]http://thebookofshaders.com/05/


"st" are texture coordinates, with "s" being the along the horizontal axis into the texture, and "t" being the vertical.

One major stumbling block with graphics is that you'll find lots of one letter names. "xyz" represents locations in the world, whereas "st" represents locations along a surface area. "uv" is also sometimes used for texture coordinates. There is a difference between them, but it's not interesting or relevant to a beginner. Just know that both are in use.

I would guess that "pct" is an abbreviation for "percent", given that it ranges from 0.0 to 1.0. It's definitely a poor choice of variable name.


I wish the book was already done! Not many secti9ns have been finished since I've last visited a year ago. :(


you are a godsend; this is so clear!




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

Search: