Announcement

Collapse
No announcement yet.

VRayLightingAnalysis numbers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VRayLightingAnalysis numbers

    Hello,

    I am working on my Bachelor's Thesis about lighting in calculation software and render engines.

    The measurements provided by the VRayLightingAnalysis render element are significantly higher than those given by Dialux.

    Looking at "lighting_analysis_draw.h", ChatGPT suggested checking the following code:
    • Review updateImageGrid()
      If I could access this function, I could analyze whether there is an extra scaling factor applied.
    • Print intermediate values
      Adding temporary logs could help identify where the values are being inflated, for example, in calculateIlluminanceData() or inverseMap().
    • Compare with updateImageSolidColors()
      If the solid color visualization is correct but the grid is not, the difference in implementation might provide clues.

    However, I cannot find these functions in the installed V-Ray files.

    Could someone lend a hand?

    Thanks a lot!

  • #2
    Yes, ChatGPT is notorious for inventing non-existing functions.

    I am not familiar with the Dialux software and I am not sure how you're comparing the two. However, here's a page in the docs regarding the relevance of the Lighting Analysis. Note that the values shown in the VRayLightingAnalysis element are directly taken from the additional Illuminance/Luminance elements (which hold all the per-pixel data). I guess, you can compare the data from those elements with whatever Dialux provides.
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      Thank you very much for the response and the link to the article.

      Steps We Have Taken to Investigate


      1️⃣ Initial search for the illuminance calculation
      • We located the calculateIlluminanceData() function in V-Ray’s SDK files.
      • We found that it was declared but not implemented, leading us to investigate how the values were actually being calculated.

      2️⃣ Exploring IlluminanceChannelCallback
      • We discovered that this class manages the illuminance channel.
      • In regiondata.h, we identified the function getCorrectedIlluminance(), which adjusts illuminance based on certain parameters.
      • This function uses a multiplier (multiplier), which we suspected might be affecting the values.

      3️⃣ Attempt to modify multiplier in regiondata.h
      • We changed the multiplier initialization value to reduce the scale.
      • However, the render values remained unchanged, suggesting that multiplier was being overridden elsewhere in the code or that the modified file was not being loaded correctly.

      4️⃣ Checking for cached and precompiled files
      • We attempted to move precompiled files to force V-Ray to reload regiondata.h.
      • The values still did not change, confirming that regiondata.h is not the only source controlling the illuminance calculation.

      5️⃣ Searching in .dll and .lib files
      • We tried to locate multiplier within precompiled libraries, without success.
      • This reinforced the hypothesis that multiplier was being assigned elsewhere.

      6️⃣ Key discovery in vraycolor.cpp
      • After a deeper search in the SDK files, we found that in vraycolor.cpp, the following was being explicitly set:cpp

        float multiplier = 1.0f;
      • This explained why modifying regiondata.h had no effect: the value was already hardcoded in vraycolor.cpp.
      I'm currently stuck because I can't recompile vraycolor.cpp by changing that value.
      Does anyone know what tools I'd need to compile with the 2021 Max SDK and the latest VRay SDK?

      I've attached two screenshots of the same space, using the same manufacturer's IES, so we can see the different values ​​obtained by a calculation program and VRay.
      Actually, values ​​above 2000 lux are excessively high for the proposed environment.​​
      Attached Files

      Comment


      • #4
        Mind if you send the scene so we can analyze it?
        Aleksandar Hadzhiev | chaos.com
        Chaos Support Representative | contact us

        Comment


        • #5
          ​Of course not.

          But the scene is about 140MB on disk.

          What's the best way to share it? I've tried uploading files from the forum, but it fails.​

          Comment


          • #6
            Use the hyperlink I've already sent (hover over "send the scene" from the previous post).
            Aleksandar Hadzhiev | chaos.com
            Chaos Support Representative | contact us

            Comment


            • #7
              Thanks for the provided file. I noticed you had a hidden layer with many enabled V-Ray Lights which also contribute to the Lighting Analysis. Is this intentional?
              Aleksandar Hadzhiev | chaos.com
              Chaos Support Representative | contact us

              Comment


              • #8
                I managed to take a look at Dialux and made a comparison of my own. The values heavily depend on the surface material, which seems tricky to match, especially Dialux's Reflectivity factor, which is not the same as VRayMtl's reflection. Hence, I eyeballed it. Check the attached scenes - I'm getting somewhat similar results.

                Regarding my previous post, I'm nearly sure you have thought that hiding the layer will disable the lights, hence the high-value confusion. You need to disable them through the "Enable" checkbox. Another thing, I noticed your VRayIES light's "Use Light Shape" was set to shadows only. For such a comparison, you should you the shape for illumination, too. Also, according to the docs setting the Override Intensity to "Rescale" yields more accurate results.
                Attached Files
                Last edited by hermit.crab; 20-03-2025, 06:39 AM.
                Aleksandar Hadzhiev | chaos.com
                Chaos Support Representative | contact us

                Comment


                • #9
                  Silly me...
                  That layer with the hidden lights was the whole problem.

                  Thank you very much.

                  With these values, I can continue working.​

                  Comment


                  • #10
                    If you need to do proper analysis I suggest you look at Radiance software. I created my own analysis tools using Rhinoceros + Grasshopper + Honeybee/LadyBug (with Radiance). This allows me to do shadow/light calculations and illumination studies, with all the data ready for visualizing however you want it to, extremely powerful.
                    A.

                    ---------------------
                    www.digitaltwins.be

                    Comment

                    Working...
                    X