Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Could I kindly ask, to suggest me a repository of high quality OpenGL (OpenGL ES 2.0) vertex and fragment shaders, please?

I am looking for pixel based ligting shaders (such as phong) and simmilar. It would be nice to see more of them, to be able to choose between quality vs shader performance.

share|improve this question

closed as too broad by Josh Petrie Feb 15 at 3:56

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 16 down vote accepted

Shaders of any complexity aren't generally the kind of thing you can download and drop in to your project like interchangeable cogs. Typically the more interesting effects require a fair bit of coupling to the CPU-side rendering subsystem in order to achieve their results. The same is generally true of performance -- performance tradeoffs with respect to accuracy and quality over instruction count or pipelining tend to be rooted in application-specific requirements.

As a result there really isn't much in the way of the kind of repositories you are thinking of. The GPU Gems books offer a good collection of cookbook-style descriptions of techniques with both game and shaded code examples that you may want to take a look at, though. So do the Shader X books.

share|improve this answer
+1 for very valuable comment. Hi, Josh. Thanks for your response. Well, if a person is in the beginning of shader developement, it woud really help to see how some standard shaders are implemented: For example how Phong (which is very standard algorithm) is performed, pixel lighting shaders, etc.. I understand your point, and the sources you provided sound as a good material. I will take a look at them. So far, the best resources I have found are: OpenGL Shading Language book and the Lighthouse 3D site. – Bunkai.Satori May 14 '11 at 17:07
I would therefore still welcome repositories of good quality shaders, illustrating development of interesting effects. The scripts can be used as a basement for combining them and creating new attractive effects. – Bunkai.Satori May 14 '11 at 18:36
@Bunkai Satori I think Josh meant that as a reason that these sorts of repositories do not exist mostly. – The Communist Duck May 15 '11 at 20:53
@The Communist Duck: Hi, thanks for your comment. I understand that. I am grateful for every response here, and for Josh's one too. However, what came to my mind is, that internet is so large, that maybe somebody other than Josh will remember of seeing some places to get inspired by particular shaders. I can imagine, that a company/indidvidual using shaders a lot, would collect them, and some of them might also publish them. Josh's answer is my candidate for the Accepted Answer anyway, so if no one contributes shortly, I will close this thread my marking his answer. – Bunkai.Satori May 16 '11 at 13:13

Not much, but at least a couple of basic shaders to get started with can also be found between my open sorce engines files:

the .vsh files contain the vertex shaders and the .fsh files the fragment shaders, but I guess thats selfexplaining...

On current mobile hardware, you should do as much as possible within the vertex shader and the trick for great looking and fast games is to write many very specialized shaders doing always just exactly what is needed to make something look the way it is meant to. At least thats my experience with my iPhone 3GS, which features the same gpu as the iPhone 4 but has less pixels to do deliver data for. This is most probably already much better with tegra 2 and even better with apples A5 chip, but for now, this means that you should not try to port shaders for desktop gpus to mobile phones and expect a great performance :P This also means that fullscreen effects, especially on devices with a high resolution display tend to be slow.

Hope this also helps a bit :).

share|improve this answer
Hi, welcome to the GDSE. Nice answer! – Notabene May 16 '11 at 2:20
+1 for good answer. Hi Slin, and welcome to GDSE. Thank you for this good answer and for the example stuff. I am glad, you shared your experince with shaders programming for mobile platform. At this moment, I do all the development on PC, planning to port later. So your experience will be appreciated then. – Bunkai.Satori May 16 '11 at 13:16

might snatch some of the arcane knowledge from here

share|improve this answer
Hi UlanB. This collection looks great. Can you please tell me how i can download these shaders. I get a error saying "WebGL not supported" when i try to open any of the shader collection in chrome. Thank you. – Vinodtiru Dec 6 '11 at 22:46
Iam sorry, i can't really give you tech-support on webgl compatibility. Probably your Hardware that doesn't support webgl. Also Linux Chrome Builds don't support it yet. – UlanB Dec 10 '11 at 10:24

When I was looking how to implement fog under OpenGL ES 2.0, I have found link to OpenGL ES 2.0 backward compatible project implementing functionality, which is not in OpenGL ES 2.0, For example fog, per vertex, per fragment(pixel) shading. You can look directly into shaders source.

I have been implementing per fragment lighting too, modifying this example created by ClockworkCoders (not OpenGL ES 2.0).

You can also take a look on these great tutorials by lighthouse3D

share|improve this answer
+1 for good comment. Hi Martin, thanks for your links. yeah, I found Lighthouse3D, and it looks like quality resource. – Bunkai.Satori May 14 '11 at 15:59

The AMD RenderMonkey package contains very advanced shaders for OpenGL ES 2.0 among the sample files.

Take a look especially at the Renderman shader sample in the GLES samples directory, which provides a more-or-less bare-bones OpenGL ES 2.0 shader that might serve as a good starting point. And might also give you a good idea as to why there aren't many cut-and-paste examples of good shaders out there. The basic problem: that shaders are tightly coupled with OpenGL ES server configuration, and the models that get rendered on them. Still. The Renderman shader is an excellent starting point, if you can pry it loose from the REnderMonkey tool.

share|improve this answer

Take a look at GPUImage (, its probably the most complete collection of shaders I have found on the web so far. Since they are all designed to work with GPUImage, they all share the same structure, so if you adapt the same structure in your application/game you should be able to quickly import a number of different effects.


share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.