archilogic-com / 3dio-js

JavaScript toolkit for interior apps
https://3d.io
MIT License
273 stars 73 forks source link

- Implemented saturation parameter for lightmaps [#85] #113

Closed Aadjou closed 4 years ago

Aadjou commented 6 years ago

Scope & Features:

How to use:

How to test:

Thanks

tomas-polach commented 6 years ago

I'm on it. Code looks good! I especially like that you are using weighted grayscale conversion instead of just using the mathematical RGB average in https://github.com/archilogic-com/3dio-js/pull/113/files#diff-4789112aae09f0bb59ea558bff779f98R168 Will give it some testing tomorrow.

tomas-polach commented 6 years ago

Works like a charm! :) One minor glitch: when using lightMapSaturation:0 the value automatically jumps to the default: 1.

Proposal: Using:

this.lightMapSaturation = params.lightMapSaturation  !== undefined ? params.lightMapSaturation : DEFAULT_LIGHT_MAP_SATURATION

in: https://github.com/archilogic-com/3dio-js/pull/113/files#diff-d00d2508afc2df8d84bea5785f0cffc3R26 and:

lightMapSaturation: { value: params.lightMapSaturation !== undefined ? params.lightMapSaturation : DEFAULT_LIGHT_MAP_SATURATION },

in https://github.com/archilogic-com/3dio-js/pull/113/files#diff-d00d2508afc2df8d84bea5785f0cffc3R39