Skip to content
Snippets Groups Projects
Commit f08729a4 authored by Alexander Rose's avatar Alexander Rose
Browse files

apply bumpiness as lightness with ignoreLight

parent a7c91257
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ Note that since we don't clearly distinguish between a public and private interf ...@@ -10,6 +10,7 @@ Note that since we don't clearly distinguish between a public and private interf
- Move or fly around the scene using keys - Move or fly around the scene using keys
- Pointer lock to look around scene - Pointer lock to look around scene
- Toggle spin/rock animation using keys - Toggle spin/rock animation using keys
- Apply bumpiness as lightness variation with `ignoreLight`
## [v3.32.0] - 2023-03-20 ## [v3.32.0] - 2023-03-20
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
export const apply_light_color = ` export const apply_light_color = `
#ifdef dIgnoreLight #ifdef dIgnoreLight
#ifdef bumpEnabled
if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {
material.rgb += fbm(vModelPosition * uBumpFrequency) * (uBumpAmplitude * bumpiness) / uBumpFrequency;
material.rgb -= bumpiness / (2.0 * uBumpFrequency);
}
#endif
gl_FragColor = material; gl_FragColor = material;
#else #else
#ifdef bumpEnabled #ifdef bumpEnabled
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment