Code Monkey home page Code Monkey logo

Comments (5)

shunsukesaito avatar shunsukesaito commented on May 22, 2024 3

Good point! Indeed while they are both spherical harmonics, 1. is SH coefficients for illumination and 2. is the SH coefficients for transfer function. I attached the screenshot from the original Precomputed Radiance Transfer paper to give you the better overview of how the final color is computed. I would highly recommend checking out the paper to learn more about how it works.

image

from pifu.

shunsukesaito avatar shunsukesaito commented on May 22, 2024

It was a long time ago when I processed them. I dug my code base but couldn't find the code to process HDR images for this project. I must have used the following library (https://github.com/google/spherical-harmonics) for converting HDR into 2nd-order spherical harmonics and then did normalization of the coefficients to avoid saturation in the final rendered images. The results are all stored in ./env_sh.npy.

Based on my brief understanding of computer graphics, you have used PRT as well as the 163 "second-order spherical harmonics of indoor scene from HDRI Haven" to essentially light ("simulate light transport effects") the models from RenderPeople. Is this accurate?

No. PRT is intrinsic to geometry, meaning given any new light source represented by spherical harmonics, you can simulate light transport effect in real-time by taking inner product of PRT and illumination spherical harmonics. You can look into apps/render_data.py and apps/prt_util.py to get a better sense of how I use PRT and illumination spherical harmonics.

from pifu.

shunsukesaito avatar shunsukesaito commented on May 22, 2024

The fragment shader code is here

vec3 evaluateLightingModelPRT(mat3 prt)

from pifu.

gordon-lim avatar gordon-lim commented on May 22, 2024

Hi! I thank you sincerely for your reply. I have looked into the scripts you've mentioned but I'm still a bit confused... perhaps by the double mentioning of spherical harmonics in:

  1. prt_render.py and render_data.py for the 2nd-order spherical harmonics from HDRI Haven (/env_sh.npy)
    shs = np.load('./env_sh.npy')

and

  1. prt_util
    SH = getSHCoeffs(order, phi, theta)

So spherical harmonics seems to mean different things in both cases. Could you shed some light on this? Alternatively, I would also appreciate if you would refer to some other links/steps to take to study this further.

Thank you once again for your comprehensive reply and I hope to hear from you soon.

from pifu.

LogWell avatar LogWell commented on May 22, 2024

then did normalization of the coefficients to avoid saturation in the final rendered images

How to normalize the coefficient, thanks~

from pifu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.