contributor_docs/project_wrapups/aryan_koundal_gsoc_2023.md
In p5.js, there are two render modes: P2D (default renderer) and WebGL. WEBGL enables the user to draw in 3D. There are many ways to implement lighting. Currently, p5js has implemented 8. To add lighting to a 3D object, one can use these functionalities. But there is another technique to light objects, not by direct light, but using the surrounding environment as a single light source, which we call Image-Based lighting. This project aims to add lighting to a 3D object, using the surrounding environment as a single light source, which is generally called Image-Based lighting. In simple words, one can very quickly drop in an image from real life to use as surrounding lights, rather than continuously tweaking the colors and positions of ambient, point, etc lights.
The project is completed and here are some screenshots and videos demonstrating the work.
https://github.com/processing/p5.js/assets/77334487/44b30c77-33c1-41d0-ada5-282424978832
https://github.com/processing/p5.js/assets/77334487/a0a6b3f9-b25b-451f-961e-b2970cb9e907
imageLight() which provides the whole functionality.imageLight() are also included in this files.getDiffusedTexture() which gets called from _setImageLightUniforms. It's function is to create a blurry
image from the input non blurry img, if it doesn't already exist.getSpecularTexture() which also gets called from _setImageLightUniforms. It's function is too create a texture
from the input non blurry image, if it doesn't already exist_setImageLightUniforms(). It creates the textures and sets those textures in the shader being processed.MipmapTexture class.HammersleyNoBitOps() , VanDerCorput()and ImportanceSampleGGX() which are
referenced from "https://learnopengl.com/PBR/IBL/Specular-IBL"calculateImageDiffuse() and calculateImageSpecular() which actually calculates the output textures. These are calculated only when imageLight() is called.While working on this project, I realised that there is scope for improvement. Like increasing efficiency by using cubemaps instead of environment maps for Diffused Lighting. Also using framebuffers would improve the efficiency and reduce the time taken to render the lights.
My GSoC experience was genuinely transformative, leading to significant personal and professional development within the open-source domain. I successfully overcame initial obstacles related to setting up the project and navigating the codebase, steadily advancing through my contributions. Throughout this summer, I actively participated in the p5.js open-source community, surpassing my initial expectations for my first major open-source venture and further igniting my enthusiasm. I want to express my heartfelt appreciation to my mentors, Dave Pagurek(@davepagurek ), and Tanvi Kumar(@TanviKumar ), for their invaluable guidance in navigating coding challenges. Effective teamwork, collaboration, and communication proved essential in this open-source journey. I eagerly anticipate expanding my contributions and honing my skills. This summer has instilled a sense of purpose in me, and I'm profoundly grateful for the mentorship and knowledge gained.