RSL Slim Patterns

THE INSPIRATION

The inspiration for the phylotactic pattern came from Prof Fowler’s Houdini class. In that class we were given the formula for the pattern and we had to derive the code from it. Since, I had done that already I had no problem in converting the pattern into RSL. What the pattern was intended to do was create a shader for the lychee fruit. But then realizing that the phylotactic pattern doesn’t really work on this well I decided to go for a strawberry. The phyllotactic pattern works very well for a strawberry so was able to satisfy the requirements. I then decided to do the lychee as well and tried to use the vornoi pattern to get something close.

mackmyra-4 strawberry

 

Left : Lychee || Right: Strawberry

THE SETUP

Following Ding’s advise to light the scene before shading it , I prepared a small light rig using maya’s area light with the soft shadow feature enabled. I also got some reflections baked out of my environment map too. This really bolstered the look of my shader.
lighting setup

PhylLotactic pattern

THe phylotactic pattern is always considered a mysterious and yet marvelous pattern existing in the world around us. Our endeavors to find pattern even in chaos leads to some complex yet beautiful mathematics. Fortunately, this pattern isn’t very difficult at all. The most interesting thing about the pattern is that it works on a specific angle which is based on the golden ratio of ~1.618. To learn more about it visit here.

spiral11

Hence this spiral created is found to be the ratio at which some of the plant seeds and pettles grow. What is also facinating is that its not a new concept. The Greeks used it in their buildings and so did the egyptians in their pyramid.

Since, textures are based on a 2D layout, we use the planar model of this pattern to create the pattern. To find out more indept in the creation of the formula read this. In the pattern the angle of divergence is fixed to ~137.5 degrees. We basically use the equation of the circle with a changing radius and static divergent angle to create this pattern.

phylotacticpattern StrawberrySlimNode

So once we have the pattern we then go into the slim network (right image) to get our strawberry just right. This time I decided to go for the look development of the shader. I randomized the size of the each dot a bit in the code. In slim, I then seperated out the displacements and combined them again to create those seeds. Same process was followed for the color. This time I also prefered to dabble in a bit of sub surface scattering and tried to match my shader to my reference. Since I had lost my files before last class when it was due I had to recreate them in the next couple ofdays. Due to this mad rush I omited modeling the fruits again. I just added the shaders to the spheres to see the effect.

The final result for this shader was quite satisfying.

2. Strawberry Shader

Link to the slim code.

Voronoi Pattern

The Voronoi Pattern is another interesting one. It basically scatters the points in a texture depending on the distances of the objects from a given point. Our little shader breaks the texture maps into the equal 3X3 cells and then assigns one point to each of these cells and then using the cell noise feature jitter the point to a random location inside that cell. We then calculate the shortest distance between these points and the point specified. In our model we find the shortest distance and the second shortest distance and then subtract them to find their border. This way we can control the size, color and opacity of the border. To read up more about voronoi read the bit on Advanced Renderman.
voronoiexplanation

So, using this I figured I could get the cells pattern on the lychee and I was right, but it still needs some tweaking. With the amount of time I had I got a fair result. This time I went a little more towards depending on slim. I built a large network hoping to get the texture of the lychee skin. The sub surface helps a bit but it still lacks that roughness.The layered shader get washed away by the sub surface so I will have to play around with it to get it just perfect. Here is the node netwrk for my lychee node.
lychee_slim_node

I wasn’t too disheartened by the final render as it is getting in the uncanny valley of reality and cg. So some more work on this and another push will really push it into the realistic lychee shader realm.
lychee - Copy

Link to the slim code.

No Comments

Leave a Reply