How hard can the implementation of a fourth-order VRI be?

The challenge: to correctly implement a fourth-order volume rendering integrator.

Typically, during the development of a volume renderer, the verification process is done by looking at the rendered image. In this webapp, on the other hand, the verification procedure will be done by looking at a plot: you will not know what the correct image looks like; you know only that the numerical errors of your implementation should match the errors shown in the blue curve in the plot below. Although it looks easy, you may be surprised by the number of little problems that will prevent your code from providing the correct answer. If you have comments, suggestions, or ideas, I would like to hear from you. Please send me an email.

This page has been tested on Google Chrome.



Teste


function convergence(data, d, D, N) {
// The challenge is to write a fourth-order numerical integrator for the VRI. // Only one ray is going to be integrated. The ray lies in the [0,D] range. // It follows the description of the input parameters: //data: Object containing transfer functions, namely color tranfer // function (accessed via data.C(lambda)), and extinction // transfer function (accessed via data.t(lambda)). // lambda is the parameterized position of a point in the ray. //D: Ray length. The ray is parameterized in the interval [0, D] //d: The distance between sample points. //N: The number of refinements that must be made. Because the goal // is to assess convergence, ray should be progressively refined // N times by a factor of half, i.e., d = d * 0.5; // The output is an array containing the solution of // the VRI for different sample distance. Your output should contain N // entries that looks like: // return [VRI(d, data), VRI(0.5*d, data), ... , VRI(0.5^(N-1)*d)] // where VRI is fourth-order numerical integrator that you will implement. // Your implementation will be correct if the green and blue curves match. function VRI(d, D, data) { return 0.0; } return [VRI(Math.pow(0.5, 0)*d, D, data), VRI(Math.pow(0.5, 1)*d, D, data), VRI(Math.pow(0.5, 2)*d, D, data), VRI(Math.pow(0.5, 3)*d, D, data), VRI(Math.pow(0.5, 4)*d, D, data), VRI(Math.pow(0.5, 5)*d, D, data), VRI(Math.pow(0.5, 6)*d, D, data)];
}