playcanvas
Version:
PlayCanvas WebGL game engine
3 lines (2 loc) • 1.03 kB
TypeScript
declare const _default: "\n\n// convert clip space position into texture coordinates for sampling scene grab textures\nfn getGrabScreenPos(clipPos: vec4<f32>) -> vec2<f32> {\n var uv: vec2<f32> = (clipPos.xy / clipPos.w) * 0.5 + vec2<f32>(0.5);\n uv.y = 1.0 - uv.y;\n return uv;\n}\n\n// convert uv coordinates to sample image effect texture (render target texture rendered without\n// forward renderer which does the flip in the projection matrix)\nfn getImageEffectUV(uv: vec2<f32>) -> vec2<f32> {\n var modifiedUV: vec2<f32> = uv;\n modifiedUV.y = 1.0 - modifiedUV.y;\n return modifiedUV;\n}\n\n// types wrapped in size aligned structures to ensure correct alignment in uniform buffer arrays\nstruct WrappedF32 { @size(16) element: f32 }\nstruct WrappedI32 { @size(16) element: i32 }\nstruct WrappedU32 { @size(16) element: u32 }\nstruct WrappedVec2F { @size(16) element: vec2f }\nstruct WrappedVec2I { @size(16) element: vec2i }\nstruct WrappedVec2U { @size(16) element: vec2u }\n";
export default _default;