Cycles Strand Rendering


(BroadStu) #1

Hi all! I have been working on strand rendering in cycles. It’s still quite early and experimental. The initial patch I worked on has now been included in trunk. So, any recent builds should contain this feature (later than 53373). A recent build can be downloaded from the link below.

http://builder.blender.org/download/

For full instructions on how to use it and what the settings do please visit the wiki http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Cycles/Hair.

To use the hair rendering you must change the feature set' on the render tab toexperimental’ (from `supported’) and be using the cpu to render. With these settings once a particle system is added new panels will be displayed in the particle tab to control the strands.

There are a few known limitations and bugs currently. These include:

  • Only available for CPU rendering
  • Doesn’t support motion blur.
  • There are gaps and overlaps using line segments. This shouldn’t be visible for thin strands. You can use triangle primitive strands to fill these gaps but these don’t support the hair info node yet. Curve primitives also remove these gaps but artifacts can sometimes appear (particularly with an orthographic camera).
  • When an objects isn’t scaled equally along each axis the strand thickness isn’t changed in the same way for a dynamic and a static bvh. This can be fixed by applying any scaling to the object mesh.

(marcoG_ita) #2

Here is a first test! (Already posted on the Cycles thread)
2 minutes in CPU, 50 sample per pixels. 1000 strands + 50 children each. Awesome job man!

http://dl.dropbox.com/u/58007699/Blog%20images/RecentBlender/HAIR_test01.png

More to come, and lot of questions too :slight_smile:

Btw, I noted it does “read” children amount from the “view” value, not render value. Any thoughts?


(Writer's Block) #3

That is amazing. :slight_smile:


(marcoG_ita) #4

The patch is indeed amazing. Can’t wait to back home and test more. I’ll try a chair and a character as soon as i get familiar with it.

Question:

  • Any suggestion/examples on how to properly use strand node? Didn’t play much with it, yet.
  • How do i set “tapering”?
  • How to increase strand/hair resolution? Particle segment value seems not affecting it (this is non patch related question)

Thanks


(BroadStu) #5

@marcoG_ita: Great results! As for the child number I currently just export the data that’s stored by blender internal. This was added quite recently. I initially just exported the main strand hair keys and interpolated a new path between these (as happens when export cache is disabled). I will look into the possibility of extending this to the child render number.


(marcoG_ita) #6

Thanks! Nevermind render/view children if it does add complexity. It’s a smaller “issue”, viewport seems to handle well hairs, though, in the future would be cool to have view and render setting separately. Thanks again :slight_smile:


(BroadStu) #7
  • The strand shape sets the tapering of the strands (~1 gives an extreme tapering, -1 gives a perfect cylinder and 0 gives a linear decrease in radius along the strand). Unfortunately, these settings are applied to every particle system. I actually initially made them individual to the system but that created errors and I decided as a temporary fix to make them global properties for now.
  • The main use of the strand info node is to allow variation along the strand by using the intersection value to mix shaders or adjust colour. For example, this allows you to make the strands transparent at tips. It also enables you to set specific hair systems to use the tangent normal and actual normal values for the others. You could also calculate the dot product between this and the actual normal to give a way of adjusting the shader along the strand’s width.
  • The resolution of the strands are adjusted by changing the `draw step’ value under draw properties tab (that is closed by default). The segments are actually created between these points and this smooths the result. The segments setting was mainly used when I only exported the hairkeys and had to interpolate the strands path from these.

(PA3D) #8

This looks awesome, will try and have a look as soon as I can, thanks for your work Broadstu!


(marcoG_ita) #9

Many thanks, time to test now :smiley:

Regards


(Bao2) #10

Awesome work. 4507 lines of awesomeness.


(renderdemon) #11

It seems that there is an issue with rendering(not the viewport rendering,but the tile render)it appears a circle pattern(several circles nested on the screen from the center of the image) on top of the rendering,mainly when the strands are small and you are far away from them.
The viewport rendering seems not having this problem.
Anyway,great stuff!


(marcoG_ita) #12

This + the power of Nodes = total awesomeness

I can’t get where to plug Strand Info node though.

http://dl.dropbox.com/u/58007699/Blog%20images/RecentBlender/HAIR_test03.png

http://dl.dropbox.com/u/58007699/Blog%20images/RecentBlender/HAIR_test02.png


(fjuhec) #13

Wow! This is absolutely beautiful and powerful!
Awesome job!


(Monster3D) #14

I think you can use as a factor for mixing something for example “Intercept” as factor for mixing 2 colors make tip color different than root color.


(BroadStu) #15

@renderdemon - that’s very interesting. More details would be very useful. Have you got an example image or .blend file? It would also be interesting to know if this happens for the `accurate’ preset mode? and if it happens in the viewport when the bvh is changed to static? It could be related to an issue I fixed yesterday.


(renderdemon) #16

Hi BroadStu,it happens also with the accurate preset,and also with static bvh,from the center of the image they appear concentric circles,but if you go near the hair they render fine(I’m testing short hair to act like fur)
Anyway,I understand you need more information so I’ll try to do a simple scene to explain better.


(Jonathan L) #17

Looking good, keep up the good work!

Just a simple test with anisotropic shading:
http://img824.imageshack.us/img824/2836/hairtest.png


(marcoG_ita) #18

1 minute and 30 sec, 10’000 hairs + 5 children each. Is addictive

@Monster3D - Yes indeed, i had to plug a multiply math to get the effect, that’s why i didn’t see differencies before, now works. Thanks

https://dl.dropbox.com/u/58007699/Blog%20images/RecentBlender/HAIR_test04.png

15’000 hairs + 7 children, also thinner hair

https://dl.dropbox.com/u/58007699/Blog%20images/RecentBlender/HAIR_test04b.png


(ng-material) #19

great stuff! especially the last post.

I hope this speeds things up for brecht when it comes to it.


(PA3D) #20

Question here, do I install the patch from the scripting interface with a line like this one?

patch -p0 < d:\Cycles_Hair(8-12-2012)[52815].patch

Because if so, I am getting errors running it!

Thanks for any assistance!

EDIT: I meant the command line with the patch util installed