// Fullscreen skybox cube. View/projection in a ConstantBuffer (UBO, binding 0) // so both backends drive it through the RHI; the cubemap is a sampler at binding 1. struct SkyboxU { float4x4 u_Projection; float4x4 u_View; }; ConstantBuffer sb; struct VSInput { float3 position : POSITION; }; struct VSOutput { float4 position : SV_Position; float3 texCoords : TEXCOORD0; }; [shader("vertex")] VSOutput vertexMain(VSInput input) { VSOutput output; output.texCoords = input.position; float4 pos = mul(sb.u_Projection, mul(sb.u_View, float4(input.position, 1.0))); output.position = pos.xyww; // force depth = 1 so the skybox stays behind everything return output; } SamplerCube u_Skybox; [shader("fragment")] float4 fragmentMain(VSOutput input) : SV_Target { return u_Skybox.Sample(input.texCoords); }