Jump to content

MERL BRDF Database


Annon

Recommended Posts

Hi.

Thanks for the links. I've triied brdflab some time ago and couldn't get it to work (or didn't try hard enough). I found it more convenient to have the BRDF directly inside Houdini, so I could compare to the BSDF's that were built into Houdini. BSDF's are often quite implementation dependent. (I've seen so many different cooks :-)

fityk looks really interesting.. I've been doing a lot of "Curve" fitting manually recently. Will have to try it!

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

Create a VEX surface node. Copy paste this code:

Feed in a (poly) sphere.

#pragma range ex_nu 0 1000
#pragma range ex_nv 0 1000
#pragma choice BSDFfunc 0 "Phonglobe"
#pragma choice BSDFfunc 1 "Ashikhmin"
#pragma choice BSDFfunc 2 "Blinn"
#pragma choice BSDFfunc 3 "Diffuse"

#include "voplib.h"
#include "voptype.h"

sop prebuilt_BSDFs(float lightangle = 0, ex_nu = 100, ex_nv = 100, SpecScale = 1, BSDFfunc = 0;)
{

    float lr = radians(lightangle);
    vector L = {0,0,0};
    L.x = -sin(lr);
    L.y = cos(lr);               
    L = normalize(L);                       // vector to light

    vector sP = {0,0,0};                    // Point to be shaded
    vector Nn = {0,1,0};                    // Surface Normal
    vector V = normalize(P);                // vector to eye / view vector

    float NdotV = dot(V,Nn);
    vector R = 2 * NdotV * Nn - V;             // reflection Vector

    bsdf SpecBSDF;

    vector X = {1,0,0};
    vector Y = {0,0,1};  // tangents

    if (BSDFfunc == 0) SpecBSDF = phonglobe(Nn, R, ex_nu, ex_nv, X, Y);
    if (BSDFfunc == 1) SpecBSDF = ashikhmin(Nn, ex_nu, ex_nv, X, Y);
    if (BSDFfunc == 2) SpecBSDF = blinn(Nn, ex_nu);
    if (BSDFfunc == 3) SpecBSDF = diffuse(Nn,1, "label", "");

    vector S = eval_bsdf(SpecBSDF, V, L);

    P = P * length(S) * SpecScale;
}
Link to comment
Share on other sites

  • 3 weeks later...

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