Skip to content
Discussion options

You must be logged in to vote

Hi @ioissss

I'm assuimg you want to sample points on surfaces. I'd recommend a two-level scheme, where you first sample a shape, and then sample a point on the shape using shape.sample_position().

To sample a shape, you can build a 1D disrete distibution from the shapes' surface areas.

Once a shape is sampled, the sample_position() will return a point in world-space.

No, not every BSDF has those two components. If you keep track of the shape you sampled from, you can request its BSDF, with shape.bsdf().

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ioissss
Comment options

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