rearrange source/header files for compatibility with CocoaPods Framework structure
This commit is contained in:
BIN
materials/image.filamat
Normal file
BIN
materials/image.filamat
Normal file
Binary file not shown.
BIN
materials/image.filamat.metal
Normal file
BIN
materials/image.filamat.metal
Normal file
Binary file not shown.
54
materials/image.mat
Normal file
54
materials/image.mat
Normal file
@@ -0,0 +1,54 @@
|
||||
material {
|
||||
name : Image,
|
||||
parameters : [
|
||||
{
|
||||
type : sampler2d,
|
||||
name : image
|
||||
},
|
||||
{
|
||||
type : mat4,
|
||||
name : transform,
|
||||
precision : high
|
||||
},
|
||||
{
|
||||
type : float3,
|
||||
name : backgroundColor
|
||||
},
|
||||
{
|
||||
type : int,
|
||||
name : showImage
|
||||
}
|
||||
],
|
||||
variables : [
|
||||
imageUV
|
||||
],
|
||||
vertexDomain : device,
|
||||
depthWrite : false,
|
||||
shadingModel : unlit,
|
||||
variantFilter : [ skinning, shadowReceiver, vsm ],
|
||||
culling: none
|
||||
}
|
||||
|
||||
vertex {
|
||||
void materialVertex(inout MaterialVertexInputs material) {
|
||||
material.imageUV.st = getPosition().st * 0.5 + 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
fragment {
|
||||
void material(inout MaterialInputs material) {
|
||||
prepareMaterial(material);
|
||||
|
||||
vec4 bg = vec4(materialParams.backgroundColor, 1.0);
|
||||
highp vec2 uv = (materialParams.transform * vec4(saturate(variable_imageUV.st), 1.0, 1.0)).st;
|
||||
if (materialParams.showImage == 0 || uv.s > 1.0 || uv.s < 0.0 || uv.t < 0.0 || uv.t > 1.0) {
|
||||
material.baseColor = bg;
|
||||
} else {
|
||||
uv.t = 1.0 - uv.t;
|
||||
vec4 color = max(texture(materialParams_image, uv.st), 0.0);
|
||||
color.rgb *= color.a;
|
||||
// Manual, pre-multiplied srcOver with opaque destination optimization
|
||||
material.baseColor.rgb = color.rgb + bg.rgb * (1.0 - color.a);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,6 @@ flutter:
|
||||
pluginClass: PolyvoxFilamentPlugin
|
||||
package: app.polyvox.filament
|
||||
ios:
|
||||
pluginClass: PolyvoxFilamentPlugin
|
||||
pluginClass: SwiftPolyvoxFilamentPlugin
|
||||
windows:
|
||||
pluginClass: PolyvoxFilamentPlugin
|
||||
pluginClass: PolyvoxFilamentPlugin
|
||||
|
||||
Reference in New Issue
Block a user