Files
filament/samples/materials/pointSprites.mat
2020-07-14 15:57:56 -07:00

30 lines
589 B
Plaintext

material {
name : PointSprites,
requires : [
custom0,
color
],
shadingModel : unlit,
blending : add,
parameters : [
{
type : sampler2d,
name : fade
}
]
}
vertex {
void materialVertex(inout MaterialVertexInputs material) {
gl_PointSize = getCustom0().r;
}
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
float L = texture(materialParams_fade, gl_PointCoord).r;
material.baseColor = getColor() * vec4(L, L, L, 1);
}
}