Visual artifacts for cylinders
stukowski opened this issue · comments
I am observing unexpected brightness fluctuations that appear to be view-dependent, i.e. they are most noticeable when the camera is moving. I have attached a video showing the problem. Each network bond is made of two cylinders of equal length and radius attached to each other. Actually, the two should appear as a single, long cylinder. However, the brightness of each half-cylinder flickers for some unknown reason. Any ideas why?
(The fact that each bond consists of two cylinders is, I think, not the cause of the problem. But it makes the artifacts easier to notice. I double-checked that the two cylinders do not overlap, so this is not some sort of Z-fighting problem.)
video1.mp4
The problem seems to affect only cylinders. When I include spheres, here in this 2nd video, they show a constant brightness.
video2.mp4
The radius of the cylinders is 0.2f. Caps are not turned on for the cylinders. Renderer parameters are set to:
pixelSamples = 8
ambientSamples = 12
ambientRadiance = 0.7f
ambientColor = {1.0f, 1.0f, 1.0f}
I perform only a single anariRenderFrame()
call per animation frame.
OptiX version: 7.6
As a follow up: I observe another type of visual artifact when I turn on the cylinder caps ("caps" param set to "both"). This time rendered without AO:
caps.mp4
No worries, VisRTX cones/cylinders definitely need some love! This is all helpful and not suprising -- with the v1.0 spec being done now lots of work on actual rendering capabilities/features can be a stronger focus. We can prioritize these issues...keep any/all feedback coming, thanks!
@stukowski I'm not sure what the issue with cones might be -- they seem to work fine in my tests:
Is there a small reproducer that you have? Or perhaps you could describe the mode that you are using to apply color to them? (i.e. per-vertex or per-primitive color, sampler, etc.)
EDIT: I assumed that you are using per-primitive attributes based on the image above, but just realized that VisRTX's cones are missing per-vertex attribute support. I will add that regardless of what you are using.
I use per-primitive color attributes ("vertex.color"). If you are saying this wasn't working yet, it probably explains why the arrow heads appear all black in my picture.
But their shape seems wrong too. In your test picture, like in mine, the arrow heads appear like 4-sided pyramids, not round cones. Is this your expectation, or is this a separate issue that you're addressing next? Let me know if you still need a reproducer. Thanks.
Re color: to be very specific, primitive.color
and vertex.color
do different things, where we call the first "per-primitive colors" and the latter "per-vertex colors". Not a big deal, in the end. However, only primitive.color
is currently implemented, which explains the black appearance.
Re shape: this is actually intended behavior (for now). I had rushed to have something when I first added cones and encountered some issues with a custom intersector, so it's actually just a very coarsely tessellated cone using plain OptiX triangles. I want to solve this more robustly at some point soon, but for now they will look boxy.
Sorry, I wasn't fully focused last night. I actually wanted to write that I use per-vertex colors ("vertex.color"), not per-primitive in my code. Then we are in agreement, I think.
Thanks for clarifying that rendering of cones is not even implemented yet. I wasn't sure whether I might be seeing black silhouettes of some bounding volumes in my image. Now I understand that these are approximations.