Specular shader chunk


#1

Hello, i want to apply more than one metalic map to a material.
So i can have multiple stripes of “metal” in a model. And also remove them individually.

I added color stripes editing this chunk.

But i cant do the same for this chunk https://github.com/playcanvas/engine/blob/master/src/graphics/program-lib/chunks/metalness.frag

I believe my problem is i dont know what to override.
In the diffuse was this.material.chunks.diffusePS = this.shader_diffuseConstPS.resource.
Of course if a override the diffusePS with a specular gives an error. But i tried specularPS and other variations and it gets ignored.

Clearly i am really ignorant in this topic. But i dont know where to look for more info.

Thanks.


#2

Pardon my ignorance on your project, but wouldn’t it be a bit easier to just have one material with a varying metalness and specular map to fake two or more different metals?


#3

For sure that sounds easier, but how you assign one material with more than one metalness?