- Aim: Here is what I am trying to do: imaging you have a print in your hands, and you view it straight under a light source. As you move and rotate it in all directions, the specular component affects what the colours of the image. I am trying to model this specular component _very_ accurately.
At the moment, I have written the code that displays an RGB image read from a file, and allows the user to view under all sorts of angle. The way I am doing this is by using texture mapping. More specifically, as textures can only be 2^m square (128x128 for my graphic card), I divide the original image into several quadrants, create a quad for each of them, and apply the corresponding texture (i.e. the corresponding area of the original image) on each of them. This all fast and good, but I am now moving onto the next stage.
- Question 1: I am now trying to implement the specular reflection. I know that OpenGL provide pre-defined models, but that is not good enough as I am aiming for high accuracy. So my question would be: what are the choices for implementation, and what is the best method in your opinion? [Please remark this is an open question by design, I have already started to look into this problem, but I phrased the question in this way not to impose any restrictions on the possible answers].
More specifially, I would need something that:
- allows me to use N light sources (especially situated in different locations, but could also be of different colours)
- is flexible, as several reflection models could be employed (Phong and co.)
Question 2: The research I've done on the topic made me think that shaders might be the solution I am looking for. Is is so?
However, I am by no means an expert, so I am rather confused as how this could be applied. From what I gathered, I believe there are two kind of shaders, vertex and pixel, so which one would be more suitable for the lighting operations I am trying to implement? And can they fit with the requirements I specified above, i.e. N light sources? Last but not least, does somebody know of tutorials or examples that illustrate this kind of operations?