PA 2 FAQ
- Q: The assignment PDF for PA2B did not have any images. Can you give us examples of what our results should look like?
- A: Yes. Here is what the texture shader of problem 3 looks like on the sphere (coarse and fine tesselation), the cylinder (coarse and fine tesselation), and the torus (coarse and fine tesselation). For the fire shader of problem 3, here are four frames to show you what the shader looks like in motion. Finally, enabling mip-mapping should take the checkerboard in problem 4 from heavily aliased to smooth.
- Q: Eclipse isn't syntax-highlighting the .vp and .fp shader source files. How can I edit these files with syntax highlighting?
- A1: Using Eclipse:
The following has been tested with Eclipse Indigo and Juno.
- Download the Eclipse Shaders plugin.
- Locate your Eclipse install's "dropins" folder (e.g. "C:\Program Files\eclipse\dropins" on Windows, or "/Applications/eclipse/dropins/" on OS X).
- Copy the "features" and "plugins" folders from the Eclipse Shaders zip into the "dropins" folder.
- Open (or restart) Eclipse to import the plugin.
- If you've done it right, text files with .vp and .fp will be syntax highlighted.
- A2: Using Vim:
The following has been tested under Ubuntu Linux.
- Download the glsl.vim syntax file here.
- Put the file in your $HOME/.vim/syntax folder (create folder if not already present).
Add the following to your .vimrc:
au BufNewFile,BufRead *.vs,*.fs,*.vert,*.frag,*.vp,*.fp setlocal filetype=glsl
- The shader files in PA2A/PA2B should now be syntax highlighted in Vim.
- A3: Using Notepad++:
The following has NOT BEEN TESTED by the TAs. If you try this, please let us know how it works out.
A syntax-highlighting file and instructions are provided here.
- Q: I saw that gl_LightSource has a member variable named halfVector. Are we allowed to use this?
- A: No. You wouldn't want to, either — it turns out that the value that GLSL puts in this vector is calculated differently from the lighting equations we ask you to implement.