Marcin Ignac
Marcin Ignac
Is it still relevant? What would be benefits of complicating pipeline and using another uniform vs current atlas where irradiance map is an octahedral map in the atlas' corner.
My latest preferred approach would be to have named hook/extension points + optional source string replacement like BabylonJS [Material Plugins](https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materialPlugins)  Curious how ThreeJS does it.
How would it work in practice? ```js entity.material = components.material({ type: 'standard', baseColor: [1, 0, 0, 1], vertHooks: { AFTER_DECLARATIONS: /*glsl*/` uniform vec2 uTextureScale; `, BEFORE_POSITIONOUT: /*glsl*/` vTexCoord0 *= uTextureScale;...
It's a simple solution that could be battle tested in the current project for smooth normals from vertex texture and reviewed afterwards. There is lot's of complications that are to...
Adding some examples for context # #include declaration ThreeJS > https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderLib/meshphong.glsl.js The fact that all those are globally defined with no path/source doesn't look like much fun to debug. ```js...
Is ShaderGraph goal https://nodetoy.co/ ?  ThreeJS Node Material There is also GLSL-in-JS https://github.com/mrdoob/three.js/tree/dev/examples/jsm/nodes but it's madness... although it allows compilation to both GLSL and...
TLDR: not aiming for fully dynamic gpu compute graphs, just avoiding yet-another-pbr-version-with-this-one-small-change To answer concern about hooks > naming things is hard, no way I'll remember these names without checking...
As predicted naming is hard... in glsl mark place for code injection ```glsl #define HOOK_VERT_DECLARATIONS_END ``` and then in material js code ```js hooks: { vert: { HOOK_VERT_DECLARATIONS_END: `?`, VERT_DECLARATIONS_END:...
[EXT_sRGB](https://registry.khronos.org/webgl/extensions/EXT_sRGB/) is included in core in WebGL2 which allows you to autoconver all srgb textures before sampling and no more toLinear calling is needed. So changing all uniform colors to...
Another reason to deprecate WebGL1 in v4