diff options
| author | hachem <im@hachem.wtf> | 2026-08-24 17:07:54 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-24 17:07:54 +0200 |
| commit | 06398a7a176e123506de6e8851866a8bec0b3427 (patch) | |
| tree | 7167ef4818f2c224840122961882efb5ec26c80b /assets/shaders/equirect_to_cubemap.slang | |
| parent | 1c85c2ecaa826afd8bf80f93741cf1b2deba5798 (diff) | |
[chore]: cleanup shaders
Diffstat (limited to 'assets/shaders/equirect_to_cubemap.slang')
| -rw-r--r-- | assets/shaders/equirect_to_cubemap.slang | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/assets/shaders/equirect_to_cubemap.slang b/assets/shaders/equirect_to_cubemap.slang index 9b2ea4b..510e6b0 100644 --- a/assets/shaders/equirect_to_cubemap.slang +++ b/assets/shaders/equirect_to_cubemap.slang @@ -1,5 +1,11 @@ -uniform float4x4 u_Projection; -uniform float4x4 u_View; +// Equirectangular HDRI -> cubemap face projection. NOTE: the OpenGL path uses the +// hand-written assets/shaders/EquirectToCubemap.glsl instead; this Slang version +// feeds the Vulkan cubemap bake (vulkan_cubemap.cpp), which binds the view / +// projection as a $Globals UBO. Kept as loose `uniform` globals (not a +// ConstantBuffer) so both paths bind them the same way. + +uniform float4x4 u_projection; +uniform float4x4 u_view; struct VSInput { float3 position : POSITION; }; struct VSOutput { float4 position : SV_Position; float3 worldPos : TEXCOORD0; }; @@ -9,7 +15,7 @@ VSOutput vertexMain(VSInput input) { VSOutput output; output.worldPos = input.position; - output.position = mul(u_Projection, mul(u_View, float4(input.position, 1.0))); + output.position = mul(u_projection, mul(u_view, float4(input.position, 1.0))); return output; } |
