VisTrace icon indicating copy to clipboard operation
VisTrace copied to clipboard

[bug] Regression in mipmapping calcs

Open Derpius opened this issue 2 years ago • 3 comments

Describe the bug Regression has occurred (likely when computing triangle area) after the MDLParser integration that affects mipmapping

To Reproduce Steps to reproduce the behaviour:

  1. Use an existing ray tracer
  2. Set the ray cone params when calling traverse to enable texture filtering

Screenshots image

Derpius avatar Mar 27 '23 20:03 Derpius

I'm not familiar with VisTrace's tracing internals anymore since the MDLParser update. However, I did trace the regression back to the commit which merges MDLParser into the master branch.

See 5c2d05a. I tried doing basic code swapping with the earlier versions, but given that the literal triangle data has changed completely, nothing worked... I also don't know how to fix this issue since I'm not very acquainted with MDLParser yet. Will keep trying, but MDLParser merge is most likely the cause of this.

yogwoggf avatar Apr 04 '23 01:04 yogwoggf

We’ll ignore the fact I said where the regression was introduced and probable cause in the issue description :trollface:

Derpius avatar Apr 04 '23 18:04 Derpius

Identified the issue:

  • https://github.com/Derpius/VisTrace/blob/master/source/objects/AccelStruct.cpp#L400-L415
    • UV data etc. is copied to the instance after construction (i have no recollection of why it's not passed on the constructor)
  • https://github.com/Derpius/VisTrace/blob/master/source/objects/Primitives.h#L81
    • Constructor calls method to compute lod data, before the UV data is copied in

If there's no limitation preventing passing this data on the constructor, we should do that instead (which fixes this issue)

Derpius avatar Jul 06 '24 10:07 Derpius