// This file is part of the 64k demo project. // It defines WGSL shader code for various effects. #include "../demo_effects.h" #include "generated/assets.h" #include "gpu/effects/shader_composer.h" #include "util/asset_manager.h" void InitShaderComposer() { auto& sc = ShaderComposer::Get(); sc.RegisterSnippet("common_uniforms", (const char*)GetAsset(AssetId::ASSET_SHADER_COMMON_UNIFORMS)); sc.RegisterSnippet("sdf_primitives", (const char*)GetAsset(AssetId::ASSET_SHADER_SDF_PRIMITIVES)); sc.RegisterSnippet("lighting", (const char*)GetAsset(AssetId::ASSET_SHADER_LIGHTING)); sc.RegisterSnippet("ray_box", (const char*)GetAsset(AssetId::ASSET_SHADER_RAY_BOX)); } const char* main_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_MAIN); const char* particle_compute_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_PARTICLE_COMPUTE); const char* particle_render_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_PARTICLE_RENDER); const char* passthrough_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_PASSTHROUGH); const char* ellipse_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_ELLIPSE); const char* particle_spray_compute_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_PARTICLE_SPRAY_COMPUTE); const char* gaussian_blur_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_GAUSSIAN_BLUR); const char* solarize_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_SOLARIZE); const char* distort_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_DISTORT); const char* chroma_aberration_shader_wgsl = (const char*)GetAsset(AssetId::ASSET_SHADER_CHROMA_ABERRATION);