Jump to content
Jason

What is Wolfwood rendering?

Recommended Posts

Hey man,

We've seen your posts on the SESI forum.. whatcha doing?

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

I'm not being slapped around by irradiance...well...at least not directly :P

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites

:P

Hehe I don't mind SESI not responding. Its just I'm always a little scared that a suspected bug is really just a user bug. ;)

The dreaded response:

"No you dolt, it works fine, you forgot to check the following button."

woes.jpg

:D

jim.

Share this post


Link to post
Share on other sites

lol....

a friend of mine is fond of saying it's a PEBCAK error > Problem Exists Between Chair And Keyboard.

Share this post


Link to post
Share on other sites

Nothing good on CNN today so I decided to do a few SSS tests.

sssLSamples.jpg

32 samples

sssHSamples.jpg

512 samples

SSS actually means super slow shading. :P

jim.

Share this post


Link to post
Share on other sites

Wow - this looks pretty good!

Are you using caching?

And have you tested a shot animation?

Cheers!

Happy friday,

Jason

Share this post


Link to post
Share on other sites

I'm just brute forcing it right now. I'll do a little zoom animation, so I can see how bad it "shimmers". I'll post the hipnc which contains the vex shortly.

jim.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I really wish reflectlight(), or trace() returned the distance of the ray that was fired. That would mean I could skip the rayhittest() call.

I'm open to improvements, comments and a Midori Sours.. :D

jim.

Share this post


Link to post
Share on other sites

Holy noise batman. :blink: After viewing about 20 frames of the animation I decided I'll try irradiance caching again instead of brute force.

jim.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×