Is it possible to mix materials/lighting-models with TSL and nodes?

Hi! More a question about API because i’m new to it.
What i wanted: to mix a couple of materials on single surface
Like this demo for example Genuary 2022 - Day 7 - Sol LeWitt Wall Drawing

How i imagined it might work

const PBR1 = PhysicalLightingModel({metalness, roughness,...});
const PBR2 = PhysicalLightingModel({metalness1, roughness1,...});
const color3 = ToonLightingModel({params});
//.. or any other materials, lighting models we have in three.js
material.colorNode = mix(PBR1,PBR2,something);

I saw this node(?) PhysicalLightingModel in sources, but im not sure if it will ever be intended for such a usage? Or can we at least grab parts of it, like say PointLights or DirectionalLighting.
Or is it already possible and i just missed how to use it properly, i’d be grateful for help!
Wasnt able to find PhysicalLightingModel anywhere outside builtin materials.

Im just trying TSL and i love it, and want to switch completely to it, and by using this opportunity i’d like to thank everybody involved in its development!

3 Likes

Hi!
Good to see you :handshake:
Looking at the example with the ball, I would play with roughness and metalness nodes, or any appropriate nodes :thinking:

Picture:

Demo: https://codepen.io/prisoner849/full/GRVYdoG

3 Likes

Nice! Thank you! Didnt know you could change roughnessNodes separately. But can we also mix different materials?
Toon, Matcap, Lambert, NormalMaterial, Depth with Physical?