Friday, May 9, 2008
Sorting Issue........
We initially studied the Bitonic sort for our application and had plans to implement the same. But eventually could do away with it by using glDepthMask since we where using CUDA in contrast to Cg which is used by the author as mentioned in the paper.
Filtering Issue
We used the Sobel edge detection filter to generate the required silhouette. We used Cg to implement Sobel filter rather than using CUDA. We are using glPoints to draw the hair strands and the size of these points depends on the size specified using glPointSize. Thus it is difficult to estimate the area around the points. Also, OpenGL does not provide for a functionality wherein you could read the RGB values of a pixel, thus making it difficult to implement the filter in CUDA since we would be required to map the pixels. On the other hand by using Cg you just need to write the OpenGL output to the fragment shader where you will have a texture which is not required to be mapped and thus the Sobel masks can be directly applied to this texture.
We would have faced similar problem while applying any other filter such as DOG in CUDA. Since Sobel edge detection filter did not give very convincing result for our application, we had planned to implement the LOG filter which might have given better results. But due to time constraints we could not eventually do so.
We would have faced similar problem while applying any other filter such as DOG in CUDA. Since Sobel edge detection filter did not give very convincing result for our application, we had planned to implement the LOG filter which might have given better results. But due to time constraints we could not eventually do so.
Implementation issues
We had certain issues with the paper especially regarding the diffuse shading and specular highlights. The paper had no information regarding the ambient light(or that is what we presume they use) that they use to illuminate the inside part of the hair. We just added a small amount of ambient light and converted the negative light intensity to positive.
We faced a couple of problems in implementing the specular highlights as well. First of all enough information was not given on how the points that make up the triangle strip are generated from the group of points. At one point they say they use a user defined distance value between points and at another time they talk about specular threshold value. We solved this problem by using the first group of sequential points having specular values higher than user specified threshold. We then simply take their average. Instead of building a triangle strip we build a quad using the first two points from the first two strands and the last two points from the last two strands. This gave us our second problem: squishing of the texture. Since the texture was drawn in full resolution of 512 * 512 when we map it to a quad on the hair the texture gets compressed loses its shape and looks only like a white strip. Lastly we seem to be having one vertex of the quad strip sometimes at the origin thereby causing distortion. We did not really get the time to identify or solve this issue.
We faced a couple of problems in implementing the specular highlights as well. First of all enough information was not given on how the points that make up the triangle strip are generated from the group of points. At one point they say they use a user defined distance value between points and at another time they talk about specular threshold value. We solved this problem by using the first group of sequential points having specular values higher than user specified threshold. We then simply take their average. Instead of building a triangle strip we build a quad using the first two points from the first two strands and the last two points from the last two strands. This gave us our second problem: squishing of the texture. Since the texture was drawn in full resolution of 512 * 512 when we map it to a quad on the hair the texture gets compressed loses its shape and looks only like a white strip. Lastly we seem to be having one vertex of the quad strip sometimes at the origin thereby causing distortion. We did not really get the time to identify or solve this issue.
Final Output and few implementation issues......
At last we are done with the project and the final result was good. They are quite close to the output achieved by the author in the paper. We would have liked more time to implement certain things like different types of specular highlights and to make it more user interactive. But overall we are satisfied with the result.
Their result:

Our Result:
Their result:

Our Result:

Sunday, May 4, 2008
Friday, May 2, 2008
Ok..so while Mitesh had been working on the diffuse shading for the hair I concentrated on the specular part of the hair.In the original paper specular highlights was done entirely on cpu.I have been able to parallelize that to some extent but due to the data dependency it cannot be fully parallelized.I have understood how the algorithm for specular works for this model and will publish the results soon.
-chitranjan
-chitranjan
Subscribe to:
Posts (Atom)
