From 3ac79b2080fff384009d40660d48f099a46237e2 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 3 Mar 2025 16:11:12 +0800 Subject: [PATCH] initial projection material --- materials/capture_uv.mat | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 materials/capture_uv.mat diff --git a/materials/capture_uv.mat b/materials/capture_uv.mat new file mode 100644 index 00000000..cdb72bff --- /dev/null +++ b/materials/capture_uv.mat @@ -0,0 +1,24 @@ +material { + name : TextureProjection, + requires : [ position, uv0 ], + shadingModel : unlit, + doubleSided : true, + depthWrite : true, + depthCulling : true, + vertexDomain: object, + parameters : [ + { + type : sampler2d, + name : inputTexture + } + ], +} + +fragment { + void material(inout MaterialInputs material) { + prepareMaterial(material); + vec3 viewportCoord = getNormalizedViewportCoord(); + vec4 sampledColor = texture(materialParams_inputTexture, uvToRenderTargetUV(viewportCoord.xy)); + material.baseColor = sampledColor; + } +} \ No newline at end of file