|
Main /
ShadersOn this page... (hide) 1. Shaders and Shading LanguagesThe goal of this part of the class is to get you to think about using the graphics hardware by writing shaders (which will require you to learn a bit about a shading langauge, or two). Rather than doing long lectures in class, we'll try more of a "student directed learning" approach, where we'll let you play around more, and listen less. Also, the idea here is that you can figure out the basics yourself, and we'll use class time at the end of the assignment to learn about fancier stuff that people figured out. 2. ToolsWe recommend that you use the GLSL shading langauge, since its easier and we can recommend readings. However, if you want to use HLSL shading language (which is more common in the gaming industry), you can do that - you'll just be on your own. In fact, if you pick one shading language, we will FORCE you to look at another one! We strongly encourage you to use the "RenderMonkey" shader IDE (which is available on the CSL computers, or is available free from ATI). RednerMonkey lets you experiment with shaders without having to build up an C++ program to set up the universe. It does take a little getting used to. RenderMonkey works for both GLSL and HLSL, and has a ton of examples to look at. 3. Recommended ReadingsYou need to read about 2 things: 1) an overview of shaders and what they can do and how they do it, and 2) the nuts and bolts of using a specific, real, shading language to actually get your shaders on the screen.
These references are more general technical:
The following is an out of date description of rendermonkey (talking about doing assembly language programming with it). It does not count as one of your two readings, but you can flip through it since it might help give you some ideas as to how RenderMonkey works. 4. A note on terminologyIn the assignment, I refer to writing a "shader". Technically, you usually don't write one shader, you write at least 2 (a vertex shader and a fragment shader), and maybe more (one for each pass). Plus, very often with a shader, you also need to make textures and have some code logic to achieve the multi-pass drawing. So, when I say "write a shader" I really mean "write a set of shaders, and the accompanying other stuff that together achieves an effect." 5. A cautionary note...This assignment requires you to look at other people's code (tutorials, sample code, a shader to translate, ...) Remember to give proper attribution! 6. The AssignmentThis assignment has 3 small pieces, and an extra piece.
For each parts, you may turn in either a rendermonkey project file (be sure to include all the associated assets, such as models and textures), or a complete visual studio project with all the source code and everything we need to build and run it (including documentation). You may choose to do the assignment in GLSL or HLSL. All of your shaders must be in this language, and the language you choose to translate from (in 2) must be different). You must turn everything in to the TA by 1pm on Tuesday, April 24th. If your assignment isn't turned in by then, you will not be considered in the contest, and your grade will be penalized. There is a preliminary milestone: before class on Tuesday, April 17th you must send email to the TA describing your progress in writing the first shaders for part 1. You must attach a picture of the output of a shader that you wrote. It doesn't have to be complete, it just has to show us that you really have begun working on shading. Your list of cool shaders should also be started (and have at least 3 things on it) before class on April 17th. 6.1 Part 1 - Shading WarmupFor this part, we ask that you write a "shader" (really a set of shaders) that does the following:
If you prefer to turn in 2 different "shaders", that's OK (i.e. that uses the texture map, and one that uses procedural texturing). Remember, you must send your signs of life to the TA by April 17th. This part will be evaluated by seeing how completely you meet the requirements, as well as how interesting your shaders are (both technically and artistically). Your shader must work on both a simple object (a sphere) and complex objects. 6.2 Part 2 - Translating ShadersFor this assignment, you need to find some shader written in another shading language, and translate it to the shading language you have chosen to use. Here's a great source of a lot of HLSL and CG shaders ready to be translated to GLSL: This part will be evaluated by how well your shader works, and how complicated it is. If you translate a really complex shader (which would force you to figure it out), it will be worth more than a simpler one. The major shading languages are not that different. Once you've learned one, its easy to read another. You might need to read up a little on the second one. Note: the shading languages are similar enough that there are automatic translation programs. You shouldn't try to use one. The purpose here is for you to learn to read a second shading languages, and to look at a complex shader that someone else wrote. Be warned: a lot of shaders out there are not well documented, so you'll need to think through how they work. If you make simplifying assumptions on your shader, be sure to state them in your documentation. 6.3 Part 3 - The contestHere's your chance to make something cool - come up with the coolest shading effect you can think of! Your effect should work on a variety of geometry, but you can tell us what the assumptions are (be sure to give us at least a simple object and a complex object to test it on). Note: if your shader is a "full-screen" shader (e.g. it works to a screen aligned polygon that is the size of the screen), that is an OK special case. Be sure to explain We will give a prize to the most creative shader. We may give out more than 1 prize, and we might give out special prizes for technical and artistic merit, independent of creativity. In terms of evaluation, we will give your grade based on how creative and technically challenging your shader is (with an emphasis on the latter). Your documentation is also very important: you will need to explain your shader well. This will include describing it in an in-class presentation. 6.4 Part 4 - The Cool Ideas listMake a list of the coolest shaders that you come across while doing this assignment. We'll want to talk about them in class. You should make a Wiki page in your personal space with the list on it. Keep the list ordered by coolness (the coolest one at the top). Please put links to where these shaders came from if possible so we can check them out too. By April 17th, you should have at least 3 cool shaders listed. Send email to the TA with a link to your Wiki page. 6.5 What to turn inPrior to class (9:30) on Tuesday, April 17th: Send email to the TA with your signs of life of your own shader
(including a picture). Also, include a link to your cool shaders
list.
By the final deadline (April 24th, 1pm):
Before the deadline, you must send email to the TA explaining where all this stuff is. 6.6 CollaborationEveryone must do this assignment, and turn in their own work. You may discuss the assignment with others, and help each other out. 7. The Shader Jam SessionOne class (tentatively Thursday, April 26th), we will devote class to looking at people's shaders. Come to class prepared to explain your shaders. A jury (including the TA and instructor and some others) will pick a subset of the shaders as contest finalists. Each finalist will have 3-5 minutes to explain how their shader works to the class. Note: you must be in class on the Shader Jam Session day in order to win the contest. We will also pick some of the other shaders (from parts 1 and 2) for people to explain to class. |