Ok, I’ve spent more time fiddling around with this and I seem to have cracked it (But I don’t totally remember what i’m doing differently now)
For anyone having issues with pushing your own parameters to custom shader chunks with playmaker, here is my current working solution:
frag shader:
uniform vec3 material_diffuse;
uniform sampler2D texture_diffuseMap;
//CUSTOM PARAMETERS//
uniform sampler2D uTexMap1;
uniform sampler2D uTexMap2;
uniform float utest;
//////////////////////
void getAlbedo() {
dAlbedo = material_diffuse;
#ifdef MAPTEXTURE
vec3 TexCol = texture2DSRGB(uTexMap1, $UV).$CH;
TexCol += (texture2DSRGB(uTexMap2, $UV).$CH)*.5;
dAlbedo *= TexCol*utest;
#endif
//dAlbedo = material_diffuse.rgb;
}
.JS:
var MaterialReplaceChunk = pc.createScript('materialReplaceChunk');
MaterialReplaceChunk.attributes.add('material', {
type: 'asset',
assetType: 'material'
});
MaterialReplaceChunk.attributes.add('fragshader', {
type: 'asset',
assetType: 'shader',
title: 'Fragment Shader'
});
///////////////ATTRIBUTES/////////////////
MaterialReplaceChunk.attributes.add('TexMap', { type: 'asset', assetType: 'texture'});
MaterialReplaceChunk.attributes.add('TexMap2', { type: 'asset', assetType: 'texture'});
/////////////////////////////////////////
MaterialReplaceChunk.prototype.initialize = function() {
this.onShaderLoad();
if (this.fragshader)
this.fragshader.on('load', this.onShaderLoad, this);
this.on('attr:fragshader', function(value, valueOld) {
if (valueOld)
valueOld.off('load', this.onShaderLoad, this);
if (value)
value.on('load', this.onShaderLoad, this);
this.onShaderLoad();
});
this.on('attr:material', this.onShaderLoad, this);
};
MaterialReplaceChunk.prototype.onShaderLoad = function() {
if (! this.material)
return;
this.material.resource.chunks.diffusePS = this.fragshader && this.fragshader.resource || '';
//LOAD IN YOUR ATTRIBUTE PARAMETERS HERE
this.material.resource.setParameter('utest',1);
this.material.resource.setParameter('uTexMap1', this.TexMap.resource);
this.material.resource.setParameter('uTexMap2', this.TexMap2.resource);
/////////////////////////////////////////
console.log(this.material.resource.getParameter('uTexMap1'));
this.material.resource.update();
};
Instsructions:
In your assets folder create a .Js file, frag shader, material, and bring in 2 different textures.
Copy and paste the frag shader segment from above into the frag shader.
Copy and paste the JS segment above to the .Js file.
Add the JS script to an entity in the scene and parse it.
Add your frag shader, material and 2 textures to the attributes of the script.
IMPORTANT: Make sure you supply your material with an initial diffuse texture, this is what triggers the “#ifdef MAPTEXTURE” in the shader, without it you will get errors if no initial texture is defined, with it your object will just appear with the diffuse color and no textures when no initial texture is defined.
Now Add your material to any object in the scene.
When you hit launch you should see your object with the 2 textures blended together.
You will get errors if you don’t supply both texture parameters.
Hopefully this helps someone in future! Took me a while to get this working, and I still don’t totally understand but hopefully this is enough for what I need. 
Happy Playcanvas-ing!
Cheers,
Joe.