We are aware that this fur is extremely underwhelming. We also realized that the low-poly style might not be the most appropriate for a fur shader. However, this feels like quite an accomplishment given the amount of debugging that it took to reach this point. It originally seemed like the geometry shader's work disrupted the depth buffer. This made it look like the light travelled between the pig's skin and its fur. This can be seen in the nacho shield image in the previous post. The bug also made fur from the other side of the body appear in some spots. It was all very weird. We eventually realized that we had forgotten to multiply our displacement vector by the projection and view matrices, meaning that it was in a different coordinate system.
We are using the shells-method of generating fur. The idea is that, although each strand of fur looks like a solid line, it is actually lots of flat dots stacked on top of each other. This is clearer when viewed from the side.
For every triangle on the pig, the geometry shader outputs 30 triangles, each one moved slightly in the direction of the normal vector. The fragment shader then colors in the same dots on each layer. From most angles, each strands of hair looks like a single cohesive unit, yet this method is a lot more efficient than say, rendering each strand of hair as an individual shape. Viewed from low angles, however, the layers can be seen and it looks really bad. This is why we are also planning to add a second technique called fins. This means that we render fur along the silhouette of the pig to cover up the holes.
Our first priority, though, is to make the shells a lot better. The spacing of the hairs is extremely temporary. We want to find some way to make it more random, yet somewhat evenly spaced. The strands should also have uneven lengths to look more natural. We also want the strands of hair to have a bit of sway, not pointing straight out as they do now. Finally, there should be some shadows on the individual strands of hair. We have simulated this by making the bottom layers darker than the outermost, but this can definitely be improved.
This week's bonus picture is a result from our debugging:
Inga kommentarer:
Skicka en kommentar