Jump to content

Q: partial derivative stuff


TheUsualAlex

Recommended Posts

Hi there,

Please forgive me for my giant gap on the rendering and shading side of things here :bag: :shocking: , how are y'all typically resolve high frequency shader aliasing issue besides cranking up the sampling? For the past day or so I've just begun to read up on those from several renderman books and the big blue noise book (texturing and modeling) only to occurred to me that this is a very complex and very challenging issue. However, I am only trying to understand the basics at the moment. :)

zdo i am trying to wrap my head around on the elementary, basic stuff here. Given the code (Essential Renderman Fast, p279)

float ss = s * scale;

// I supposed du == Du(s) and dv == Dv(t) in VEX? 
float filterwidth = abs(Du(ss)*du) + abs(Dv(ss)*dv);


if( s > 0.5 ) {
   val = cos( ss );
} else {
   val = (sin(ss+filterwidth) - sin(ss))/filterwidth;
}

Cf = val * 0.5 + 0.5;

//For the geometry this shader is attached to, I only used a 2x2 grid to study the result.

So basically what's happening here is that the Du(s) and Dv(t) will take the "distance" between the current sample point and the next sample point with respect to s or t, which generally yield a very small number depending on how far the object is from the camera. What I am curious about is, how is Mantra determine the distance between the samples? Given the shading rate of 1, is it correct to assume that each micropolygon will have only 1 sample? If the Jitter is set to 0, the sample point will be right at the center of the micropolygon? If this is the case case, when I pull my camera out farther, Du(s) will yield a much bigger value, how then is Du(s) come to this greater value...? What's happening here? Because of the fact that frequency are now greater than the pixel itself, so that 2 adjacent pixels might cover a larger area than when the geometry was closer to the camera, and thus Du(s) change much faster...?

Anyways, I hope the questions make sense... I am trying to understand the basics of it still... Much thanks for your time! :)

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