x3dom / x3dom

X3DOM. A framework for integrating and manipulating X3D scenes as HTML5/DOM elements.
http://x3dom.org
Other
815 stars 271 forks source link

Fog plus height and noise #1313

Open dmorehead opened 8 months ago

dmorehead commented 8 months ago

Optional fogHeight and fogNoise. Not setting them will maintain the original fog behavior. The height is best seen when lowering the visibility range. here is a working pen. https://codepen.io/mrmernan/pen/KKbYrdJ

andreasplesch commented 8 months ago

Please resolve conflicts. Probably easiest to git pull or sync master from github, and use a new branch.

andreasplesch commented 8 months ago

Do you think it is possible to directly use fogHeight to normalize the WS .y component, rather than fogRange ? It would be good to decouple vertical fog gradients from view direction fog gradients.

dmorehead commented 8 months ago

good suggestion, normalized fogHeight separately from fogRange. Its a bit less code and the result seems more visually predictable. Also updated the pen with these changes (codepen has a 1MB limit so I've only included x3dom.js, not x3dom-full.js)

andreasplesch commented 8 months ago

good suggestion, normalized fogHeight separately from fogRange. Its a bit less code and the result seems more visually predictable. Also updated the pen with these changes (codepen has a 1MB limit so I've only included x3dom.js, not x3dom-full.js)

The pen looks good. Did you want to incorporate these changes in the PR as well, eg. commit them to the branch ?