Blender Hair Children

Please use this forum for general user support and related questions.

Moderator: coordinators

Forum rules
Please include your operating system type/version, LuxRender version and Exporter version used when submitting a support post.

Make sure you have read the Release forum thread for Release and RC (Release Candidates) builds as these threads contain information on known problems and workarounds: Test Builds Forum

Blender Hair Children

Postby Karl_955 » Sat Jan 07, 2012 2:14 pm

Hi

I am interested in a detailed hair render, but I have noticed that Luxrender doesn't render the child strands when rendering hair. As a result, the hair often looks thin and sparse. One workaround is to just increase the number of parent particles, but this is not a practical solution. There would be too many strands to style/calculate. Also, with just parents, I don't know how to adjust the clump/shape settings (which is what adds much of the realism to the hair).
Converting the hair to polygons often takes up too much memory, and it often leaves thin areas.

Does anyone know any workarounds?


Thank You
Last edited by Karl_955 on Fri Jan 13, 2012 11:25 pm, edited 2 times in total.
Karl_955
 
Posts: 3
Joined: Sat Jan 07, 2012 2:04 pm

Re: Blender Hair Children

Postby Karl_955 » Tue Jan 17, 2012 6:35 pm

I think the render could look fine going with the older polygonal hair technique (alpha maps, bump maps, etc) if Blender doesn't support particle children. I'll give it a try and see how it goes
Karl_955
 
Posts: 3
Joined: Sat Jan 07, 2012 2:04 pm

Re: Blender Hair Children

Postby Karl_955 » Fri Jan 20, 2012 4:08 pm

It seems like the hair from the final fantasy game fmv's as well as the movies make use of what looks like polygon hair. It may be easier to manage and control small details.
Also, the shape of the hair can be easier to control and there is less need to worry about hair intersecting with the mesh. Individual strands can be made with transparency maps. It is possible that this also takes less time to calculate.

For this technique, I plan on making groups of hair strands and adding some displacement to them using the free scupltris program from zbrush. I still have to figure out how to make displacement maps with corresponding alpha/transparency maps.

However, if Blender hair children is to be implemented into the luxblend export, does anybody have an idea about when that would be?

Note: I am using luxblend 2.5 with Blender 2.61
Karl_955
 
Posts: 3
Joined: Sat Jan 07, 2012 2:04 pm

Re: Blender Hair Children

Postby olivii0 » Sat Jun 09, 2012 8:57 pm

The polygonal technique should suffice for this in my opinion. Yes you are correct about final fantasy there. Not sure about the time scle thing though.
olivii0
 
Posts: 2
Joined: Sat Jun 09, 2012 8:47 pm

Re: Blender Hair Children

Postby Ze_Blob » Tue Jun 12, 2012 4:09 pm

Karl_955 wrote:However, if Blender hair children is to be implemented into the luxblend export, does anybody have an idea about when that would be?


Not only children are not supported but, as far as I remember, parameters using vertex paint are ignored too. That means you cannot change the length of grass with vertex paint, for instance.

Unfortunately people knowing well Pyhton, the blender API, and how to pass the parameters to Luxrender are very few, i suppose. And those who have time to dig into this hairy subject even fewer.

Here is the major thread about implementing the blender hair system in luxblend25:
viewtopic.php?f=11&t=3058&hilit=hair+system

Most of the code seems located in export/geometry.py
Code: Select all
      LuxLog('Exporting Hair system "%s"...' % psys.name)
      
      size = psys.settings.particle_size / 2.0 / 1000.0 # XXX divide by 2 twice ? Also throw in /1000.0 to scale down to millimeters
      hair_Junction = (
         (
            'HAIR_Junction_%s'%psys.name,
            psys.settings.material - 1,
            'sphere',
            ParamSet().add_float('radius', size/2.0)
         ),
      )
      hair_Strand = (
         (
            'HAIR_Strand_%s'%psys.name,
            psys.settings.material - 1,
            'cylinder',
            ParamSet() \
               .add_float('radius', size/2.0) \
               .add_float('zmin', 0.0) \
               .add_float('zmax', 1.0)
         ),
      )
      
      for sn, si, st, sp in hair_Junction:
         self.lux_context.objectBegin(sn)
         self.lux_context.shape(st, sp)
         self.lux_context.objectEnd()
      
      for sn, si, st, sp in hair_Strand:
         self.lux_context.objectBegin(sn)
         self.lux_context.shape(st, sp)
         self.lux_context.objectEnd()
      
      det = DupliExportProgressThread()
      det.start(len(psys.particles))
      
      for particle in psys.particles:
         if not (particle.is_exist and particle.is_visible): continue
         
         det.exported_objects += 1
         
         points = []
         for j in range(len(particle.hair_keys)):
            points.append(particle.hair_keys[j].co)
         if psys.settings.use_hair_bspline:
            temp = []
            degree = 2
            dimension = 3
            for i in range(math.trunc(math.pow(2,psys.settings.render_step))):
               if i > 0:
                  u = i*(len(points)- degree)/math.trunc(math.pow(2,psys.settings.render_step)-1)-0.0000000000001
               else:
                  u = i*(len(points)- degree)/math.trunc(math.pow(2,psys.settings.render_step)-1)
               temp.append(self.BSpline(points, dimension, degree, u))
            points = temp
         
         for j in range(len(points)-1):
            # transpose SB so we can extract columns
            # TODO - change when matrix.col is available
            SB = obj.matrix_basis.transposed().to_3x3()
            SB = fix_matrix_order(SB) # matrix indexing hack
            v1 = points[j+1] - points[j]
            v2 = SB[2].cross(v1)
            v3 = v1.cross(v2)
            v2.normalize()
            v3.normalize()
            if any(v.length_squared == 0 for v in (v1, v2, v3)):
               M = SB
            else:
               # v1, v2, v3 are the new columns
               # set as rows, transpose later
               M = mathutils.Matrix( (v3,v2,v1) )
               M = fix_matrix_order(M) # matrix indexing hack
            M = M.transposed().to_4x4()
            
            Mtrans = mathutils.Matrix.Translation(points[j])
            matrix = obj.matrix_world * Mtrans * M
            
            self.exportShapeInstances(
               obj,
               hair_Strand,
               matrix=[matrix,None]
            )
            matrix = obj.matrix_world * Mtrans
            
            self.exportShapeInstances(
               obj,
               hair_Junction,
               matrix=[matrix,None]
            )
      
      det.stop()
      det.join()
      
      LuxLog('... done, exported %s hairs' % det.exported_objects)
Ze_Blob
 
Posts: 100
Joined: Mon Feb 01, 2010 10:33 am


Return to LuxRender User Support

Who is online

Users browsing this forum: pfannkuchen_gesicht and 3 guests