I’m currently working on a real-time fabric rendering shader for my dissertation as part of my Honors degree. For this project, I found a couple of existing fabric rendering approach, implemented and modified one of them in GLSL for my purpose. You can find my survey for real-time fabric rendering techniques in here.
This shader is a proceudral shader, which means that a variety of weaving patterns can be rendered by simply changing a few input parameters. Just to give a brief overview, this approach uses a yarn-based anisotropic shading approach with Ashikhmin’s BRDF model, which is different to many existing approaches that tried to apply shading to the entire object.
The early version of my shader suffered from heavy anti-aliasing, and it took me some time before finding out that the conventional popular AA methods like MSAA, MLAA, and MSAA have very little effects on procedural shader aliasing. Nevertheless, I will show some earlier images of the shader here, and I’ll leave other images for the next post :P.
The image below shows my rendering results and the UI I made for tweaking the shader. Finding a light-weight UI library was quite difficult for OpenGL, and I simply didn’t have time to implement everything from scratch, but after using GLUI, I’d say it’s one of the easiest UI library to integrate, especially I used GLUT for my project. I also integrated my SSAO shader into this work, which improved the rendering results a bit with the inclusion of ambient occlusion.
The image below simply shows the difference between two dresses with different anisotropic levels, such that the one on the right with much higher “x” value than the one on the left. If you understand Ashikhmin BRDF, then you know what I’m on about, I’ll probably make a post about it since it’s a very nice microfacet BRDF. You can also see there’s some aliasing on the surface of the fabrics, but this is reduced a lot in later iterations of my shader.
Lastly, a comparison of fabrics with the same model and texture but with different weaving patterns and different anisotropy.