Jump to content

Tags


Stremik

Recommended Posts

Those tags are there specifically for those seperate things. And they'll keep the syntax of whatever you put in there.

For example ::

vector
anisotropic(vector nn; vector V; float urough, vrough)
{
    vector    LL;               // Normalized light vector
    vector    H;                // Half angle vector
    vector    lclr;             // Light color
    vector    tanU, tanV;
    float     rz, cos_r, cos_i; // Reflected and incident angles

    float     nml_term;
    float     uval, vval;

    nml_term = 4.0 * M_PI * urough*vrough;

    cos_r = dot(nn, V);
    lclr = 0;
    if (cos_r > 0.0)
    {
       tanU = normalize(dPds) / urough;
       tanV = normalize(dPdt) / vrough;

       // Loop through all lights which contribute specular
       illuminance (P, nn, M_PI/2, LIGHT_SPECULAR)
       {
           LL = normalize(L);
           cos_i = dot(LL , nn);
           if (cos_i > 0.0)
           {
               H = normalize (V + LL);
               uval = dot(tanU, H);
               vval = dot(tanV, H);
               rz = cos_i*exp(-2.*(uval*uval + vval*vval) /
                                  (1.0 + dot(H, nn)));
               rz /= nml_term * sqrt(cos_i*cos_r);
               lclr += Cl * rz;
           }
       }
    }
    else lclr = 0;
    return lclr;
}

Make sense??

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...