- Added "anisotropic" rendering for static particle hair strands.

This means the diffuse and specular shaders don't use the normal
  for hair (which is actually undefined, a hair is micro cylinder) but
  it uses the tangent vector (vector in direction of hair).

For Diffuse, it computes a fake normal now, representing the optimal
hair normal pointing towards the light. All current builtin shaders
work with this, including ramps.

For Specular, it uses another formula to remap dot products for all
lines that now use the tangent vector instead of the normal:

dot = vector * tangent
dot = sqrt(1.0 - dot*dot)

Gives better results than using the 'fake' normal for diffuse. Officially
(according the papers) this could be used for diffuse too, but then hair
becomes very flat. Now you can control the flatness easily with ramps or
using Oren-Nayer for example.

Example image (disappears in some weeks)
http://www.blender.org/bf/rt9.jpg

- Added new texture channel "Strand" to apply textures on hairs over the
  length of hair (1 dimensional). Orco now gives 1 fixed coordinate for
  the entire hair, based on where it starts.
  Note; UV doesn't work yet. Nor vertexcolor.

http://www.blender.org/bf/rt10.jpg
This commit is contained in:
2005-09-29 13:19:07 +00:00
parent c4b8a431bc
commit 03e1ec988b
15 changed files with 345 additions and 310 deletions

View File

@@ -173,14 +173,16 @@ struct EnvMap *RE_copy_envmap(struct EnvMap *env);
/* --------------------------------------------------------------------- */
/* rendercore (12) */
/* --------------------------------------------------------------------- */
float Phong_Spec(float *n, float *l, float *v, int hard);
float CookTorr_Spec(float *n, float *l, float *v, int hard);
float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power);
float Toon_Spec( float *n, float *l, float *v, float size, float smooth);
float WardIso_Spec(float *n, float *l, float *v, float rms);
float Phong_Spec(float *n, float *l, float *v, int hard, int tangent);
float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent);
float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power, int tangent);
float Toon_Spec( float *n, float *l, float *v, float size, float smooth, int tangent);
float WardIso_Spec(float *n, float *l, float *v, float rms, int tangent);
float OrenNayar_Diff(float *n, float *l, float *v, float rough);
float Toon_Diff( float *n, float *l, float *v, float size, float smooth);
float Minnaert_Diff( float nl, float *n, float *v, float darkness);
void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b);
void ramp_diffuse_result(float *diff, ShadeInput *shi);
void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec);