53 lines
1.3 KiB
Plaintext
53 lines
1.3 KiB
Plaintext
material {
|
|
name : unlit,
|
|
requires : [ uv0 ],
|
|
parameters : [
|
|
{
|
|
type : sampler2d,
|
|
name : baseColorMap
|
|
},
|
|
{
|
|
type : float4,
|
|
name : baseColorFactor
|
|
},
|
|
{
|
|
type : int,
|
|
name : baseColorIndex
|
|
},
|
|
{
|
|
type: float2,
|
|
name: uvScale
|
|
}
|
|
],
|
|
depthWrite : true,
|
|
depthCulling : true,
|
|
shadingModel : unlit,
|
|
blending: transparent,
|
|
culling: none,
|
|
instanced: false,
|
|
vertexDomain: object,
|
|
}
|
|
|
|
fragment {
|
|
void material(inout MaterialInputs material) {
|
|
prepareMaterial(material);
|
|
material.baseColor = materialParams.baseColorFactor;
|
|
material.baseColor.rgb = material.baseColor.rgb * material.baseColor.a;
|
|
|
|
if (materialParams.baseColorIndex > -1) {
|
|
highp float2 uv = getUV0();
|
|
uv.y = 1.0 - uv.y;
|
|
uv *= materialParams.uvScale;
|
|
material.baseColor *= texture(materialParams_baseColorMap, uv);
|
|
}
|
|
}
|
|
}
|
|
|
|
vertex {
|
|
void materialVertex(inout MaterialVertexInputs material) {
|
|
float4 position = getPosition();
|
|
material.worldPosition = getWorldFromModelMatrix() * position;
|
|
}
|
|
}
|
|
|