Flag generator inside shader with procedural GPU instance or full cloth simulation, single or atlas texture compatible, with its own Atlas Generator, Instance script for per object material featuresOnly for:URP 14+Unity 6Not tested in Unity 2022.x!What is Flag Master?A shader that generates the flag out of nothing!Every feature can be stripped down in the material settings!A "per object instance" component that controls the features of the shaderIts own smart Atlas Generator to generate your own PBR AtlasSimulationProcedural GPU vertex wave (primary wave + gust layer)GPU cloth simulation (compute shader, Verlet, substeps, solver iterations)Stretch factor, material stiffness, damping, gravityTwist limit around the mast with falloff curveFollow object, vertex speed cap, teleport handlingPseudo gravity, bend spread, bend curveWindUnity WindZone support (turbulence, pulse, strength)Wind sensitivityWind Director componentPer instance desync: seed, time spread, speed variationWind lag, yaw/pitch jitter, local gust, exposure, sensitivity variationWind travel across a row of flagsSetupGrid mesh generator, 2 to 128 subdivisions, shared mesh cachePlane scale X/Y6 attach modes: Left, Top, Right, Bottom, Top+Bottom, Left+RightPivot modes: Center, Seam, Manual, with seam anchorsScene view gizmos for wind, pivot and seamsAtlasAtlas Generator and Baker1x1, 1x2, 2x2 blocks, per instance atlas indexExample textures included (albedo and normals)Shading (URP Lit)Albedo, normal, metallic/smoothness, emission mapsAlbedo to smoothness / metallic, invert optionsOcclusion tint and strengthTranslucency with mask, distortion, power, backlit modeSelf shadow (procedural mode)Cast shadow strength and mask influenceBurned holes and edge burnDouble sided with backface flipOpaque, cutout and transparent render modesRenderingForward and Deferred renderer supportFull pass set: shadows, depth, depth normals, scene selection, pickingMotion vectors for TAA, motion blur, DLSS, FSR, STPXR motion vectors (Application SpaceWarp)Lightmaps, probe volumes, decals, SSAO, light cookies, light layersPerformanceGPU Instancing and SRP Batching, auto detected per materialMaterialPropertyBlock driven per object dataCustom shader GUI with per material feature strippingScales from Switch to PC and consolesIMPORTANT: The shader reads a single PBR flag texture set, or just the albedo if you have nothing else, or an atlased PBR texture set with many flags packed into one atlas. The FlagMaster package ships with a few example textures for the Atlas Generator, albedo and normals only. Your own flag textures are up to you, either from an artist or from AI image generation.Be aware that you need to know how to author a PBR texture set. If you don't, an albedo/diffuse texture is the minimum, both for the Atlas Generator and for the shader itself. In that case you lose the PBR capabilities.Else, you get a full blown flag system that can be stripped down in its material settings to the minimum of just having an abledo with no other effect, procedural, which gives you the possiblity to set hundrets of flags via GPU instancing, working on mobile too.PipelineUniversal Render Pipeline only, Unity 6 (developed on 6.4 LTS)Forward, Forward+ and Deferred renderer pathsShader target 4.5ForwardLit pass tagged UniversalForwardOnly, DepthNormals tagged DepthNormalsOnlyShader passesForwardLit, ShadowCaster, DepthOnly, DepthNormalsMotionVectors, XRMotionVectorsSceneSelection and Picking (editor only, stripped from builds)Identical vertex deformation across all passes, single shared sourceCloth solverCompute shader, 6 kernels, 256 threads per groupVerlet integration with distance, shear and bend constraintsConfigurable substeps (1 to 8) and solver iterations (1 to 32)Ping pong buffers, scheduling independent and frame deterministic8 ComputeBuffers per flag instance, float3 world space positionsNormals and tangents computed on the GPUNo CPU readback, no runtime mesh writesRequires SystemInfo.supportsComputeShaders, falls back with a clear warningMeshRuntime generated grid, 2 to 128 subdivisions per axisVertex count = (subdivisionsX + 1) × (subdivisionsY + 1), up to 16,641Static mesh cache shared across all instances of the same resolutionBatchingProcedural mode: GPU Instancing via MaterialPropertyBlock, or SRP Batching via material instance, auto detected from the materialCloth mode: one draw call per flag, batching disabled by designInstanced properties packed to minimise per instance constant buffer sizeMotion vectorsPer object motion vector generation mode set automaticallyProcedural: previous frame reconstructed from previous time, wind and object matrixCloth: dedicated frame history buffer taken before the first substepCompatible with TAA, motion blur, DLSS, FSR and STPKeywords and strippingAll feature keywords are shader_feature_localPer material stripping checkboxes in the custom shader GUIUnused features compile out completely, including their interpolatorsCodeC# with assembly definitions, runtime and editor separatedExecuteAlways component, full edit mode previewNo coroutines, no per frame allocations, cached property IDsGlobal fallback buffers for material previews, thumbnails and picking

