-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image-based lighting #7172
Image-based lighting #7172
Conversation
Add octahedral projection
Fix artifacts with Octahedral Projection
This reverts commit ec89263.
Fix Octahedral sampling artifacts
Add Trilinear Filtering to Octahedral Maps
The lighting orientation looks wrong in the NYC tileset compared to a model. After talking offline @bagnell thinks this is because the tiles don't have a model matrix and aren't sampling the environment map/spherical harmonics in the right direction. |
In this demo with two models added I see Demo. |
I think this is fine. The texture cache code looks good. |
This is what it looked like before: The reason is because the prototype wasn't using the BRDF LUT. You can see by commenting out this line: |
@lilleyse This is ready for another look. The only thing I didn't change was the model in the IBL example. I could barely see any reflection from the environment map on that helicopter model. |
@bagnell Try Pawns.glb.txt which cuts down on the sample model file size. |
@lilleyse This is ready for another review. If you think this is ready, I can update the Sandcastle example image and update CHANGES. |
Nothing else from me. 👍 |
@lilleyse The Sandcastle image and CHANGES have been updated. This should be ready to go. |
Hi, I was looking over the code (great work! 👍), as I'm looking to implement something similar, and was wondering about the spherical harmonics reconstruction in: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl From what I understand you are using the spherical harmonics generated with This means that reconstruction in the shader should be as simple as: As implemented here in the Filament engine: There is mention about Another thing I noticed is that One last thing you might not have been aware of is that in the metadata of the outputted |
We do bake the division by pi from Lambert in the SH coefficients by default. cmgen can be invoked with
|
Adds the ability to add image-based lighting to a model.
Model.sphericalHarmonicCoefficients
is a property that is an array of 9Cartesian3
coefficients used to evaluate the diffuse irradiance.Model.specularEnvironmentMaps
is a property that is a url to a KTX file that contains a cubmap of the specular contribution plus the specular convolution mipmap levels.TODO:
NOTE: This is a PR into thehdr
branch.