• Forum
  • Educación
  • Programas de Render
  • Renderman
  • 3Delight thread!
  • Coolthreads cool cool
    Adversitment
    Results 1 to 20 of 35

    Threaded View

    1. January 12, 2011

      # 17
      Hay un shader basado en este documento (Monte Carlo microfacet reflectance shader). El post original es de GeorgeTirebiter en los foros de 3delight: http://www.3delight.com/en/modules/P...ic.php?id=2431

      Pense que valia la pena ponerlo aqui porque es muy didáctico. SObre todo para quienes no tenemos la facilidad de convertir el documento de arriba en las lineas del post de 3delight

      Si quieren probarlo usando RendermanCode nodes en maya:

      Shading parameters:
      float ReflectionStrength = 1.0;
      float Roughness = 0.1;
      float Samples = 256;
      float IoR = 1.5;

      output varying color output_reflection
      Shading Code:
      float G( vector V, M, N; float alpha ){
      float a = 1 / ( alpha * tan( acos(V.N) ) );
      float x = step( 0, (V.M) / (V.N) );
      if( a < 1.6 ){
      return x*(3.535*a+2.181*a*a)/(1+2.276*a+2.577*a*a);
      } else {
      return x*1;
      }
      }

      float sqr( float x ){ return x*x; }


      extern normal N;
      extern vector I;
      extern point P;
      extern varying vector dPdu;

      normal NN = normalize( N );
      vector V = normalize( -I );

      color C = 0;
      color trs_reflected = 1;

      uniform float i;
      for( i=0; i<Samples; i+= 1 )
      {
      uniform float a = ceil(sqrt(Samples));
      float x1 = (floor(i/a)+random())/a;
      float x2 = (mod(i,a)+random())/a;

      float theta = atan( sqrt( -sqr( Roughness )*log( 1-x1 ) ) );
      float phi = 2*PI*x2;
      matrix rot = rotate( matrix 1, theta, dPdu );
      rot = rotate( rot, phi, NN );
      vector MM = normalize( transform( rot, NN ) );
      float Kr, Kt;
      vector R, T;
      fresnel( -V, MM, 1/IoR, Kr, Kt, R, T );
      R = normalize(R);
      float Gi = G( V, MM, NN, Roughness );
      float Go = G( R, MM, NN, Roughness );
      float weight = abs(V.MM) * Gi * Go * Kr / ( abs(V.NN) * abs(MM.NN) );
      C += trace( P, R, "transmission", trs_reflected ) * weight;
      }

      C *= ReflectionStrength / Samples;

      output_reflection = C;
      El codigo de arriba no tiene el problema del grid visible. Y este nodo lo pueden conectar a un surface shader. Utiliza raytracing, asi que hay que hacer los objetos visibles a specular rays.

    Similar Threads

    1. 3Delight 9.0 /3Delight For Maya 5.0
      By eddgarpv in forum Tus Noticias
      Replies: 0
      Last Post: 12-11-09, 02:04 AM
    2. my sketch thread
      By www.2xbo.com in forum 2D Artwork
      Replies: 7
      Last Post: 03-16-07, 12:25 AM
    3. DEATHFIGHT: SKETCHES Round 1 (Posting Thread)
      By Aztan in forum DeathFight
      Replies: 10
      Last Post: 07-24-06, 11:51 PM
    4. 3Delight Forum?
      By Kridian in forum Renderman
      Replies: 2
      Last Post: 03-02-05, 01:00 AM
    5. 3Delight
      By titus in forum Renderman
      Replies: 0
      Last Post: 01-18-03, 10:16 PM

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    Adversitment