The test-object is a signed distance function that is computed with ray-marching. When the ray hits an object the intersection-flag is set to 1 or otherwise set to 0. To speed up the process (since all of the computation is done on the native CPU) I implemented adaptive subsampling in screenspace. The following image shows that the subdivision works successfully:

enter image description here

Each of these blocks has four corners that consists of a hash structure, that by the time of writing contains: objectID, color and intersection-flag. The problem I have is that in my first successfull-test interpolating the subdivided blocks causes edge-artifacts or colors that does not align with the neighbouring blocks. I have tested the bilinear interpolator and it is working, but it does not seem to be working like expected, although some documents on this subject suggests that this is the right way to do it.

enter image description here

Any ideas how to fix this issue when the adaptive subsampler is based on a recursive algorithm to speed up the rendering?


  • 1
    $\begingroup$ I'm not a graphics person but I don't see how this is answerable. It seems to be "Please help me debug my code, which I've not shown you." Note that code debugging is off-topic everywhere on the Stack Exchange network and coding questions are off-topic on this particular site. Could you edit your post to clarify what you're looking for? (Or reply in a comment to explain why I'm wrong!) $\endgroup$ – David Richerby May 1 '18 at 17:15
  • $\begingroup$ My question does not involve debugging any of my code, since it is not buggy. It works the way I coded it. The problem is that it is visually not the way i want it to be, like in the screenshot above. The question involves more in what order or how to restructure the points of the bilinear interpolation of the corners such that the object looks smoother. Maybe I need to rewrite the algorithm of the subsampling? I hope this clarified a little. And I appreciate the response. $\endgroup$ – Natural Number Guy May 1 '18 at 17:32
  • 1
    $\begingroup$ It seems like you need more steps, and the effect you (probably) have in mind are not coherent normals after subdivision. en.wikipedia.org/wiki/Subdivision_surface Could you try three steps of cube subdivision like in the picture? What do you mean by "adaptive"? (I understand this as finer quality at closer distance, which is not the way image looks). I think that there is a good hidden question here, which may be on-topic here or at CG, but we really like textual description of the problem. $\endgroup$ – Evil May 1 '18 at 19:59
  • $\begingroup$ I don't know what "The test-object is a signed distance function" means. $\endgroup$ – D.W. May 1 '18 at 21:15
  • 1
    $\begingroup$ Is your question: "given pixel values at the points in green, how do I interpolate to get a picture that colors all the pixels nicely?" I guess the idea is that your current method leads to the picture on the bottom, which doesn't look nice, and you want a method that won't have those artifacts? The fact that you don't describe your current method makes it harder to know if there is something wrong with it. $\endgroup$ – D.W. May 1 '18 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.