supermedium / aframe-environment-component

:sunrise_over_mountains: Infinite background environments for A-Frame in a line of HTML.
https://supermedium.com/aframe-environment-component/
MIT License
456 stars 112 forks source link

Replace luminance uniform with exposureBias avoiding name collision with Three.js luminance function #88

Closed mrxz closed 1 year ago

mrxz commented 1 year ago

This PR replaces the luminance uniform in the sky shader for an exposureBias uniform. This avoids a name collision with the luminance method in newer version of Three.js (part of common.glsl shader chunk).

Functionally it serves the same purpose, where exposureBias is easier to use for artistic purposes as it linearly adjusts the exposure. This means that lower values result in less exposure, and higher values in higher exposure. This in contrast with the previous luminance which was only valid for values between 0.0 and ~1.2, wasn't linear and resulted in less exposure for higher values.

The output is identical as before (with the default value of 1.0), so this PR doesn't change the default appearance of the skyshader. Note that the tone mapping logic isn't quite correct, so terms like "luminance" or "exposure" are as a result also not quite accurate for what they do.

Fixes #87

vincentfretin commented 1 year ago

Can you please update the index.html to use <script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script> Thanks

mrxz commented 1 year ago

Can you please update the index.html to use <script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script> Thanks

Done :-)

dmarcos commented 1 year ago

Thank you both!