Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)

Implementing Displacement mapping

ChiWang
Beginner
165 Views

Hi, I am try to implement displacement map in our engine and get stucked with getting object uv coords in displacement callback functions.

 

In the callback functions, the input is "RTCDisplacementFunctionNArguments args", and we can modify the position args->p_x, args->p_y, args-p_z with displacement values.

 

With displacement map, we have to query the the displacement value with corresponding uv coordinate. So, I am wondering how get this value? I assume, with primID we know which triangle we are processing, we also need the barycentrics coord to know exactly which point we are dealing with?

 

(Looks like the args->u and args->v are differnet from what we are talking here?)

0 Kudos
0 Replies
Reply