Skip to content

Accessing Ray Differentials in BSDF's sample() function #1209

Closed Answered by njroussel
AndrewYiBC asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @AndrewYiBC

There's a chain of methods to handle this, when fetching the bsdf of an interaction you should use: SurfaceInteraction3f.bsdf(). That method will call SurfaceInteraction3f.compute_uv_partials() which uses the ray's partials (ray.o_x and ray.o_y). Finally, that last method call will actually fill in the duv_dx, duv_dy fields in your si object. This only works well for the first bounce, after which the ray partials don't correctly account for the warping introduced by the first bounce's BSDF.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@AndrewYiBC
Comment options

@ziyi-zhang
Comment options

@AndrewYiBC
Comment options

@njroussel
Comment options

@AndrewYiBC
Comment options

Answer selected by merlinND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants