Page MenuHome

hairstrandwidth_2.patch

File Metadata

Author
jean-michel soler (jms)
Created
Nov 13 2013, 1:15 PM

hairstrandwidth_2.patch

? hairstrandwidth.patch
? source/creator/winbuildinfo.h
? tools/Blender.pyc
? tools/__init__.pyc
? tools/bcolors.pyc
? tools/btools.pyc
Index: source/blender/makesdna/DNA_material_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_material_types.h,v
retrieving revision 1.42
diff -u -r1.42 DNA_material_types.h
--- source/blender/makesdna/DNA_material_types.h 26 Jun 2006 17:50:48 -0000 1.42
+++ source/blender/makesdna/DNA_material_types.h 18 Aug 2006 13:08:22 -0000
@@ -114,6 +114,8 @@
int YF_dsmp, YF_preset, YF_djit;
ScriptLink scriptlink;
+
+ double strand_pow ;
} Material;
/* **************** MATERIAL ********************* */
@@ -168,7 +170,8 @@
#define MA_SHADBUF 0x2000000
/* note; we drop MA_TANGENT_STR later to become tangent_u */
#define MA_TANGENT_V 0x4000000
-
+#define MA_TANGENT_DEPTH 0x8000000
+
#define MA_MODE_MASK 0x3ffffff /* all valid mode bits */
/* diff_shader */
Index: source/blender/render/intern/include/render_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/render/intern/include/render_types.h,v
retrieving revision 1.16
diff -u -r1.16 render_types.h
--- source/blender/render/intern/include/render_types.h 12 Aug 2006 11:26:59 -0000 1.16
+++ source/blender/render/intern/include/render_types.h 18 Aug 2006 12:14:00 -0000
@@ -132,7 +132,8 @@
/* clippping */
float clipsta;
float clipend;
-
+ float depth;
+
/* samples */
SampleTables *samples;
float jit[32][2];
Index: source/blender/render/intern/source/convertblender.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/render/intern/source/convertblender.c,v
retrieving revision 1.53
diff -u -r1.53 convertblender.c
--- source/blender/render/intern/source/convertblender.c 14 Jul 2006 13:44:23 -0000 1.53
+++ source/blender/render/intern/source/convertblender.c 18 Aug 2006 13:38:43 -0000
@@ -1173,7 +1173,8 @@
VlakRen *vlr;
float nor[3], cross[3], w, dx, dy, width;
int flag;
-
+ float coef;
+
VecSubf(nor, vec, vec1);
Normalise(nor); // nor needed as tangent
Crossf(cross, vec, nor);
@@ -1194,10 +1195,20 @@
else fac= ctime;
width= ((1.0f-fac)*ma->strand_sta + (fac)*ma->strand_end)/w;
+
+ if(ma->mode & MA_TANGENT_DEPTH )
+ {
+ coef=(re->depth+vec[2])/re->depth;
+ if (ma->strand_pow>1.0) coef*=coef;
+ if (ma->strand_pow>2.0) coef*=coef;
+ width*=coef;
+}
VecMulf(cross, width);
}
else width= 1.0f;
-
+
+
+
if(ma->mode & MA_TANGENT_STR)
flag= R_SMOOTH|R_NOPUNOFLIP|R_TANGENT;
else
@@ -1302,6 +1313,13 @@
else ptime= 0.0;
ctime= bsystem_time(ob, 0, (float)re->scene->r.cfra, ptime);
seed= ma->seed1;
+
+if(ma->mode & MA_TANGENT_DEPTH)
+ { Camera *camera ;
+ float depth ;
+ camera=re->scene->camera->data;
+ re->depth=camera->clipend-camera->clipsta;
+}
for(a=0; a<paf->totpart; a++, pa+=paf->totkey) {
Index: source/blender/src/buttons_shading.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_shading.c,v
retrieving revision 1.207
diff -u -r1.207 buttons_shading.c
--- source/blender/src/buttons_shading.c 15 Aug 2006 06:27:33 -0000 1.207
+++ source/blender/src/buttons_shading.c 18 Aug 2006 14:43:45 -0000
@@ -3078,14 +3078,15 @@
block= uiNewBlock(&curarea->uiblocks, "strand menu", UI_EMBOSS, UI_HELV, curarea->win);
/* use this for a fake extra empy space around the buttons */
- uiDefBut(block, LABEL, 0, "", 0, 0, 250, 100, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "", 0, 0, 250, 135, NULL, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, MA_TANGENT_STR, B_MATPRV, "Use Tangent Shading", 10,70,230,20, &(ma->mode), 0, 0, 0, 0, "Uses direction of strands as normal for tangent-shading");
- uiDefButF(block, NUMSLI, B_MATPRV, "Start ", 10, 50, 230,20, &ma->strand_sta, 0.25, 20.0, 2, 0, "Start size of strands in pixels");
- uiDefButF(block, NUMSLI, B_MATPRV, "End ", 10, 30, 230,20, &ma->strand_end, 0.25, 10.0, 2, 0, "End size of strands in pixels");
- uiDefButF(block, NUMSLI, B_MATPRV, "Shape ", 10, 10, 230,20, &ma->strand_ease, -0.9, 0.9, 2, 0, "Shape of strands, positive value makes it rounder, negative makes it spiky");
-
+ uiDefButBitI(block, TOG, MA_TANGENT_STR, B_MATPRV, "Use Tangent Shading", 10,110,230,20, &(ma->mode), 0, 0, 0, 0, "Uses direction of strands as normal for tangent-shading");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Start ", 10, 90, 230,20, &ma->strand_sta, 0.25, 40.0, 2, 0, "Start size of strands in pixels");
+ uiDefButF(block, NUMSLI, B_MATPRV, "End ", 10, 70, 230,20, &ma->strand_end, 0.25, 10.0, 2, 0, "End size of strands in pixels");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Shape ", 10, 50, 230,20, &ma->strand_ease, -0.9, 0.9, 2, 0, "Shape of strands, positive value makes it rounder, negative makes it spiky");
+ uiDefButBitI(block, TOG, MA_TANGENT_DEPTH, B_MATPRV, "Use depth reduction", 10,28,230,20, &(ma->mode), 0, 0, 0, 0, "Uses camera clipsta-clipend to compute depth reduction ");
+ uiDefButF(block, NUMSLI, B_MATPRV, "Reduc. Power ", 10, 8 , 230,20, &ma->strand_pow, 1.0, 3.0, 2, 0, "To accelerate depth reduction ");
uiBlockSetDirection(block, UI_TOP);
return block;

Event Timeline