Jump to content

What is Wolfwood rendering?


Jason

Recommended Posts

Your fault.... :angry:

Sub-surface scattering...Irradiance....fighting me.....must not give up.... somebody say brute force? :P

Is it just me who is getting slapped around by irradiance? SESI hasn't said anything and I'm scared that its user error. (Although I doubt it).

jim.

Its April 15th, do you know where your taxes are?

Link to comment
Share on other sites

Heh heh, sorry to invoke a world of pain for you.. SESI might be unresponsive on the irradiance issue, but I'm pretty sure the necessary people have seen the threads and are probably working on it anyway. At least I hope so - because that's usually the case..

Link to comment
Share on other sites

Its not very smart right now. It just shoots tons of rays everywhere to get the distance and the surface color. This is why the edges of the cube appear black, very few samples are hitting the top. Its a start. :P

Here is the working version...so far. <_<

//  Brutey SSS
//  slow rendering is fun.

#define PI 3.14159265359

vector
sssGather(  vector  P;      // Point being shaded
            vector  D;      // Direction to sample in
            float   bias;
            float   maxContrib;
            float   maxDist;
            float   extCoeff;
            int     samples;
            string  objName; )
{                       
    vector  colorOut = 0;
    vector  randomDir = 0;
    vector  refColor = 0;
    vector  Dn = normalize(D);
    float   hitDist = 0;
    float   extinction = 0;
    int     i;
        
    for(i=0; i&lt;samples; i++) {
        randomDir = normalize(nrandom() - .5);
        if ( dot(randomDir,Dn) &lt; 0 ) {
            randomDir *= -1;
        }
//        hitDist  = rayhittest(P, randomDir, bias, "scope", objName);
        hitDist  = rayhittest(P, randomDir, bias);
        if (hitDist &gt; 0) {
            extinction = exp(-extCoeff*hitDist);
//            refColor += extinction * reflectlight(P, randomDir, 
//                                                  bias, maxContrib,
//                                                  "scope", objName,
//                                                  "maxdist", maxDist);
            refColor += extinction * reflectlight(P, randomDir, 
                                                  bias, maxContrib,
                                                  "maxdist", maxDist);
                                                    

        }
    }
    colorOut = refColor / samples;
    return colorOut;
}

surface
bf_SSS( vector  diff        = .5;
        float   Ksss        = 1;
        float   extCoeff    = 1;
        int     samples     = 16;
        float   maxDist     = 1e7;
        float   maxContrib  = 1;
        float   bias        = 0.01;)
{

    vector Nn = normalize(N);
    string objName = getobjectname();

    Cf = ambient();
    Cf += diff * diffuse(Nn);

    if (Ksss &gt; 0 &amp;&amp; getraylevel() == 0 &amp;&amp; samples &gt; 0) {
        Cf += Ksss * sssGather(P, -Nn,
                               bias, maxContrib,
                               maxDist, extCoeff,
                               samples, objName);
    }
}

jim.

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...