top

hatching shader

hypertexture

cell division


This page shows the results of hatching curve generator using shadeop in RSL
 

torus_shade_s

 

Original render result with a plastic shader

hatching_torus_s

 

Render result of hatching curves

 
Breakdown
 

Curve Creation

 

To create each curves, I use cross product of theincident ray direction and the surface shading normal

as a vector of the curve. The length of the curves are determined randomly between two values, min

length and max length. The percentage of curve creation is determined by the value of color. If the color

is darker, he more curves will be created.

 

exp_01 exp_02

P1 = P + (NxI)*(length/2)

 

P2 = P - (NxI)*(length/2)

N : Surface shading normal

 

I : Incident ray direction

 

Adding Jitter

 

To make curve more organic, I add jitter to the curves. According to the value of "complexity",

I add addtional CVs between the start point and the end point. Then, I randomized those CVs.

 

jitter_exp_01

   
jitter_exp_02

First, the unit length is calculated.

 

unitLength = maxLength / (complexity + 1)

 

Second, how many units the actual length can have

is calculated to determine how many CVs will be

inserted between between the start point and the

end point of the actual curve. Then, the CVs

positions areadjusted so that each length between

CVs become equal length.

 

Finally, each CVs are randomized.

 

Results
 

Left images shows the original images used for percentage of curve creation. Right images are render

resultsof genarated curves. If I render simple object like the torus I put on top of this page, the result

become what I am expecting. However, if I render complex objects, the result loses the detail.

 
dali_occ_s hatching_dali_s
   
simple_occ_s hatching_simple_s
 
 

Here is my shaders.
hatchingCurves_occ.sl
hatchingCurves.c