├── .clang-format ├── .editorconfig ├── .github └── workflows │ ├── CI.yml │ └── Documentation.yml ├── .gitignore ├── LICENSE ├── README.md ├── docs ├── .nojekyll ├── Doxyfile ├── img │ ├── atmosphere.png │ ├── brdfpreproc.png │ ├── controllermap.png │ ├── header.png │ ├── imagefiltering.png │ ├── imageviewer.png │ ├── island.png │ ├── pathtracer.png │ ├── pbrdemo.png │ ├── playground.png │ ├── shaderbench.png │ ├── shadervalidator.png │ ├── snake.png │ └── stencil.png ├── index.html ├── index_local.html └── theme │ ├── DoxygenLayout.xml │ ├── customdoxygen.css │ ├── footer.html │ └── process-glsl.py ├── premake5.lua ├── resources ├── atmosphere │ └── shaders │ │ └── atmosphere_params.frag ├── common │ ├── ControllerLayout.png │ ├── Lato-Regular.ttf │ ├── OpenFontLicense.txt │ ├── brdf-precomputed.exr │ ├── controller_ps4.map │ ├── debug-cube │ │ ├── debug-cube_nx.png │ │ ├── debug-cube_ny.png │ │ ├── debug-cube_nz.png │ │ ├── debug-cube_px.png │ │ ├── debug-cube_py.png │ │ └── debug-cube_pz.png │ ├── debug-grid.png │ ├── default_color.png │ ├── default_cube │ │ ├── default_cube_nx.png │ │ ├── default_cube_ny.png │ │ ├── default_cube_nz.png │ │ ├── default_cube_px.png │ │ ├── default_cube_py.png │ │ ├── default_cube_pz.png │ │ └── default_shcoeffs.txt │ ├── default_normal.png │ ├── default_rough_met_ao.png │ ├── meshes │ │ ├── cube.obj │ │ ├── disk.obj │ │ ├── light_arrow.obj │ │ ├── light_cone.obj │ │ ├── light_sphere.obj │ │ ├── plane.obj │ │ ├── skybox.obj │ │ ├── sphere.obj │ │ ├── testknob.obj │ │ └── two_rooms.obj │ ├── scattering-precomputed.exr │ └── shaders │ │ ├── background │ │ ├── atmosphere.glsl │ │ ├── atmosphere_debug.frag │ │ ├── background_infinity.frag │ │ ├── background_infinity.vert │ │ ├── probe_debug.frag │ │ ├── probe_debug.vert │ │ ├── skybox_basic.frag │ │ ├── skybox_basic.vert │ │ ├── skybox_infinity.vert │ │ └── skybox_shcoeffs.frag │ │ ├── colors.glsl │ │ ├── constants.glsl │ │ ├── geometry.glsl │ │ ├── lights │ │ ├── light_debug.frag │ │ ├── light_shadow_basic.frag │ │ ├── light_shadow_linear_basic.frag │ │ ├── light_shadow_linear_variance.frag │ │ ├── light_shadow_linear_vertex.vert │ │ ├── light_shadow_variance.frag │ │ ├── light_shadow_vertex.vert │ │ └── shadow_maps.glsl │ │ ├── objects │ │ ├── common_parallax.glsl │ │ ├── common_pbr.glsl │ │ ├── object_basic.vert │ │ ├── object_basic_color.frag │ │ ├── object_basic_color.vert │ │ ├── object_basic_lit.frag │ │ ├── object_basic_lit.vert │ │ ├── object_basic_lit_texture.frag │ │ ├── object_basic_lit_texture.vert │ │ ├── object_basic_random.vert │ │ ├── object_basic_texture.frag │ │ ├── object_basic_texture.vert │ │ └── object_basic_uniform.frag │ │ ├── samplers.glsl │ │ ├── screens │ │ ├── bilateral.frag │ │ ├── bloom.frag │ │ ├── blur-dual-filter-down.frag │ │ ├── blur-dual-filter-up.frag │ │ ├── blur-gaussian.frag │ │ ├── box-blur │ │ │ ├── box-blur-2d-approx.frag │ │ │ ├── box-blur-2d-array-approx.frag │ │ │ ├── box-blur-2d-array.frag │ │ │ ├── box-blur-2d.frag │ │ │ ├── box-blur-cube-approx.frag │ │ │ ├── box-blur-cube-array-approx.frag │ │ │ ├── box-blur-cube-array.frag │ │ │ ├── box-blur-cube.frag │ │ │ └── box-blur-cube.vert │ │ ├── convolution-pyramid │ │ │ ├── downscale.frag │ │ │ ├── fill-boundary.frag │ │ │ ├── fill-combine.frag │ │ │ ├── filter.frag │ │ │ ├── laplacian.frag │ │ │ ├── passthrough-shift.frag │ │ │ └── upscale.frag │ │ ├── dof-coc.frag │ │ ├── dof-composite.frag │ │ ├── dof-gather.frag │ │ ├── fill-color.frag │ │ ├── floodfill │ │ │ ├── color-seeds.frag │ │ │ ├── distance-seeds.frag │ │ │ ├── extract-seeds.frag │ │ │ └── flood-fill.frag │ │ ├── fxaa.frag │ │ ├── passthrough-pixelperfect.frag │ │ ├── passthrough.frag │ │ ├── passthrough.vert │ │ ├── scale-texture.frag │ │ ├── sharpening.frag │ │ ├── ssao.frag │ │ └── tonemap.frag │ │ ├── utils.glsl │ │ └── utils │ │ ├── debug_texture_display.frag │ │ ├── font_sdf.frag │ │ └── font_sdf.vert ├── imagefiltering │ └── shaders │ │ ├── brush_color.frag │ │ └── brush_color.vert ├── imageviewer │ └── shaders │ │ ├── image_display.frag │ │ └── image_display.vert ├── island │ ├── shaders │ │ ├── atmosphere_island.frag │ │ ├── far_ocean_island.vert │ │ ├── gerstner_waves.glsl │ │ ├── ground_island.frag │ │ ├── ground_island.vert │ │ ├── ocean_island.frag │ │ ├── ocean_island.tessc │ │ ├── ocean_island.tesse │ │ ├── ocean_island.vert │ │ ├── ocean_underwater.frag │ │ ├── shadow_island.frag │ │ └── water_copy.frag │ └── textures │ │ ├── absorbscatterwater.png │ │ ├── caustics.png │ │ ├── foam.png │ │ ├── island_material_diff_s0.jpg │ │ ├── island_material_diff_s1.jpg │ │ ├── island_material_diff_s2.jpg │ │ ├── island_material_diff_s3.jpg │ │ ├── island_material_diff_s4.jpg │ │ ├── island_material_nor_s0.jpg │ │ ├── island_material_nor_s1.jpg │ │ ├── island_material_nor_s2.jpg │ │ ├── island_material_nor_s3.jpg │ │ ├── island_material_nor_s4.jpg │ │ ├── sand_normal_flat.jpg │ │ ├── sand_normal_steep.jpg │ │ └── wave_normals.jpg ├── pbrdemo │ ├── boxes.scene │ ├── cornellbox-cutout.scene │ ├── cornellbox-emissive.scene │ ├── cornellbox-parallax.scene │ ├── cornellbox-reflections.scene │ ├── cornellbox-textured.scene │ ├── cornellbox-transparent.scene │ ├── cornellbox.scene │ ├── cornellbox │ │ ├── cornellbox_backWall_12.obj │ │ ├── cornellbox_ceiling_6.obj │ │ ├── cornellbox_floor_0.obj │ │ ├── cornellbox_largeBox_60.obj │ │ ├── cornellbox_leaves.obj │ │ ├── cornellbox_leftWall_24.obj │ │ ├── cornellbox_light_90.obj │ │ ├── cornellbox_rightWall_18.obj │ │ ├── cornellbox_smallBox_30.obj │ │ ├── cornellbox_sphere.obj │ │ └── cornellbox_vase.obj │ ├── cubemaps │ │ ├── grey_cube │ │ │ ├── grey_cube_0_nx.exr │ │ │ ├── grey_cube_0_ny.exr │ │ │ ├── grey_cube_0_nz.exr │ │ │ ├── grey_cube_0_px.exr │ │ │ ├── grey_cube_0_py.exr │ │ │ ├── grey_cube_0_pz.exr │ │ │ ├── grey_cube_1_nx.exr │ │ │ ├── grey_cube_1_ny.exr │ │ │ ├── grey_cube_1_nz.exr │ │ │ ├── grey_cube_1_px.exr │ │ │ ├── grey_cube_1_py.exr │ │ │ ├── grey_cube_1_pz.exr │ │ │ └── grey_cube_shcoeffs.txt │ │ └── kiara_dawn │ │ │ ├── kiara_dawn_0_nx.exr │ │ │ ├── kiara_dawn_0_ny.exr │ │ │ ├── kiara_dawn_0_nz.exr │ │ │ ├── kiara_dawn_0_px.exr │ │ │ ├── kiara_dawn_0_py.exr │ │ │ ├── kiara_dawn_0_pz.exr │ │ │ ├── kiara_dawn_1_nx.exr │ │ │ ├── kiara_dawn_1_ny.exr │ │ │ ├── kiara_dawn_1_nz.exr │ │ │ ├── kiara_dawn_1_px.exr │ │ │ ├── kiara_dawn_1_py.exr │ │ │ ├── kiara_dawn_1_pz.exr │ │ │ ├── kiara_dawn_2_nx.exr │ │ │ ├── kiara_dawn_2_ny.exr │ │ │ ├── kiara_dawn_2_nz.exr │ │ │ ├── kiara_dawn_2_px.exr │ │ │ ├── kiara_dawn_2_py.exr │ │ │ ├── kiara_dawn_2_pz.exr │ │ │ ├── kiara_dawn_3_nx.exr │ │ │ ├── kiara_dawn_3_ny.exr │ │ │ ├── kiara_dawn_3_nz.exr │ │ │ ├── kiara_dawn_3_px.exr │ │ │ ├── kiara_dawn_3_py.exr │ │ │ ├── kiara_dawn_3_pz.exr │ │ │ ├── kiara_dawn_4_nx.exr │ │ │ ├── kiara_dawn_4_ny.exr │ │ │ ├── kiara_dawn_4_nz.exr │ │ │ ├── kiara_dawn_4_px.exr │ │ │ ├── kiara_dawn_4_py.exr │ │ │ ├── kiara_dawn_4_pz.exr │ │ │ ├── kiara_dawn_5_nx.exr │ │ │ ├── kiara_dawn_5_ny.exr │ │ │ ├── kiara_dawn_5_nz.exr │ │ │ ├── kiara_dawn_5_px.exr │ │ │ ├── kiara_dawn_5_py.exr │ │ │ ├── kiara_dawn_5_pz.exr │ │ │ └── kiara_dawn_shcoeffs.txt │ ├── furnace-test.scene │ ├── gallery-materials.scene │ ├── groundplane.obj │ ├── multi-probes.scene │ ├── parameter-spheres.scene │ ├── shaders │ │ ├── brdf_sampler.frag │ │ ├── cubemap_convo.frag │ │ ├── deferred │ │ │ ├── atmosphere_gbuffer.frag │ │ │ ├── background_gbuffer.frag │ │ │ ├── directional_light_pbr.frag │ │ │ ├── object_anisotropic_gbuffer.frag │ │ │ ├── object_clearcoat_gbuffer.frag │ │ │ ├── object_emissive_gbuffer.frag │ │ │ ├── object_gbuffer.frag │ │ │ ├── object_gbuffer.vert │ │ │ ├── object_iridescent_gbuffer.frag │ │ │ ├── object_parallax_gbuffer.frag │ │ │ ├── object_parallax_gbuffer.vert │ │ │ ├── object_sheen_gbuffer.frag │ │ │ ├── object_subsurface_gbuffer.frag │ │ │ ├── point_light_pbr.frag │ │ │ ├── probe_normalization.frag │ │ │ ├── probe_pbr.frag │ │ │ ├── skybox_gbuffer.frag │ │ │ └── spot_light_pbr.frag │ │ ├── forward │ │ │ ├── atmosphere_forward.frag │ │ │ ├── background_forward.frag │ │ │ ├── forward_lights.glsl │ │ │ ├── object_anisotropic_forward.frag │ │ │ ├── object_clearcoat_forward.frag │ │ │ ├── object_emissive_forward.frag │ │ │ ├── object_forward.frag │ │ │ ├── object_forward.vert │ │ │ ├── object_iridescent_forward.frag │ │ │ ├── object_parallax_forward.frag │ │ │ ├── object_parallax_forward.vert │ │ │ ├── object_prepass_forward.frag │ │ │ ├── object_prepass_forward.vert │ │ │ ├── object_sheen_forward.frag │ │ │ ├── object_subsurface_forward.frag │ │ │ ├── object_transparent_forward.frag │ │ │ ├── object_transparent_irid_forward.frag │ │ │ └── skybox_forward.frag │ │ ├── irradiance_compute.comp │ │ ├── materials.glsl │ │ └── radiance_convo.comp │ └── textures │ │ ├── ceramic_tiles_blue_color.jpg │ │ ├── ceramic_tiles_blue_normal.jpg │ │ ├── ceramic_tiles_blue_rough_met_ao.jpg │ │ ├── cornellbox_blue.png │ │ ├── cornellbox_green.png │ │ ├── cornellbox_grey.png │ │ ├── cornellbox_orange.png │ │ ├── cornellbox_red.png │ │ ├── cornellbox_rough_met_ao.png │ │ ├── cornellbox_white.png │ │ ├── ground_leaves_color.jpg │ │ ├── ground_leaves_depth.jpg │ │ ├── ground_leaves_normal.jpg │ │ ├── ground_leaves_rough_met_ao.jpg │ │ ├── leather_color.jpg │ │ ├── leather_depth.jpg │ │ ├── leather_normal.jpg │ │ ├── leather_rough_met_ao.jpg │ │ ├── leaves_color.png │ │ ├── leaves_normal.jpg │ │ ├── leaves_rough_met_ao.jpg │ │ ├── light_grid.exr │ │ ├── metal_brushed_color.jpg │ │ ├── metal_brushed_normal.jpg │ │ ├── metal_brushed_rough_met_ao.jpg │ │ ├── plastic_color.jpg │ │ ├── plastic_normal.jpg │ │ ├── plastic_rough_met_ao.jpg │ │ ├── squares_rough_met_ao.png │ │ ├── vitrail_color.png │ │ ├── vitrail_normal.png │ │ ├── vitrail_rough_met_ao.png │ │ ├── wood_floor_color.jpg │ │ ├── wood_floor_normal.jpg │ │ └── wood_floor_rough_met_ao.jpg ├── shaderbench │ ├── examples │ │ ├── dragon.frag │ │ ├── noise.frag │ │ └── shaderwave.frag │ ├── non-2d-texture.png │ ├── shaders │ │ ├── shaderbench.frag │ │ └── shaderbench.vert │ └── shadertoy-font.png └── snakegame │ ├── buttons │ ├── rounded-button-in.obj │ ├── rounded-button-out.obj │ ├── rounded-checkbox-in.obj │ └── rounded-checkbox-out.obj │ ├── cubemap │ ├── env_nx.png │ ├── env_ny.png │ ├── env_nz.png │ ├── env_px.png │ ├── env_py.png │ └── env_pz.png │ ├── digits.fnt │ ├── digits_font_atlas.png │ ├── ingame │ ├── body.obj │ ├── ground.obj │ └── head.obj │ ├── menubg.png │ ├── shaders │ ├── colored_object.frag │ ├── colored_object.vert │ ├── game_composite.frag │ ├── menu_button.frag │ ├── menu_button.vert │ ├── menu_image.frag │ └── menu_image.vert │ ├── texts │ ├── button-back.png │ ├── button-fullscreen.png │ ├── button-halfres.png │ ├── button-menu.png │ ├── button-newgame.png │ ├── button-options.png │ ├── button-quit.png │ ├── button-resume.png │ └── button-vsync.png │ └── titles │ ├── title-dead.png │ ├── title-options.png │ ├── title-pause.png │ └── title.png └── src ├── apps ├── atmosphere │ ├── AtmosphereApp.cpp │ ├── AtmosphereApp.hpp │ └── main.cpp ├── imagefiltering │ ├── FilteringApp.cpp │ ├── FilteringApp.hpp │ ├── PaintingTool.cpp │ ├── PaintingTool.hpp │ └── main.cpp ├── island │ ├── IslandApp.cpp │ ├── IslandApp.hpp │ ├── Terrain.cpp │ ├── Terrain.hpp │ └── main.cpp ├── pathtracer │ ├── BVHRenderer.cpp │ ├── BVHRenderer.hpp │ ├── MaterialGGX.cpp │ ├── MaterialGGX.hpp │ ├── MaterialSky.cpp │ ├── MaterialSky.hpp │ ├── PathTracer.cpp │ ├── PathTracer.hpp │ ├── PathTracerApp.cpp │ ├── PathTracerApp.hpp │ └── main.cpp ├── pbrdemo │ ├── DebugRenderer.cpp │ ├── DebugRenderer.hpp │ ├── DeferredLight.cpp │ ├── DeferredLight.hpp │ ├── DeferredRenderer.cpp │ ├── DeferredRenderer.hpp │ ├── ForwardLight.cpp │ ├── ForwardLight.hpp │ ├── ForwardRenderer.cpp │ ├── ForwardRenderer.hpp │ ├── PBRDemo.cpp │ ├── PBRDemo.hpp │ ├── PostProcessStack.cpp │ ├── PostProcessStack.hpp │ └── main.cpp ├── playground │ └── main.cpp ├── shaderbench │ ├── ShaderEditor.cpp │ ├── ShaderEditor.hpp │ └── main.cpp ├── snakegame │ ├── Game.cpp │ ├── Game.hpp │ ├── GameMenu.cpp │ ├── GameMenu.hpp │ ├── GameMenuRenderer.cpp │ ├── GameMenuRenderer.hpp │ ├── GameRenderer.cpp │ ├── GameRenderer.hpp │ ├── Player.cpp │ ├── Player.hpp │ └── main.cpp └── stenciled │ ├── StenciledApp.cpp │ ├── StenciledApp.hpp │ ├── StenciledRenderer.cpp │ ├── StenciledRenderer.hpp │ └── main.cpp ├── engine ├── Application.cpp ├── Application.hpp ├── Common.hpp ├── Documentation.hpp ├── generation │ ├── PerlinNoise.cpp │ ├── PerlinNoise.hpp │ ├── Random.cpp │ └── Random.hpp ├── graphics │ ├── DescriptorAllocator.cpp │ ├── DescriptorAllocator.hpp │ ├── GPU.cpp │ ├── GPU.hpp │ ├── GPUInternal.cpp │ ├── GPUInternal.hpp │ ├── GPUObjects.cpp │ ├── GPUObjects.hpp │ ├── GPUTypes.cpp │ ├── GPUTypes.hpp │ ├── PipelineCache.cpp │ ├── PipelineCache.hpp │ ├── Program.cpp │ ├── Program.hpp │ ├── QueryAllocator.cpp │ ├── QueryAllocator.hpp │ ├── SamplerLibrary.cpp │ ├── SamplerLibrary.hpp │ ├── ShaderCompiler.cpp │ ├── ShaderCompiler.hpp │ ├── Swapchain.cpp │ └── Swapchain.hpp ├── input │ ├── Camera.cpp │ ├── Camera.hpp │ ├── ControllableCamera.cpp │ ├── ControllableCamera.hpp │ ├── Input.cpp │ ├── Input.hpp │ ├── InputCallbacks.cpp │ ├── InputCallbacks.hpp │ └── controller │ │ ├── Controller.cpp │ │ ├── Controller.hpp │ │ ├── GamepadController.cpp │ │ ├── GamepadController.hpp │ │ ├── RawController.cpp │ │ └── RawController.hpp ├── processing │ ├── BilateralBlur.cpp │ ├── BilateralBlur.hpp │ ├── BoxBlur.cpp │ ├── BoxBlur.hpp │ ├── ConvolutionPyramid.cpp │ ├── ConvolutionPyramid.hpp │ ├── FloodFiller.cpp │ ├── FloodFiller.hpp │ ├── GaussianBlur.cpp │ ├── GaussianBlur.hpp │ ├── LaplacianIntegrator.cpp │ ├── LaplacianIntegrator.hpp │ ├── PoissonFiller.cpp │ ├── PoissonFiller.hpp │ ├── SSAO.cpp │ └── SSAO.hpp ├── raycaster │ ├── Intersection.cpp │ ├── Intersection.hpp │ ├── Raycaster.cpp │ ├── Raycaster.hpp │ ├── RaycasterVisualisation.cpp │ └── RaycasterVisualisation.hpp ├── renderers │ ├── Culler.cpp │ ├── Culler.hpp │ ├── DebugLightRenderer.cpp │ ├── DebugLightRenderer.hpp │ ├── DebugViewer.cpp │ ├── DebugViewer.hpp │ ├── LightRenderer.cpp │ ├── LightRenderer.hpp │ ├── Probe.cpp │ ├── Probe.hpp │ ├── Renderer.cpp │ ├── Renderer.hpp │ └── shadowmaps │ │ ├── BasicShadowMap.cpp │ │ ├── BasicShadowMap.hpp │ │ ├── ShadowMap.hpp │ │ ├── VarianceShadowMap.cpp │ │ └── VarianceShadowMap.hpp ├── resources │ ├── Bounds.cpp │ ├── Bounds.hpp │ ├── Buffer.cpp │ ├── Buffer.hpp │ ├── Font.cpp │ ├── Font.hpp │ ├── Image.cpp │ ├── Image.hpp │ ├── Library.cpp │ ├── Library.hpp │ ├── Mesh.cpp │ ├── Mesh.hpp │ ├── ResourcesManager.cpp │ ├── ResourcesManager.hpp │ ├── Texture.cpp │ └── Texture.hpp ├── scene │ ├── Animated.hpp │ ├── Animation.cpp │ ├── Animation.hpp │ ├── LightProbe.cpp │ ├── LightProbe.hpp │ ├── Material.cpp │ ├── Material.hpp │ ├── Object.cpp │ ├── Object.hpp │ ├── Scene.cpp │ ├── Scene.hpp │ ├── Sky.cpp │ ├── Sky.hpp │ └── lights │ │ ├── DirectionalLight.cpp │ │ ├── DirectionalLight.hpp │ │ ├── Light.cpp │ │ ├── Light.hpp │ │ ├── PointLight.cpp │ │ ├── PointLight.hpp │ │ ├── SpotLight.cpp │ │ └── SpotLight.hpp └── system │ ├── Codable.cpp │ ├── Codable.hpp │ ├── Config.cpp │ ├── Config.hpp │ ├── Logger.cpp │ ├── Logger.hpp │ ├── Query.cpp │ ├── Query.hpp │ ├── System.cpp │ ├── System.hpp │ ├── TextUtilities.cpp │ ├── TextUtilities.hpp │ ├── Window.cpp │ └── Window.hpp ├── libs ├── DEPENDENCIES.md ├── glfw │ ├── LICENSE.md │ ├── README.md │ ├── include │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ ├── premake5.lua │ └── src │ │ ├── CMakeLists.txt │ │ ├── cocoa_init.m │ │ ├── cocoa_joystick.h │ │ ├── cocoa_joystick.m │ │ ├── cocoa_monitor.m │ │ ├── cocoa_platform.h │ │ ├── cocoa_time.c │ │ ├── cocoa_window.m │ │ ├── context.c │ │ ├── egl_context.c │ │ ├── egl_context.h │ │ ├── glfw3.pc.in │ │ ├── glfw3Config.cmake.in │ │ ├── glfw_config.h.in │ │ ├── glx_context.c │ │ ├── glx_context.h │ │ ├── init.c │ │ ├── input.c │ │ ├── internal.h │ │ ├── linux_joystick.c │ │ ├── linux_joystick.h │ │ ├── mappings.h │ │ ├── mappings.h.in │ │ ├── monitor.c │ │ ├── nsgl_context.h │ │ ├── nsgl_context.m │ │ ├── null_init.c │ │ ├── null_joystick.c │ │ ├── null_joystick.h │ │ ├── null_monitor.c │ │ ├── null_platform.h │ │ ├── null_window.c │ │ ├── osmesa_context.c │ │ ├── osmesa_context.h │ │ ├── posix_thread.c │ │ ├── posix_thread.h │ │ ├── posix_time.c │ │ ├── posix_time.h │ │ ├── vulkan.c │ │ ├── wgl_context.c │ │ ├── wgl_context.h │ │ ├── win32_init.c │ │ ├── win32_joystick.c │ │ ├── win32_joystick.h │ │ ├── win32_monitor.c │ │ ├── win32_platform.h │ │ ├── win32_thread.c │ │ ├── win32_time.c │ │ ├── win32_window.c │ │ ├── window.c │ │ ├── wl_init.c │ │ ├── wl_monitor.c │ │ ├── wl_platform.h │ │ ├── wl_window.c │ │ ├── x11_init.c │ │ ├── x11_monitor.c │ │ ├── x11_platform.h │ │ ├── x11_window.c │ │ ├── xkb_unicode.c │ │ └── xkb_unicode.h ├── glm │ ├── common.hpp │ ├── copying.txt │ ├── detail │ │ ├── _features.hpp │ │ ├── _fixes.hpp │ │ ├── _noise.hpp │ │ ├── _swizzle.hpp │ │ ├── _swizzle_func.hpp │ │ ├── _vectorize.hpp │ │ ├── compute_common.hpp │ │ ├── compute_vector_relational.hpp │ │ ├── func_common.inl │ │ ├── func_common_simd.inl │ │ ├── func_exponential.inl │ │ ├── func_exponential_simd.inl │ │ ├── func_geometric.inl │ │ ├── func_geometric_simd.inl │ │ ├── func_integer.inl │ │ ├── func_integer_simd.inl │ │ ├── func_matrix.inl │ │ ├── func_matrix_simd.inl │ │ ├── func_packing.inl │ │ ├── func_packing_simd.inl │ │ ├── func_trigonometric.inl │ │ ├── func_trigonometric_simd.inl │ │ ├── func_vector_relational.inl │ │ ├── func_vector_relational_simd.inl │ │ ├── glm.cpp │ │ ├── qualifier.hpp │ │ ├── setup.hpp │ │ ├── type_float.hpp │ │ ├── type_half.hpp │ │ ├── type_half.inl │ │ ├── type_mat2x2.hpp │ │ ├── type_mat2x2.inl │ │ ├── type_mat2x3.hpp │ │ ├── type_mat2x3.inl │ │ ├── type_mat2x4.hpp │ │ ├── type_mat2x4.inl │ │ ├── type_mat3x2.hpp │ │ ├── type_mat3x2.inl │ │ ├── type_mat3x3.hpp │ │ ├── type_mat3x3.inl │ │ ├── type_mat3x4.hpp │ │ ├── type_mat3x4.inl │ │ ├── type_mat4x2.hpp │ │ ├── type_mat4x2.inl │ │ ├── type_mat4x3.hpp │ │ ├── type_mat4x3.inl │ │ ├── type_mat4x4.hpp │ │ ├── type_mat4x4.inl │ │ ├── type_mat4x4_simd.inl │ │ ├── type_quat.hpp │ │ ├── type_quat.inl │ │ ├── type_quat_simd.inl │ │ ├── type_vec1.hpp │ │ ├── type_vec1.inl │ │ ├── type_vec2.hpp │ │ ├── type_vec2.inl │ │ ├── type_vec3.hpp │ │ ├── type_vec3.inl │ │ ├── type_vec4.hpp │ │ ├── type_vec4.inl │ │ └── type_vec4_simd.inl │ ├── exponential.hpp │ ├── ext.hpp │ ├── ext │ │ ├── matrix_clip_space.hpp │ │ ├── matrix_clip_space.inl │ │ ├── matrix_common.hpp │ │ ├── matrix_common.inl │ │ ├── matrix_double2x2.hpp │ │ ├── matrix_double2x2_precision.hpp │ │ ├── matrix_double2x3.hpp │ │ ├── matrix_double2x3_precision.hpp │ │ ├── matrix_double2x4.hpp │ │ ├── matrix_double2x4_precision.hpp │ │ ├── matrix_double3x2.hpp │ │ ├── matrix_double3x2_precision.hpp │ │ ├── matrix_double3x3.hpp │ │ ├── matrix_double3x3_precision.hpp │ │ ├── matrix_double3x4.hpp │ │ ├── matrix_double3x4_precision.hpp │ │ ├── matrix_double4x2.hpp │ │ ├── matrix_double4x2_precision.hpp │ │ ├── matrix_double4x3.hpp │ │ ├── matrix_double4x3_precision.hpp │ │ ├── matrix_double4x4.hpp │ │ ├── matrix_double4x4_precision.hpp │ │ ├── matrix_float2x2.hpp │ │ ├── matrix_float2x2_precision.hpp │ │ ├── matrix_float2x3.hpp │ │ ├── matrix_float2x3_precision.hpp │ │ ├── matrix_float2x4.hpp │ │ ├── matrix_float2x4_precision.hpp │ │ ├── matrix_float3x2.hpp │ │ ├── matrix_float3x2_precision.hpp │ │ ├── matrix_float3x3.hpp │ │ ├── matrix_float3x3_precision.hpp │ │ ├── matrix_float3x4.hpp │ │ ├── matrix_float3x4_precision.hpp │ │ ├── matrix_float4x2.hpp │ │ ├── matrix_float4x2_precision.hpp │ │ ├── matrix_float4x3.hpp │ │ ├── matrix_float4x3_precision.hpp │ │ ├── matrix_float4x4.hpp │ │ ├── matrix_float4x4_precision.hpp │ │ ├── matrix_projection.hpp │ │ ├── matrix_projection.inl │ │ ├── matrix_relational.hpp │ │ ├── matrix_relational.inl │ │ ├── matrix_transform.hpp │ │ ├── matrix_transform.inl │ │ ├── quaternion_common.hpp │ │ ├── quaternion_common.inl │ │ ├── quaternion_common_simd.inl │ │ ├── quaternion_double.hpp │ │ ├── quaternion_double_precision.hpp │ │ ├── quaternion_exponential.hpp │ │ ├── quaternion_exponential.inl │ │ ├── quaternion_float.hpp │ │ ├── quaternion_float_precision.hpp │ │ ├── quaternion_geometric.hpp │ │ ├── quaternion_geometric.inl │ │ ├── quaternion_relational.hpp │ │ ├── quaternion_relational.inl │ │ ├── quaternion_transform.hpp │ │ ├── quaternion_transform.inl │ │ ├── quaternion_trigonometric.hpp │ │ ├── quaternion_trigonometric.inl │ │ ├── scalar_common.hpp │ │ ├── scalar_common.inl │ │ ├── scalar_constants.hpp │ │ ├── scalar_constants.inl │ │ ├── scalar_int_sized.hpp │ │ ├── scalar_integer.hpp │ │ ├── scalar_integer.inl │ │ ├── scalar_relational.hpp │ │ ├── scalar_relational.inl │ │ ├── scalar_uint_sized.hpp │ │ ├── scalar_ulp.hpp │ │ ├── scalar_ulp.inl │ │ ├── vector_bool1.hpp │ │ ├── vector_bool1_precision.hpp │ │ ├── vector_bool2.hpp │ │ ├── vector_bool2_precision.hpp │ │ ├── vector_bool3.hpp │ │ ├── vector_bool3_precision.hpp │ │ ├── vector_bool4.hpp │ │ ├── vector_bool4_precision.hpp │ │ ├── vector_common.hpp │ │ ├── vector_common.inl │ │ ├── vector_double1.hpp │ │ ├── vector_double1_precision.hpp │ │ ├── vector_double2.hpp │ │ ├── vector_double2_precision.hpp │ │ ├── vector_double3.hpp │ │ ├── vector_double3_precision.hpp │ │ ├── vector_double4.hpp │ │ ├── vector_double4_precision.hpp │ │ ├── vector_float1.hpp │ │ ├── vector_float1_precision.hpp │ │ ├── vector_float2.hpp │ │ ├── vector_float2_precision.hpp │ │ ├── vector_float3.hpp │ │ ├── vector_float3_precision.hpp │ │ ├── vector_float4.hpp │ │ ├── vector_float4_precision.hpp │ │ ├── vector_int1.hpp │ │ ├── vector_int1_precision.hpp │ │ ├── vector_int2.hpp │ │ ├── vector_int2_precision.hpp │ │ ├── vector_int3.hpp │ │ ├── vector_int3_precision.hpp │ │ ├── vector_int4.hpp │ │ ├── vector_int4_precision.hpp │ │ ├── vector_integer.hpp │ │ ├── vector_integer.inl │ │ ├── vector_relational.hpp │ │ ├── vector_relational.inl │ │ ├── vector_uint1.hpp │ │ ├── vector_uint1_precision.hpp │ │ ├── vector_uint2.hpp │ │ ├── vector_uint2_precision.hpp │ │ ├── vector_uint3.hpp │ │ ├── vector_uint3_precision.hpp │ │ ├── vector_uint4.hpp │ │ ├── vector_uint4_precision.hpp │ │ ├── vector_ulp.hpp │ │ └── vector_ulp.inl │ ├── fwd.hpp │ ├── geometric.hpp │ ├── glm.hpp │ ├── gtc │ │ ├── bitfield.hpp │ │ ├── bitfield.inl │ │ ├── color_space.hpp │ │ ├── color_space.inl │ │ ├── constants.hpp │ │ ├── constants.inl │ │ ├── epsilon.hpp │ │ ├── epsilon.inl │ │ ├── integer.hpp │ │ ├── integer.inl │ │ ├── matrix_access.hpp │ │ ├── matrix_access.inl │ │ ├── matrix_integer.hpp │ │ ├── matrix_inverse.hpp │ │ ├── matrix_inverse.inl │ │ ├── matrix_transform.hpp │ │ ├── matrix_transform.inl │ │ ├── noise.hpp │ │ ├── noise.inl │ │ ├── packing.hpp │ │ ├── packing.inl │ │ ├── quaternion.hpp │ │ ├── quaternion.inl │ │ ├── quaternion_simd.inl │ │ ├── random.hpp │ │ ├── random.inl │ │ ├── reciprocal.hpp │ │ ├── reciprocal.inl │ │ ├── round.hpp │ │ ├── round.inl │ │ ├── type_aligned.hpp │ │ ├── type_precision.hpp │ │ ├── type_precision.inl │ │ ├── type_ptr.hpp │ │ ├── type_ptr.inl │ │ ├── ulp.hpp │ │ ├── ulp.inl │ │ └── vec1.hpp │ ├── gtx │ │ ├── associated_min_max.hpp │ │ ├── associated_min_max.inl │ │ ├── bit.hpp │ │ ├── bit.inl │ │ ├── closest_point.hpp │ │ ├── closest_point.inl │ │ ├── color_encoding.hpp │ │ ├── color_encoding.inl │ │ ├── color_space.hpp │ │ ├── color_space.inl │ │ ├── color_space_YCoCg.hpp │ │ ├── color_space_YCoCg.inl │ │ ├── common.hpp │ │ ├── common.inl │ │ ├── compatibility.hpp │ │ ├── compatibility.inl │ │ ├── component_wise.hpp │ │ ├── component_wise.inl │ │ ├── dual_quaternion.hpp │ │ ├── dual_quaternion.inl │ │ ├── easing.hpp │ │ ├── easing.inl │ │ ├── euler_angles.hpp │ │ ├── euler_angles.inl │ │ ├── extend.hpp │ │ ├── extend.inl │ │ ├── extended_min_max.hpp │ │ ├── extended_min_max.inl │ │ ├── exterior_product.hpp │ │ ├── exterior_product.inl │ │ ├── fast_exponential.hpp │ │ ├── fast_exponential.inl │ │ ├── fast_square_root.hpp │ │ ├── fast_square_root.inl │ │ ├── fast_trigonometry.hpp │ │ ├── fast_trigonometry.inl │ │ ├── float_notmalize.inl │ │ ├── functions.hpp │ │ ├── functions.inl │ │ ├── gradient_paint.hpp │ │ ├── gradient_paint.inl │ │ ├── handed_coordinate_space.hpp │ │ ├── handed_coordinate_space.inl │ │ ├── hash.hpp │ │ ├── hash.inl │ │ ├── integer.hpp │ │ ├── integer.inl │ │ ├── intersect.hpp │ │ ├── intersect.inl │ │ ├── io.hpp │ │ ├── io.inl │ │ ├── log_base.hpp │ │ ├── log_base.inl │ │ ├── matrix_cross_product.hpp │ │ ├── matrix_cross_product.inl │ │ ├── matrix_decompose.hpp │ │ ├── matrix_decompose.inl │ │ ├── matrix_factorisation.hpp │ │ ├── matrix_factorisation.inl │ │ ├── matrix_interpolation.hpp │ │ ├── matrix_interpolation.inl │ │ ├── matrix_major_storage.hpp │ │ ├── matrix_major_storage.inl │ │ ├── matrix_operation.hpp │ │ ├── matrix_operation.inl │ │ ├── matrix_query.hpp │ │ ├── matrix_query.inl │ │ ├── matrix_transform_2d.hpp │ │ ├── matrix_transform_2d.inl │ │ ├── mixed_product.hpp │ │ ├── mixed_product.inl │ │ ├── norm.hpp │ │ ├── norm.inl │ │ ├── normal.hpp │ │ ├── normal.inl │ │ ├── normalize_dot.hpp │ │ ├── normalize_dot.inl │ │ ├── number_precision.hpp │ │ ├── number_precision.inl │ │ ├── optimum_pow.hpp │ │ ├── optimum_pow.inl │ │ ├── orthonormalize.hpp │ │ ├── orthonormalize.inl │ │ ├── perpendicular.hpp │ │ ├── perpendicular.inl │ │ ├── polar_coordinates.hpp │ │ ├── polar_coordinates.inl │ │ ├── projection.hpp │ │ ├── projection.inl │ │ ├── quaternion.hpp │ │ ├── quaternion.inl │ │ ├── range.hpp │ │ ├── raw_data.hpp │ │ ├── raw_data.inl │ │ ├── rotate_normalized_axis.hpp │ │ ├── rotate_normalized_axis.inl │ │ ├── rotate_vector.hpp │ │ ├── rotate_vector.inl │ │ ├── scalar_multiplication.hpp │ │ ├── scalar_relational.hpp │ │ ├── scalar_relational.inl │ │ ├── spline.hpp │ │ ├── spline.inl │ │ ├── std_based_type.hpp │ │ ├── std_based_type.inl │ │ ├── string_cast.hpp │ │ ├── string_cast.inl │ │ ├── texture.hpp │ │ ├── texture.inl │ │ ├── transform.hpp │ │ ├── transform.inl │ │ ├── transform2.hpp │ │ ├── transform2.inl │ │ ├── type_aligned.hpp │ │ ├── type_aligned.inl │ │ ├── type_trait.hpp │ │ ├── type_trait.inl │ │ ├── vec_swizzle.hpp │ │ ├── vector_angle.hpp │ │ ├── vector_angle.inl │ │ ├── vector_query.hpp │ │ ├── vector_query.inl │ │ ├── wrap.hpp │ │ └── wrap.inl │ ├── integer.hpp │ ├── mat2x2.hpp │ ├── mat2x3.hpp │ ├── mat2x4.hpp │ ├── mat3x2.hpp │ ├── mat3x3.hpp │ ├── mat3x4.hpp │ ├── mat4x2.hpp │ ├── mat4x3.hpp │ ├── mat4x4.hpp │ ├── matrix.hpp │ ├── packing.hpp │ ├── simd │ │ ├── common.h │ │ ├── exponential.h │ │ ├── geometric.h │ │ ├── integer.h │ │ ├── matrix.h │ │ ├── neon.h │ │ ├── packing.h │ │ ├── platform.h │ │ ├── trigonometric.h │ │ └── vector_relational.h │ ├── trigonometric.hpp │ ├── vec2.hpp │ ├── vec3.hpp │ ├── vec4.hpp │ └── vector_relational.hpp ├── imgui │ ├── LICENSE.txt │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_impl_glfw.cpp │ ├── imgui_impl_glfw.h │ ├── imgui_impl_vulkan.cpp │ ├── imgui_impl_vulkan.h │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── vulkan_patch.diff ├── mikktspace │ ├── mikktspace.c │ └── mikktspace.h ├── miniz │ ├── LICENSE │ ├── miniz.c │ └── miniz.h ├── nfd │ ├── LICENSE │ ├── common.h │ ├── nfd.h │ ├── nfd_cocoa.m │ ├── nfd_common.c │ ├── nfd_common.h │ ├── nfd_gtk.c │ ├── nfd_win.cpp │ ├── nfd_zenity.c │ ├── premake5.lua │ └── simple_exec.h ├── stb_image │ ├── LICENSE │ ├── stb_image.h │ └── stb_image_write.h ├── tinydir │ ├── COPYING │ └── tinydir.h ├── tinyexr │ └── tinyexr.h ├── vma │ ├── LICENSE.txt │ └── vk_mem_alloc.h ├── volk │ ├── LICENSE.md │ ├── volk.c │ └── volk.h └── xxhash │ ├── LICENSE │ └── xxhash.h └── tools ├── ALL.cpp ├── BRDFEstimator.cpp ├── ControllerTest.cpp ├── ImageViewer.cpp ├── ShaderValidator.cpp ├── objtoscene ├── CompositeObj.cpp ├── CompositeObj.hpp ├── ObjToScene.cpp ├── SceneExport.cpp └── SceneExport.hpp └── sceneeditor ├── EditorRenderer.cpp ├── EditorRenderer.hpp ├── SceneEditor.cpp ├── SceneEditor.hpp └── main.cpp /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_size = 4 6 | indent_style = tab 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build*/ 2 | /tools/ 3 | /ext/ 4 | /src/internal/ 5 | /resources/internal/ 6 | /resources/additional/ 7 | /docs/html/ 8 | /premake5.exe 9 | /.scannerwork 10 | resources.zip 11 | .DS_Store 12 | premake.tar.gz 13 | premake.zip 14 | premake5 15 | premake5.exe 16 | .vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Simon Rodriguez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/img/atmosphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/atmosphere.png -------------------------------------------------------------------------------- /docs/img/brdfpreproc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/brdfpreproc.png -------------------------------------------------------------------------------- /docs/img/controllermap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/controllermap.png -------------------------------------------------------------------------------- /docs/img/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/header.png -------------------------------------------------------------------------------- /docs/img/imagefiltering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/imagefiltering.png -------------------------------------------------------------------------------- /docs/img/imageviewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/imageviewer.png -------------------------------------------------------------------------------- /docs/img/island.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/island.png -------------------------------------------------------------------------------- /docs/img/pathtracer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/pathtracer.png -------------------------------------------------------------------------------- /docs/img/pbrdemo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/pbrdemo.png -------------------------------------------------------------------------------- /docs/img/playground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/playground.png -------------------------------------------------------------------------------- /docs/img/shaderbench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/shaderbench.png -------------------------------------------------------------------------------- /docs/img/shadervalidator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/shadervalidator.png -------------------------------------------------------------------------------- /docs/img/snake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/snake.png -------------------------------------------------------------------------------- /docs/img/stencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/docs/img/stencil.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Documentation 5 | 6 | 7 | 8 |

9 | If not redirected, click here. 10 |

11 | 12 | -------------------------------------------------------------------------------- /docs/index_local.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Documentation 5 | 6 | 7 | 8 |

9 | If not redirected, click here. 10 |

11 | 12 | -------------------------------------------------------------------------------- /docs/theme/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

11 | 12 | 13 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /resources/atmosphere/shaders/atmosphere_params.frag: -------------------------------------------------------------------------------- 1 | 2 | #include "atmosphere.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec2 uv; ///< Texture coordinates. 6 | } In ; 7 | 8 | layout(set = 0, binding = 0) uniform UniformBlock { 9 | AtmosphereParameters atmoParams; ///< Custom atmosphere parameters. 10 | mat4 clipToWorld; ///< Clip-to-world space transformation matrix. 11 | vec3 viewPos; ///< The position in view space. 12 | vec3 lightDirection; ///< The light direction in world space. 13 | float altitude; ///< height above the planet surface. 14 | }; 15 | 16 | layout(set = 2, binding = 0) uniform texture2D precomputedScattering; ///< Secondary scattering lookup table. 17 | 18 | layout(location = 0) out vec3 fragColor; ///< Atmosphere color. 19 | 20 | /** Simulate sky color based on an atmospheric scattering approximate model. */ 21 | void main(){ 22 | // Move to -1,1 23 | vec4 clipVertex = vec4(-1.0+2.0*In.uv, 0.0, 1.0); 24 | // Then to world space. 25 | vec3 viewRay = normalize((clipToWorld * clipVertex).xyz); 26 | // We then move to the ground model space, where the ground is at y=0. 27 | vec3 groundSpaceViewPos = viewPos + vec3(0.0, altitude, 0.0); 28 | vec3 atmosphereColor = computeAtmosphereRadiance(groundSpaceViewPos, viewRay, lightDirection, precomputedScattering, atmoParams); 29 | fragColor = atmosphereColor; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /resources/common/ControllerLayout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/ControllerLayout.png -------------------------------------------------------------------------------- /resources/common/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/Lato-Regular.ttf -------------------------------------------------------------------------------- /resources/common/brdf-precomputed.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/brdf-precomputed.exr -------------------------------------------------------------------------------- /resources/common/controller_ps4.map: -------------------------------------------------------------------------------- 1 | 576972656C65737320436F6E74726F6C6C6572,Wireless Controller,platform:Mac OS X,c:b0,d:b3,a:b1,b:b2,leftshoulder:b4,lefttrigger:a3,leftstick:b10,rightshoulder:b5,righttrigger:a4,rightstick:b11,dpup:b14,dpleft:b17,dpdown:b16,dpright:b15,guide:b12,start:b9,back:b8,leftx:a0,lefty:a1,rightx:a2,righty:a5, -------------------------------------------------------------------------------- /resources/common/debug-cube/debug-cube_nx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-cube/debug-cube_nx.png -------------------------------------------------------------------------------- /resources/common/debug-cube/debug-cube_ny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-cube/debug-cube_ny.png -------------------------------------------------------------------------------- /resources/common/debug-cube/debug-cube_nz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-cube/debug-cube_nz.png -------------------------------------------------------------------------------- /resources/common/debug-cube/debug-cube_px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-cube/debug-cube_px.png -------------------------------------------------------------------------------- /resources/common/debug-cube/debug-cube_py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-cube/debug-cube_py.png -------------------------------------------------------------------------------- /resources/common/debug-cube/debug-cube_pz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-cube/debug-cube_pz.png -------------------------------------------------------------------------------- /resources/common/debug-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/debug-grid.png -------------------------------------------------------------------------------- /resources/common/default_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_color.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_cube_nx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_cube/default_cube_nx.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_cube_ny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_cube/default_cube_ny.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_cube_nz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_cube/default_cube_nz.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_cube_px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_cube/default_cube_px.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_cube_py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_cube/default_cube_py.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_cube_pz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_cube/default_cube_pz.png -------------------------------------------------------------------------------- /resources/common/default_cube/default_shcoeffs.txt: -------------------------------------------------------------------------------- 1 | 0.1 0.1 0.1 2 | 0.0 0.0 0.0 3 | 0.0 0.0 0.0 4 | 0.0 0.0 0.0 5 | 0.0 0.0 0.0 6 | 0.0 0.0 0.0 7 | 0.0 0.0 0.0 8 | 0.0 0.0 0.0 9 | 0.0 0.0 0.0 10 | -------------------------------------------------------------------------------- /resources/common/default_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_normal.png -------------------------------------------------------------------------------- /resources/common/default_rough_met_ao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/default_rough_met_ao.png -------------------------------------------------------------------------------- /resources/common/meshes/cube.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.78 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | v -1.000000 -1.000000 1.000000 4 | v -1.000000 1.000000 1.000000 5 | v -1.000000 -1.000000 -1.000000 6 | v -1.000000 1.000000 -1.000000 7 | v 1.000000 -1.000000 1.000000 8 | v 1.000000 1.000000 1.000000 9 | v 1.000000 -1.000000 -1.000000 10 | v 1.000000 1.000000 -1.000000 11 | vn 1.0 0.0 0.0 12 | vn 0.0 1.0 0.0 13 | vn 0.0 0.0 1.0 14 | vn -1.0 0.0 0.0 15 | vn 0.0 -1.0 0.0 16 | vn 0.0 0.0 -1.0 17 | vt 0.5 0.5 18 | s off 19 | f 3/1/4 1/1/4 2/1/4 20 | f 7/1/6 3/1/6 4/1/6 21 | f 5/1/1 7/1/1 8/1/1 22 | f 1/1/3 5/1/3 6/1/3 23 | f 1/1/5 3/1/5 7/1/5 24 | f 6/1/2 8/1/2 4/1/2 25 | f 3/1/4 2/1/4 4/1/4 26 | f 7/1/6 4/1/6 8/1/6 27 | f 5/1/1 8/1/1 6/1/1 28 | f 1/1/3 6/1/3 2/1/3 29 | f 1/1/5 7/1/5 5/1/5 30 | f 6/1/2 4/1/2 2/1/2 31 | -------------------------------------------------------------------------------- /resources/common/meshes/light_arrow.obj: -------------------------------------------------------------------------------- 1 | #### 2 | # 3 | # OBJ File Generated by Meshlab 4 | # 5 | #### 6 | # Object light_arrow.obj 7 | # 8 | # Vertices: 13 9 | # Faces: 22 10 | # 11 | #### 12 | v -0.524644 0.524644 2.908718 13 | v -0.524644 -0.524644 2.908718 14 | v 0.524644 -0.524644 2.908718 15 | v 0.524644 0.524644 2.908718 16 | v 0.000000 0.000000 -0.000166 17 | v -1.000000 -1.000000 0.998872 18 | v -0.524644 -0.524644 0.994685 19 | v 1.000000 -1.000000 0.998872 20 | v 0.524644 -0.524644 0.994685 21 | v 1.000000 1.000000 0.998872 22 | v 0.524644 0.524644 0.994685 23 | v -1.000000 1.000000 0.998872 24 | v -0.524644 0.524644 0.994685 25 | # 13 vertices, 0 vertices normals 26 | 27 | f 1 3 4 28 | f 6 12 5 29 | f 8 6 5 30 | f 10 8 5 31 | f 13 4 11 32 | f 6 9 7 33 | f 7 3 2 34 | f 8 11 9 35 | f 3 11 4 36 | f 12 7 13 37 | f 13 2 1 38 | f 13 10 12 39 | f 5 12 10 40 | f 1 2 3 41 | f 13 1 4 42 | f 6 8 9 43 | f 7 9 3 44 | f 8 10 11 45 | f 3 9 11 46 | f 12 6 7 47 | f 13 7 2 48 | f 13 11 10 49 | # 22 faces, 0 coords texture 50 | 51 | # End of File 52 | -------------------------------------------------------------------------------- /resources/common/meshes/light_cone.obj: -------------------------------------------------------------------------------- 1 | v 0.000000 0.500000 -1.00000 2 | v 0.000000 0.000000 -0.00000 3 | v 0.191341 0.461940 -1.00000 4 | v 0.353553 0.353554 -1.00000 5 | v 0.461940 0.191342 -1.00000 6 | v 0.500000 0.000000 -1.00000 7 | v 0.461940 -0.191342 -1.00000 8 | v 0.353553 -0.353553 -1.00000 9 | v 0.191341 -0.461940 -1.00000 10 | v 0.000000 -0.500000 -1.00000 11 | v -0.191341 -0.461940 -1.00000 12 | v -0.353553 -0.353553 -1.00000 13 | v -0.461940 -0.191342 -1.00000 14 | v -0.500000 0.000000 -1.00000 15 | v -0.461939 0.191342 -1.00000 16 | v -0.353553 0.353554 -1.00000 17 | v -0.191341 0.461940 -1.00000 18 | v 0.000000 0.000000 -1.00000 19 | f 1 2 3 20 | f 3 2 4 21 | f 4 2 5 22 | f 5 2 6 23 | f 6 2 7 24 | f 7 2 8 25 | f 8 2 9 26 | f 9 2 10 27 | f 10 2 11 28 | f 11 2 12 29 | f 12 2 13 30 | f 13 2 14 31 | f 14 2 15 32 | f 15 2 16 33 | f 16 2 17 34 | f 17 2 1 35 | f 18 1 3 36 | f 18 3 4 37 | f 18 4 5 38 | f 18 5 6 39 | f 18 6 7 40 | f 18 7 8 41 | f 18 8 9 42 | f 18 9 10 43 | f 18 10 11 44 | f 18 11 12 45 | f 18 12 13 46 | f 18 13 14 47 | f 18 14 15 48 | f 18 15 16 49 | f 18 16 17 50 | f 18 17 1 51 | -------------------------------------------------------------------------------- /resources/common/meshes/plane.obj: -------------------------------------------------------------------------------- 1 | v -1.000000 -1.000000 0.000000 2 | v -1.000000 1.000000 0.000000 3 | v 1.000000 -1.000000 0.000000 4 | v 1.000000 1.000000 0.000000 5 | vt 0.0 0.0 6 | vt 0.0 1.0 7 | vt 1.0 0.0 8 | vt 1.0 1.0 9 | vn 0.000000 0.000000 1.000000 10 | f 1/1/1 3/3/1 4/4/1 11 | f 1/1/1 4/4/1 2/2/1 12 | -------------------------------------------------------------------------------- /resources/common/meshes/skybox.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.78 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | v -1.000000 -1.000000 1.000000 4 | v -1.000000 1.000000 1.000000 5 | v -1.000000 -1.000000 -1.000000 6 | v -1.000000 1.000000 -1.000000 7 | v 1.000000 -1.000000 1.000000 8 | v 1.000000 1.000000 1.000000 9 | v 1.000000 -1.000000 -1.000000 10 | v 1.000000 1.000000 -1.000000 11 | s off 12 | f 3 2 1 13 | f 7 4 3 14 | f 5 8 7 15 | f 1 6 5 16 | f 1 7 3 17 | f 6 4 8 18 | f 3 4 2 19 | f 7 8 4 20 | f 5 6 8 21 | f 1 2 6 22 | f 1 5 7 23 | f 6 2 4 24 | -------------------------------------------------------------------------------- /resources/common/scattering-precomputed.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/common/scattering-precomputed.exr -------------------------------------------------------------------------------- /resources/common/shaders/background/background_infinity.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D texture0; ///< Image. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | vec3 bgColor; ///< Background color. 11 | bool useTexture; ///< Should the texture be used instead of the color. 12 | }; 13 | 14 | layout (location = 0) out vec4 fragColor; ///< Color. 15 | 16 | /** Transfer color. */ 17 | void main(){ 18 | 19 | fragColor.rgb = useTexture ? textureLod(sampler2D(texture0, sClampLinear), In.uv, 0.0).rgb : bgColor; 20 | fragColor.a = 1.0; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /resources/common/shaders/background/background_infinity.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | 5 | layout(location = 0) out INTERFACE { 6 | vec2 uv; ///< UV coordinates. 7 | } Out; 8 | 9 | /** Output vertex as-is. We ensure the vertex will be set to the maximum depth by tweaking gl_Position.z. 10 | */ 11 | void main(){ 12 | gl_Position = vec4(v, 1.0); 13 | // Ensure the quad is sent to the maximum depth. 14 | gl_Position.z = gl_Position.w; 15 | Out.uv = 0.5*v.xy + 0.5; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /resources/common/shaders/background/probe_debug.frag: -------------------------------------------------------------------------------- 1 | #include "utils.glsl" 2 | #include "common_pbr.glsl" 3 | 4 | #define PROBE_SHCOEFFS 0 5 | #define PROBE_RADIANCE 1 6 | 7 | layout(location = 0) in INTERFACE { 8 | vec4 pos; ///< World space position. 9 | vec4 nor; ///< Normal in world space. 10 | } In ; 11 | 12 | layout(set = 2, binding = 0) uniform textureCube texture0; ///< Cubemap color. 13 | 14 | /// SH approximation of the environment irradiance. 15 | layout(std140, set = 3, binding = 0) uniform SHCoeffs { 16 | vec4 shCoeffs[9]; 17 | }; 18 | 19 | layout(set = 0, binding = 0) uniform UniformBlock { 20 | vec3 camPos; ///< Camera position in world space. 21 | float lod; ///< Level to fetch. 22 | int mode; ///< Display mod. 23 | }; 24 | 25 | layout(location = 0) out vec4 fragColor; ///< Color. 26 | 27 | /** Use the normalized position to read in the cube map. */ 28 | void main(){ 29 | vec3 n = normalize(In.nor.xyz); 30 | if(mode == PROBE_SHCOEFFS){ 31 | fragColor = vec4(applySH(n, shCoeffs), 1.0); 32 | } else { 33 | vec3 v = normalize(In.pos.xyz - camPos); 34 | vec3 r = reflect(v, n); 35 | fragColor = textureLod(samplerCube(texture0, sClampLinearLinear), toCube(r), lod); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /resources/common/shaders/background/probe_debug.vert: -------------------------------------------------------------------------------- 1 | // Attributes 2 | layout(location = 0) in vec3 v; ///< Position. 3 | 4 | layout(set = 0, binding = 1) uniform UniformBlock { 5 | mat4 mvp; ///< The transformation matrix. 6 | mat4 m; ///< Model transformation matrix. 7 | mat4 normalMatrix; ///< Normal transformation matrix. 8 | }; 9 | 10 | layout(location = 0) out INTERFACE { 11 | vec4 pos; ///< World space position. 12 | vec4 nor; ///< Normal in world space. 13 | } Out; 14 | 15 | /** Apply the MVP transformation to the input vertex. */ 16 | void main(){ 17 | // We multiply the coordinates by the MVP matrix, and ouput the result. 18 | gl_Position = mvp * vec4(v, 1.0); 19 | // Store view space position. 20 | Out.pos.xyz = vec3(m * vec4(v, 1.0)); 21 | Out.pos.w = 0.0; 22 | // Compute the view space normal. 23 | Out.nor.xyz = normalize(mat3(normalMatrix) * normalize(v)); 24 | Out.nor.w = 0.0; 25 | } 26 | -------------------------------------------------------------------------------- /resources/common/shaders/background/skybox_basic.frag: -------------------------------------------------------------------------------- 1 | #include "utils.glsl" 2 | #include "samplers.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec3 pos; ///< Position in model space. 6 | } In ; 7 | 8 | layout(set = 2, binding = 0) uniform textureCube texture0; ///< Cubemap color. 9 | 10 | layout(location = 0) out vec4 fragColor; ///< Color. 11 | 12 | /** Use the normalized position to read in the cube map. */ 13 | void main(){ 14 | fragColor = texture(samplerCube(texture0,sClampLinearLinear), toCube(normalize(In.pos))); 15 | } 16 | -------------------------------------------------------------------------------- /resources/common/shaders/background/skybox_basic.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | 5 | layout(set = 0, binding = 1) uniform UniformBlock { 6 | mat4 mvp; ///< The transformation matrix. 7 | }; 8 | 9 | layout(location = 0) out INTERFACE { 10 | vec3 pos; ///< Position in model space. 11 | } Out; 12 | 13 | 14 | /** Apply the MVP transformation to the input vertex. */ 15 | void main(){ 16 | // We multiply the coordinates by the MVP matrix, and ouput the result. 17 | gl_Position = mvp * vec4(v, 1.0); 18 | Out.pos = v; 19 | } 20 | -------------------------------------------------------------------------------- /resources/common/shaders/background/skybox_infinity.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | 5 | // Uniform 6 | layout(set = 0, binding = 1) uniform UniformBlock { 7 | mat4 mvp; ///< MVP transformation matrix. 8 | }; 9 | 10 | layout(location = 0) out INTERFACE { 11 | vec3 pos; ///< Position in model space. 12 | } Out; 13 | 14 | /** Apply the transformation to the input vertex, treating it as a vector to ignore the translation part and keep it centered. 15 | We also ensure the vertex will be set to the maximum depth by tweaking gl_Position.z. 16 | */ 17 | void main(){ 18 | // We multiply the coordinates by the MVP matrix, and ouput the result. 19 | // To keep the skybox centered on the camera, we treat its vertices as directions (no translation) 20 | gl_Position = mvp * vec4(v, 0.0); 21 | // Ensure the skybox is sent to the maximum depth. 22 | gl_Position.z = gl_Position.w; 23 | Out.pos = v; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /resources/common/shaders/background/skybox_shcoeffs.frag: -------------------------------------------------------------------------------- 1 | 2 | #include "common_pbr.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec3 pos; ///< Position in model space. 6 | } In ; 7 | 8 | /// SH approximation of the environment irradiance (UBO). 9 | layout(std140, set = 3, binding = 0) uniform SHCoeffs { 10 | vec4 shCoeffs[9]; 11 | }; 12 | 13 | layout(location = 0) out vec3 fragColor; ///< Color. 14 | 15 | /** Compute the environment ambient lighting contribution on the scene. */ 16 | void main(){ 17 | vec3 envLighting = applySH(normalize(In.pos), shCoeffs); 18 | fragColor = envLighting; 19 | } 20 | -------------------------------------------------------------------------------- /resources/common/shaders/constants.glsl: -------------------------------------------------------------------------------- 1 | #define INV_M_PI 0.3183098862 2 | #define M_PI 3.1415926536 3 | #define M_INV_LOG2 1.4426950408889 4 | #define M_2_PI (2.0*3.1415926536) 5 | #define M_HALF_PI (0.5*3.1415926536) 6 | #define GOLDEN_RATIO 1.61803398874989 7 | #define GOLDEN_ANGLE 2.39996322972865332 8 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_debug.frag: -------------------------------------------------------------------------------- 1 | layout(set = 0, binding = 0) uniform UniformBlock { 2 | vec4 color; ///< The color of the light. 3 | }; 4 | 5 | // Output: the fragment color 6 | layout (location = 0) out vec4 fragColor; ///< Color. 7 | layout (location = 1) out vec3 fragNormal; ///< Normal (view space). 8 | layout (location = 2) out vec3 fragEffects; ///< Effects (roughness, etc.). 9 | 10 | /** Simply output the light color, and identify as background (no additional processing) */ 11 | void main(){ 12 | 13 | // Store values. 14 | fragColor.rgb = color.rgb; 15 | fragColor.a = 0.0; // same ID as the background. 16 | fragNormal.rgb = vec3(0.5); 17 | fragEffects.rgb = vec3(0.0); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_shadow_basic.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D mask; ///< RGBA texture. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | bool hasMask; ///< Should the object alpha mask be applied. 11 | }; 12 | 13 | 14 | layout(location = 0) out float fragColor; ///< World space depth. 15 | 16 | /** Output the final depth of the fragment and its square, for variance shadow mapping. */ 17 | void main(){ 18 | if(hasMask){ 19 | float a = texture(sampler2D(mask, sRepeatLinearLinear), In.uv).a; 20 | if(a <= 0.01){ 21 | discard; 22 | } 23 | } 24 | fragColor = gl_FragCoord.z; 25 | } 26 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_shadow_linear_basic.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec4 worldPos; ///< World space position. 5 | vec2 uv; ///< Texture coordinates. 6 | } In ; 7 | 8 | layout(set = 2, binding = 0) uniform texture2D mask; ///< RGBA texture. 9 | 10 | layout(set = 0, binding = 0) uniform UniformBlock { 11 | vec3 lightPositionWorld; ///< The world space position of the light. 12 | float lightFarPlane; ///< The light projection matrix far plane. 13 | bool hasMask; ///< Should the object alpha mask be applied. 14 | }; 15 | 16 | layout(location = 0) out float fragColor; ///< World space depth. 17 | 18 | /** Compute the depth in world space, normalized by the far plane distance */ 19 | void main(){ 20 | // Mask cutout. 21 | if(hasMask){ 22 | float a = texture(sampler2D(mask, sRepeatLinearLinear), In.uv).a; 23 | if(a <= 0.01){ 24 | discard; 25 | } 26 | } 27 | // We compute the distance in world space (or equivalently view space). 28 | // We normalize it by the far plane distance to obtain a [0,1] value. 29 | float dist = clamp(length(In.worldPos.xyz - lightPositionWorld) / lightFarPlane, 0.0, 1.0); 30 | fragColor = dist; 31 | } 32 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_shadow_linear_variance.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec4 worldPos; ///< World space position. 5 | vec2 uv; ///< Texture coordinates. 6 | } In ; 7 | 8 | layout(set = 2, binding = 0) uniform texture2D mask; ///< RGBA texture. 9 | 10 | layout(set = 0, binding = 0) uniform UniformBlock { 11 | vec3 lightPositionWorld; ///< The world space position of the light. 12 | float lightFarPlane; ///< The light projection matrix far plane. 13 | bool hasMask; ///< Should the object alpha mask be applied. 14 | }; 15 | 16 | layout(location = 0) out vec2 fragColor; ///< World space depth and depth squared. 17 | 18 | /** Compute the depth in world space, normalized by the far plane distance */ 19 | void main(){ 20 | // Mask cutout. 21 | if(hasMask){ 22 | float a = texture(sampler2D(mask, sRepeatLinearLinear), In.uv).a; 23 | if(a <= 0.01){ 24 | discard; 25 | } 26 | } 27 | // We compute the distance in world space (or equivalently view space). 28 | // We normalize it by the far plane distance to obtain a [0,1] value. 29 | float dist = clamp(length(In.worldPos.xyz - lightPositionWorld) / lightFarPlane, 0.0, 1.0); 30 | fragColor = vec2(dist, dist*dist); 31 | } 32 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_shadow_linear_vertex.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | layout(location = 2) in vec2 uv;///< UV. 5 | 6 | // Uniform: the MVP. 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | mat4 mvp; ///< The transformation matrix. 9 | mat4 m; ///< The model matrix. 10 | }; 11 | 12 | layout(location = 0) out INTERFACE { 13 | vec4 worldPos; ///< World space position. 14 | vec2 uv; ///< Texture coordinates. 15 | } Out; 16 | 17 | /** Apply the MVP transformation to the input vertex. */ 18 | void main(){ 19 | // We multiply the coordinates by the MVP matrix, and ouput the result. 20 | gl_Position = mvp * vec4(v, 1.0); 21 | Out.worldPos = (m * vec4(v, 1.0)); 22 | Out.uv = uv; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_shadow_variance.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D mask; ///< RGBA texture. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | bool hasMask; ///< Should the object alpha mask be applied. 11 | }; 12 | 13 | layout(location = 0) out vec2 fragColor; ///< Depth and depth squared. 14 | 15 | /** Output the final depth of the fragment and its square, for variance shadow mapping. */ 16 | void main(){ 17 | if(hasMask){ 18 | float a = texture(sampler2D(mask, sRepeatLinearLinear), In.uv).a; 19 | if(a <= 0.01){ 20 | discard; 21 | } 22 | } 23 | fragColor = vec2(gl_FragCoord.z,gl_FragCoord.z*gl_FragCoord.z); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /resources/common/shaders/lights/light_shadow_vertex.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | layout(location = 2) in vec2 uv;///< UV. 5 | 6 | // Uniform: the MVP. 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | mat4 mvp; ///< The transformation matrix. 9 | }; 10 | 11 | layout(location = 0) out INTERFACE { 12 | vec2 uv; ///< Texture coordinates. 13 | } Out; 14 | 15 | /** Apply the MVP transformation to the input vertex. */ 16 | void main(){ 17 | // We multiply the coordinates by the MVP matrix, and ouput the result. 18 | gl_Position = mvp * vec4(v, 1.0); 19 | Out.uv = uv; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | 5 | // Uniform: the MVP. 6 | layout(set = 0, binding = 1) uniform UniformBlock { 7 | mat4 mvp; ///< The transformation matrix. 8 | }; 9 | 10 | /** Apply the MVP transformation to the input vertex. */ 11 | void main(){ 12 | // We multiply the coordinates by the MVP matrix, and ouput the result. 13 | gl_Position = mvp * vec4(v, 1.0); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_color.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in INTERFACE { 2 | vec3 col; ///< Interpolated vertex color. 3 | } In ; 4 | 5 | layout(location = 0) out vec4 fragColor; ///< Color. 6 | 7 | /** Render a mesh with its colors. */ 8 | void main(){ 9 | fragColor.rgb = In.col; 10 | fragColor.a = 1.0; 11 | } 12 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_color.vert: -------------------------------------------------------------------------------- 1 | // Attributes 2 | layout(location = 0) in vec3 v;///< Position. 3 | layout(location = 5) in vec3 c;///< Color. 4 | 5 | // Uniform: the MVP. 6 | layout(set = 0, binding = 1) uniform UniformBlock { 7 | mat4 mvp; ///< The transformation matrix. 8 | }; 9 | 10 | layout(location = 0) out INTERFACE { 11 | vec3 col; ///< Color. 12 | } Out ; 13 | 14 | /** Apply the transformation to the input vertex. 15 | */ 16 | void main(){ 17 | // We multiply the coordinates by the MVP matrix, and ouput the result. 18 | gl_Position = mvp * vec4(v, 1.0); 19 | Out.col = c; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_lit.frag: -------------------------------------------------------------------------------- 1 | 2 | layout(location = 0) in INTERFACE { 3 | vec3 vn; ///< World space normal. 4 | } In ; 5 | 6 | layout(set = 0, binding = 0) uniform UniformBlock { 7 | vec3 lightDir; ///< Light direction. 8 | }; 9 | 10 | layout(location = 0) out vec4 fragColor; ///< Color. 11 | 12 | /** Render a mesh with two default lights on each side of the scene. */ 13 | void main(){ 14 | vec3 nn = normalize(In.vn); 15 | // Two basic lights. 16 | float light0 = 0.8 * max(0.0, dot(nn, lightDir)); 17 | float light1 = 0.2 * max(0.0, dot(nn, -lightDir)); 18 | // Color the lights. 19 | fragColor.rgb = light0 * vec3(0.6,0.8,1.0) + light1 * vec3(1.0,0.7,0.6); 20 | fragColor.a = 1.0; 21 | } 22 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_lit.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | layout(location = 1) in vec3 n;///< Normal. 5 | 6 | // Uniform: the MVP. 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | mat4 mvp; ///< The transformation matrix. 9 | }; 10 | 11 | layout(location = 0) out INTERFACE { 12 | vec3 vn;///< World space normal. 13 | } Out; 14 | 15 | /** Apply the transformation to the input vertex. 16 | Compute the world space normal. 17 | */ 18 | void main(){ 19 | // We multiply the coordinates by the MVP matrix, and ouput the result. 20 | gl_Position = mvp * vec4(v, 1.0); 21 | Out.vn = normalize(n); 22 | } 23 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_lit_texture.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec4 vn; ///< World space normal. 5 | vec2 uv; ///< Texture coordinates. 6 | } In ; 7 | 8 | layout(set = 0, binding = 0) uniform UniformBlock { 9 | vec3 lightDir; ///< Light direction. 10 | }; 11 | 12 | layout(set = 2, binding = 0) uniform texture2D texture0; ///< Color texture. 13 | 14 | layout(location = 0) out vec4 fragColor; ///< Color. 15 | 16 | /** Render a textured mesh with three default lights on each side of the scene. */ 17 | void main(){ 18 | vec4 baseColor = texture(sampler2D(texture0, sRepeatLinearLinear), In.uv); 19 | if(baseColor.a < 0.01){ 20 | discard; 21 | } 22 | 23 | vec3 nn = normalize(In.vn.xyz); 24 | // Two basic lights. 25 | float light0 = 0.8 * max(0.0, dot(nn, lightDir)); 26 | float light1 = 0.6 * max(0.0, dot(nn, -lightDir)); 27 | float light2 = 0.3 * max(0.0, dot(nn, lightDir*vec3(1.0,-1.0,1.0))); 28 | // Color the lights. 29 | fragColor.rgb = light0*vec3(0.8,0.9,1.0) + light1*vec3(1.0,0.9,0.8) + light2*vec3(0.8,1.0,0.8); 30 | fragColor.rgb *= baseColor.rgb; 31 | fragColor.a = 1.0; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_lit_texture.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | layout(location = 1) in vec3 n; ///< Normal. 5 | layout(location = 2) in vec2 uv; ///< UV. 6 | 7 | // Uniform: the MVP. 8 | layout(set = 0, binding = 1) uniform UniformBlock { 9 | mat4 mvp; ///< The transformation matrix. 10 | //mat4 normalMatrix; ///< The normal transformation matrix. 11 | }; 12 | 13 | layout(location = 0) out INTERFACE { 14 | vec4 vn; ///< World space normal. 15 | vec2 uv; ///< Texture coordinates. 16 | } Out ; 17 | 18 | /** Apply the transformation to the input vertex. 19 | Compute the world space normal. 20 | */ 21 | void main(){ 22 | // We multiply the coordinates by the MVP matrix, and ouput the result. 23 | gl_Position = mvp * vec4(v, 1.0); 24 | Out.vn.xyz = normalize(n); 25 | Out.vn.w = 0.0; 26 | Out.uv = uv; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_texture.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< Texture coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D texture0; ///< Color texture. 8 | 9 | layout(location = 0) out vec4 fragColor; ///< Color. 10 | 11 | /** Texture each face. */ 12 | void main(){ 13 | fragColor = texture(sampler2D(texture0, sRepeatLinearLinear), In.uv); 14 | } 15 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_texture.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | layout(location = 2) in vec2 uv;///< UV. 5 | 6 | // Uniform: the MVP. 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | mat4 mvp; ///< The transformation matrix. 9 | }; 10 | 11 | layout(location = 0) out INTERFACE { 12 | vec2 uv; ///< Texture coordinates. 13 | } Out; 14 | 15 | /** Apply the MVP transformation to the input vertex. */ 16 | void main(){ 17 | // We multiply the coordinates by the MVP matrix, and ouput the result. 18 | gl_Position = mvp * vec4(v, 1.0); 19 | Out.uv = uv; 20 | } 21 | -------------------------------------------------------------------------------- /resources/common/shaders/objects/object_basic_uniform.frag: -------------------------------------------------------------------------------- 1 | layout(set = 0, binding = 0) uniform UniformBlock { 2 | vec4 color; ///< User-picked color. 3 | }; 4 | 5 | layout(location = 0) out vec4 fragColor; ///< Color. 6 | 7 | /** Color each face with a uniform color. */ 8 | void main(){ 9 | fragColor = color; 10 | } 11 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/bloom.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Lighting buffer to filter. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | float luminanceTh; ///< Luminance minimum threshold. 11 | }; 12 | 13 | layout(location = 0) out vec3 fragColor; ///< Scene color. 14 | 15 | /** Extract the areas of the image where the luminance is higher than 1.0. */ 16 | void main(){ 17 | fragColor = vec3(0.0); 18 | 19 | vec3 color = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0).rgb; 20 | // Compute intensity (luminance). If > 1.0, bloom should be visible. 21 | if(dot(color, vec3(0.289, 0.527, 0.184)) > luminanceTh){ 22 | fragColor = color; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/blur-dual-filter-down.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Image to blur. 8 | 9 | layout(location = 0) out vec3 fragColor; ///< Blurred color. 10 | 11 | /** Downscaling step of the dual filtering. */ 12 | void main(){ 13 | 14 | // Four reads at the corners of the new pixel. 15 | vec2 texSize = vec2(textureSize(screenTexture, 0).xy); 16 | vec2 shift = 1.0/texSize; 17 | vec2 sshift = vec2(-shift.x, shift.y); 18 | 19 | // Color fetches following the described pattern. 20 | vec3 col = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0).rgb * 0.5; 21 | col += textureLod(sampler2D(screenTexture, sClampLinear), In.uv - shift, 0.0).rgb * 0.125; 22 | col += textureLod(sampler2D(screenTexture, sClampLinear), In.uv + shift, 0.0).rgb * 0.125; 23 | col += textureLod(sampler2D(screenTexture, sClampLinear), In.uv - sshift, 0.0).rgb * 0.125; 24 | col += textureLod(sampler2D(screenTexture, sClampLinear), In.uv + sshift, 0.0).rgb * 0.125; 25 | fragColor = col; 26 | } 27 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/blur-gaussian.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Image to blur. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | vec2 fetchOffset; ///< Texture coordinates offset along the correct axis. 11 | }; 12 | 13 | layout(location = 0) out vec3 fragColor; ///< Blurred color. 14 | 15 | /** Performs an approximate 5x5 gaussian blur using two separable passes and three texture fetches in each direction. */ 16 | void main(){ 17 | // 3 taps only are required for a 5x5 gaussian blur, thanks to separation into 18 | // an horizontal and vertical 1D blurs, and to bilinear interpolation. 19 | vec3 col = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0).rgb * 6.0/16.0; 20 | col += textureLod(sampler2D(screenTexture, sClampLinear), In.uv - fetchOffset, 0.0).rgb * 5.0/16.0; 21 | col += textureLod(sampler2D(screenTexture, sClampLinear), In.uv + fetchOffset, 0.0).rgb * 5.0/16.0; 22 | fragColor = col; 23 | } 24 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/box-blur/box-blur-cube.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec3 v;///< Position. 2 | 3 | layout(location = 0) out INTERFACE { 4 | vec3 pos; ///< Position. 5 | } Out ; 6 | 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | vec3 up; ///< Face vertical vector. 9 | vec3 right; ///< Face horizontal vector. 10 | vec3 center; ///< Face center location. 11 | }; 12 | 13 | /** 14 | Generate one triangle covering the whole screen, 15 | with according positions and cubemap positions based on vertices ID. 16 | \sa GLSL::Vert::Passthrough 17 | */ 18 | void main(){ 19 | gl_Position.xy = v.xy; 20 | gl_Position.zw = vec2(1.0); 21 | Out.pos = center + gl_Position.x * right - gl_Position.y * up; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/convolution-pyramid/fill-combine.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Filled image. 8 | layout(set = 2, binding = 1) uniform texture2D inputTexture; ///< Initial image. 9 | 10 | layout(location = 0) out vec4 fragColor; ///< Color. 11 | 12 | 13 | /** Composite the initial image and the filled image in the regions where the initial image is black. */ 14 | void main(){ 15 | 16 | vec3 inputColor = textureLod(sampler2D(inputTexture, sClampLinear), In.uv, 0.0).rgb; 17 | float mask = float(all(equal(inputColor, vec3(0.0)))); 18 | 19 | vec4 fillColor = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0); 20 | fillColor.rgb /= fillColor.a; 21 | 22 | fragColor.rgb = mix(inputColor, fillColor.rgb, mask); 23 | fragColor.a = 1.0; 24 | } 25 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/convolution-pyramid/filter.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Level to filter. 8 | 9 | layout(location = 0) out vec4 fragColor; ///< Color. 10 | 11 | layout(set = 0, binding = 0) uniform UniformBlock { 12 | float g[3]; ///< g filter parameters. 13 | }; 14 | 15 | /** Denotes if a pixel falls outside an image. 16 | \param pos the pixel position 17 | \param size the image size 18 | \return true if the pixel is outside of the image 19 | */ 20 | bool isOutside(ivec2 pos, ivec2 size){ 21 | return (pos.x < 0 || pos.y < 0 || pos.x >= size.x || pos.y >= size.y); 22 | } 23 | 24 | /** Apply the g filter to the input data. */ 25 | void main(){ 26 | vec4 accum = vec4(0.0); 27 | ivec2 size = textureSize(screenTexture, 0).xy; 28 | ivec2 coords = ivec2(floor(gl_FragCoord.xy)); 29 | for(int dy = -1; dy <=1; dy++){ 30 | for(int dx = -1; dx <=1; dx++){ 31 | ivec2 newPix = coords+ivec2(dx,dy); 32 | if(isOutside(newPix, size)){ 33 | continue; 34 | } 35 | accum += g[dx+1] * g[dy+1] * texelFetch(sampler2D(screenTexture, sClampNear), newPix,0); 36 | } 37 | } 38 | fragColor = accum; 39 | } 40 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/convolution-pyramid/passthrough-shift.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Image to pad. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | int padding; ///< The padding to apply. 11 | }; 12 | 13 | layout(location = 0) out vec4 fragColor; ///< Color. 14 | 15 | /** Denotes if a pixel falls outside an image. 16 | \param pos the pixel position 17 | \param size the image size 18 | \return true if the pixel is outside of the image 19 | */ 20 | bool isOutside(ivec2 pos, ivec2 size){ 21 | return (pos.x < 0 || pos.y < 0 || pos.x >= size.x || pos.y >= size.y); 22 | } 23 | 24 | /** Output an image translated by a fixed number of pixels on each axis. useful for padding when rendering in a larger framebuffer. */ 25 | void main(){ 26 | ivec2 coords = ivec2(floor(gl_FragCoord.xy) - padding); 27 | // Check bounds, as texelFetch with out-of-bound coordinates is undefined behaviour. 28 | if(isOutside(coords, textureSize(screenTexture, 0))){ 29 | fragColor = vec4(0.0); 30 | return; 31 | } 32 | fragColor = texelFetch(sampler2D(screenTexture, sClampNear), coords,0); 33 | } 34 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/dof-coc.frag: -------------------------------------------------------------------------------- 1 | #include "utils.glsl" 2 | #include "samplers.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec2 uv; ///< UV coordinates. 6 | } In ; 7 | 8 | layout(set = 2, binding = 0) uniform texture2D colorScene; ///< Scene color. 9 | layout(set = 2, binding = 1) uniform texture2D depthScene; ///< Scene depth. 10 | 11 | layout(set = 0, binding = 0) uniform UniformBlock { 12 | vec2 projParams; ///< Projection depth-related coefficients. 13 | float focusDist; ///< Distance to the focal plane (in view space). 14 | float focusScale; ///< Inverse width of the in-focus region. 15 | }; 16 | 17 | layout(location = 0) out vec3 downscaledColor; ///< Scene color. 18 | layout(location = 1) out vec2 cocDepth; ///< Circle of confusion and depth. 19 | 20 | 21 | /** Compute view-space depth and a circle of confusion radius, for depth of field. */ 22 | void main(){ 23 | // Compute view space depth and circle of confusion. 24 | float depth = abs(linearizeDepth(textureLod(sampler2D(depthScene, sClampLinear), In.uv, 0.0).r, projParams)); 25 | float coc = focusScale * abs(1.0 / focusDist - 1.0 / depth); 26 | cocDepth = vec2(coc, depth); 27 | // Downscale color. 28 | downscaledColor = textureLod(sampler2D(colorScene, sClampLinear), In.uv, 0.0).rgb; 29 | } 30 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/dof-composite.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D fullResSharp; ///< Full res in-focus image. 8 | layout(set = 2, binding = 1) uniform texture2D halfResBlur; ///< Half-res defocused image. 9 | 10 | layout(location = 0) out vec4 fragColor; ///< Scene color. 11 | 12 | /** Mix a half resolution blurred image with a high resolution image, based on the average circle of confidence size 13 | used when generating the blurred image. */ 14 | void main(){ 15 | 16 | vec4 blurColor = textureLod(sampler2D(halfResBlur, sClampLinear), In.uv, 0.0); 17 | vec3 sharpCol = textureLod(sampler2D(fullResSharp, sClampLinear), In.uv, 0.0).rgb; 18 | // If the avg CoC size was below 1.0, we use the sharp image. After that we transition smoothly. 19 | const float cocTh = 5.0; 20 | float blendFactor = clamp((blurColor.a - 1.0)/cocTh, 0.0, 1.0); 21 | fragColor.rgb = mix(sharpCol, blurColor.rgb, blendFactor); 22 | fragColor.a = 1.0; 23 | } 24 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/fill-color.frag: -------------------------------------------------------------------------------- 1 | 2 | layout(location = 0) in INTERFACE { 3 | vec2 uv; ///< UV coordinates. 4 | } In ; 5 | 6 | layout(set = 0, binding = 0) uniform UniformBlock { 7 | vec4 color; ///< Custom fill color. 8 | }; 9 | 10 | layout(location = 0) out vec4 fragColor; ///< Color. 11 | 12 | /** Fill the screen with a fixed color. */ 13 | void main(){ 14 | fragColor = color; 15 | } 16 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/floodfill/color-seeds.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform utexture2D coordsTexture; ///< Seeds coordinates map. 8 | layout(set = 2, binding = 1) uniform texture2D inputTexture; ///< Input color image. 9 | 10 | layout(location = 0) out vec4 fragCoords; ///< Color. 11 | 12 | /** For each pixel, fetch the closest seed coordinates, use them to 13 | query in the input texture and output the corresponding color. */ 14 | void main(){ 15 | ivec2 baseCoords = ivec2(floor(gl_FragCoord.xy)); 16 | // Assume the resolution is the same. 17 | uvec2 seedCoords = texelFetch(usampler2D(coordsTexture, sRepeatNear), baseCoords, 0).xy; 18 | //Rescale the seed coords. 19 | vec2 scaledCoords = vec2(seedCoords.xy)/textureSize(coordsTexture, 0) * textureSize(inputTexture, 0); 20 | ivec2 finalCoords = ivec2(round(scaledCoords)); 21 | // Assume the resolution is the same. 22 | fragCoords = texelFetch(sampler2D(inputTexture, sClampLinear), finalCoords, 0); 23 | } 24 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/floodfill/distance-seeds.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform utexture2D coordsTexture; ///< Seeds coordinates map. 8 | 9 | layout(location = 0) out vec4 fragCoords; ///< Distance. 10 | 11 | /** For each pixel, fetch the closest seed coordinates, and output the normalized euclidean distance with the current point. */ 12 | void main(){ 13 | 14 | ivec2 baseCoords = ivec2(floor(gl_FragCoord.xy)); 15 | // Assume the resolution is the same. 16 | uvec2 seedCoords = texelFetch(usampler2D(coordsTexture, sRepeatNear), baseCoords, 0).xy; 17 | //Rescale the seed coords. 18 | vec2 scaling = 1.0 / textureSize(coordsTexture, 0); 19 | vec2 scaledSeedCoords = scaling*vec2(seedCoords.xy); 20 | vec2 scaledBaseCoords = scaling*vec2(baseCoords.xy); 21 | // Compute L2 distance and store it. 22 | float dist = distance(scaledSeedCoords, scaledBaseCoords); 23 | fragCoords.rgb = vec3(dist); 24 | fragCoords.a = 1.0; 25 | } 26 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/floodfill/extract-seeds.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Color image. 8 | 9 | layout(location = 0) out uvec2 fragCoords; ///< Seeds coordinates. 10 | 11 | const int unknownCoord = 65500; ///< Arbitrary high number. 12 | 13 | /** For each non-black pixel, consider it as a seed and store its coordinates. */ 14 | void main(){ 15 | vec3 col = textureLod(sampler2D(screenTexture, sClampNear), In.uv, 0.0).rgb; 16 | // If a pixel is black, it's not a seed. 17 | if(all(equal(col, vec3(0.0)))){ 18 | fragCoords = uvec2(unknownCoord); 19 | return; 20 | } 21 | fragCoords = uvec2(floor(gl_FragCoord.xy)); 22 | } 23 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/passthrough-pixelperfect.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Image to output. 8 | 9 | layout(location = 0) out vec3 fragColor; ///< Color. 10 | 11 | /** Denotes if a pixel falls outside an image. 12 | \param pos the pixel position 13 | \param size the image size 14 | \return true if the pixel is outside of the image 15 | */ 16 | bool isOutside(ivec2 pos, ivec2 size){ 17 | return (pos.x < 0 || pos.y < 0 || pos.x >= size.x || pos.y >= size.y); 18 | } 19 | 20 | /** Just pass the input image as-is, without any resizing. */ 21 | void main(){ 22 | ivec2 coords = ivec2(gl_FragCoord.xy-0.5); 23 | if(isOutside(coords, textureSize(screenTexture, 0))){ 24 | fragColor = vec3(0.0); 25 | return; 26 | } 27 | fragColor = texelFetch(sampler2D(screenTexture, sClampNear), coords, 0).rgb; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/passthrough.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Image to output. 8 | 9 | layout(location = 0) out vec4 fragColor; ///< Color. 10 | 11 | /** Just pass the input image as-is, potentially performing up/down scaling. */ 12 | void main(){ 13 | 14 | fragColor.rgb = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0).rgb; 15 | fragColor.a = 1.0f; 16 | } 17 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/passthrough.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec3 v;///< Position. 2 | 3 | layout(location = 0) out INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } Out ; 6 | 7 | /** 8 | Passthrough screen covering triangle. 9 | */ 10 | void main(){ 11 | Out.uv = 0.5 * v.xy + 0.5; 12 | gl_Position.xy = v.xy; 13 | gl_Position.zw = vec2(1.0); 14 | } 15 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/scale-texture.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< Texture to overlay. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | float scale; ///< Scaling factor. 11 | }; 12 | 13 | layout(location = 0) out vec4 fragColor; ///< Scene color. 14 | 15 | /** Scale the texture values. */ 16 | void main(){ 17 | 18 | vec4 col = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0); 19 | fragColor = scale * col; 20 | } 21 | -------------------------------------------------------------------------------- /resources/common/shaders/screens/sharpening.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D screenTexture; ///< The input image. 8 | 9 | layout(location = 0) out vec3 fragColor; ///< Final color. 10 | 11 | /** Apply a sharpening filter to the image (based on Uncharted 2 presentation). */ 12 | void main(){ 13 | 14 | vec3 finalColor = textureLod(sampler2D(screenTexture, sClampLinear), In.uv, 0.0).rgb; 15 | vec3 down = textureLodOffset(sampler2D(screenTexture, sClampLinear), In.uv, 0.0, ivec2( 0,-1)).rgb; 16 | vec3 up = textureLodOffset(sampler2D(screenTexture, sClampLinear), In.uv, 0.0, ivec2( 0, 1)).rgb; 17 | vec3 left = textureLodOffset(sampler2D(screenTexture, sClampLinear), In.uv, 0.0, ivec2(-1, 0)).rgb; 18 | vec3 right = textureLodOffset(sampler2D(screenTexture, sClampLinear), In.uv, 0.0, ivec2( 1, 0)).rgb; 19 | 20 | fragColor = clamp(finalColor + 0.2*(4.0 * finalColor - down - up - left - right),0.0,1.0); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /resources/common/shaders/utils/font_sdf.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< Texture coordinates. 5 | } In ; 6 | 7 | layout(set = 0, binding = 0) uniform UniformBlock { 8 | vec4 color; ///< The inner glyph color. 9 | vec4 edgeColor; ///< The outer glyph color. 10 | float edgeWidth; ///< The outer edge width 11 | }; 12 | 13 | layout(set = 2, binding = 0) uniform texture2D fontSdfTexture; ///< The font signed-distance-function atlas. 14 | layout(location = 0) out vec4 fragColor; ///< Color. 15 | 16 | /** Find the isolines of the corresponding glyph to display it on screen. */ 17 | void main(){ 18 | // Flip to [1, -1], where > 0 is outside. 19 | float fontDistance = 1.0 - 2.0 * texture(sampler2D(fontSdfTexture, sClampLinearLinear), In.uv).r; 20 | if(fontDistance > edgeWidth){ 21 | discard; 22 | } else if(fontDistance > 0.0){ 23 | fragColor = edgeColor; 24 | } else { 25 | fragColor = color; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resources/common/shaders/utils/font_sdf.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | layout(location = 2) in vec2 uv;///< Uv coordinates. 5 | 6 | layout(set = 0, binding = 1) uniform UniformBlock { 7 | vec2 position; ///< The position of the anchor point on screen. 8 | float ratio; ///< The screen aspect ratio. 9 | }; 10 | 11 | layout(location = 0) out INTERFACE { 12 | vec2 uv; ///< Texture coordinates. 13 | } Out ; 14 | 15 | 16 | /** Compute the 2D position of the glyph on screen. */ 17 | void main(){ 18 | gl_Position.xy = position + v.xy * vec2(ratio, 1.0); 19 | gl_Position.zw = vec2(1.0); 20 | Out.uv = uv ; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /resources/imagefiltering/shaders/brush_color.frag: -------------------------------------------------------------------------------- 1 | 2 | layout(location = 0) in float dist; ///< Pseudo-distance to the brush center. 3 | 4 | layout(set = 0, binding = 0) uniform UniformBlock { 5 | vec3 color; ///< Brush color. 6 | bool outline; ///< Are we in outline mode. 7 | float radiusPx; ///< Radius of the brush in pixels. 8 | }; 9 | 10 | layout(location = 0) out vec3 fragColor; ///< Output color. 11 | 12 | /** Draw the full brush or its outline. */ 13 | void main(){ 14 | // For the outline case, we only want to display the 'edges' of the brush. 15 | // Those are detemrined by vertices with a dist equal to 1. 16 | // We work in pixels to be radius independent. 17 | if(outline){ 18 | // Allow for a 10 pixels outline. 19 | if(radiusPx*(dist - 1.0) + 10 < 0){ 20 | discard; 21 | } 22 | } 23 | fragColor = color; 24 | } 25 | -------------------------------------------------------------------------------- /resources/imagefiltering/shaders/brush_color.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Brush vertex position. 4 | 5 | layout(set = 0, binding = 1) uniform UniformBlock { 6 | vec2 radius; ///< Brush radius. 7 | vec2 position; ///< Brush center position. 8 | }; 9 | 10 | layout(location = 0) out float dist; ///< Pseudo-distance to the brush center. 11 | 12 | /** Place the brush on screen. */ 13 | void main(){ 14 | // The distance is 0.0 if the vertex is at the brush center, 1.0 everywhere else. 15 | dist = all(equal(v.xy, vec2(0.0))) ? 0.0 : 1.0; 16 | gl_Position.xy = position + radius * v.xy; 17 | gl_Position.zw = vec2(0.0, 1.0); 18 | 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /resources/imageviewer/shaders/image_display.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec3 v;///< Position. 2 | 3 | layout(location = 0) out INTERFACE { 4 | vec2 uv; ///< Texture coordinates. 5 | } Out ; 6 | 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | vec2 flipAxis; ///< Denotes if a flipping has been applied on each axis. 9 | vec2 angleTrig; ///< Applied rotation precomputed cosine and sine. 10 | vec2 mouseShift; ///< Translation. 11 | float screenRatio; ///< Screen h/v ratio. 12 | float imageRatio; ///< Image h/v ratio. 13 | float widthRatio; ///< Image/screen width ratio. 14 | float pixelScale; ///< Scaling. 15 | }; 16 | 17 | /** 18 | Generate one triangle covering the whole screen and compute UV coordinates based on scaling/position/rotation. 19 | */ 20 | void main(){ 21 | gl_Position.xy = v.xy; 22 | gl_Position.zw = vec2(1.0); 23 | // Center uvs and scale/translate. 24 | vec2 uv = pixelScale * gl_Position.xy - 2.0 * mouseShift; 25 | 26 | // Image and screen ratio corrections. 27 | uv *= vec2(imageRatio, screenRatio); 28 | uv *= widthRatio; 29 | 30 | // Rotation. 31 | float nx = angleTrig.x*uv.x+angleTrig.y*uv.y; 32 | float ny = angleTrig.x*uv.y-angleTrig.y*uv.x; 33 | uv = vec2(nx,ny); 34 | 35 | // Flipping 36 | uv *= 1.0 - flipAxis * 2.0; 37 | Out.uv = uv * 0.5 + 0.5; 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /resources/island/shaders/far_ocean_island.vert: -------------------------------------------------------------------------------- 1 | 2 | layout(location = 0) in vec3 v; ///< Position. 3 | 4 | layout(set = 0, binding = 1) uniform UniformBlock { 5 | mat4 mvp; ///< Transformation matrix. 6 | vec3 camPos; ///< Camera world position. 7 | }; 8 | 9 | 10 | layout(location = 0) out vec3 oPos; ///< World position. 11 | layout(location = 1) out vec3 oSrcPos; ///< World position before waves perturbation. 12 | layout(location = 2) out vec3 oPrevPos; ///< World position before small scale waves perturbation. 13 | 14 | 15 | /** Project the cylinder geoemtry onto the far plane of the scene, centered on the camera. */ 16 | void main(){ 17 | vec3 worldPos = v + vec3(camPos.x, 0.0, camPos.z); 18 | gl_Position = mvp * vec4(worldPos, 1.0); 19 | // Send to almost maximal depth. 20 | gl_Position.z = gl_Position.w*0.9999; 21 | oPos = worldPos; 22 | oSrcPos = worldPos; 23 | oPrevPos = worldPos; 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /resources/island/shaders/ocean_island.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | 5 | layout(set = 0, binding = 1) uniform UniformBlock { 6 | vec3 shift; ///< Grid shift. 7 | }; 8 | 9 | layout(location = 0) out vec3 outPos; ///< World position. 10 | 11 | /** Apply the transformation to the input vertex. 12 | Compute the tangent-to-view space transformation matrix. 13 | */ 14 | void main(){ 15 | // Center to camera location, but only step by integer amount wrt the grid cell size. 16 | outPos = v + vec3(shift.x, 0.0, shift.z); 17 | } 18 | -------------------------------------------------------------------------------- /resources/island/textures/absorbscatterwater.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/absorbscatterwater.png -------------------------------------------------------------------------------- /resources/island/textures/caustics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/caustics.png -------------------------------------------------------------------------------- /resources/island/textures/foam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/foam.png -------------------------------------------------------------------------------- /resources/island/textures/island_material_diff_s0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_diff_s0.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_diff_s1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_diff_s1.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_diff_s2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_diff_s2.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_diff_s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_diff_s3.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_diff_s4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_diff_s4.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_nor_s0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_nor_s0.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_nor_s1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_nor_s1.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_nor_s2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_nor_s2.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_nor_s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_nor_s3.jpg -------------------------------------------------------------------------------- /resources/island/textures/island_material_nor_s4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/island_material_nor_s4.jpg -------------------------------------------------------------------------------- /resources/island/textures/sand_normal_flat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/sand_normal_flat.jpg -------------------------------------------------------------------------------- /resources/island/textures/sand_normal_steep.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/sand_normal_steep.jpg -------------------------------------------------------------------------------- /resources/island/textures/wave_normals.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/island/textures/wave_normals.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/cornellbox/cornellbox_backWall_12.obj: -------------------------------------------------------------------------------- 1 | v -1.0 0.0 -1.0 2 | v 1.0 2.0 -1.0 3 | v -1.0 2.0 -1.0 4 | v 1.0 0.0 -1.0 5 | vt 0.0 0.0 6 | vt 1.0 1.0 7 | vt 0.0 1.0 8 | vt 1.0 0.0 9 | vn 0 0 1 10 | f 1/1/1 2/2/1 3/3/1 11 | f 1/1/1 4/4/1 2/2/1 12 | -------------------------------------------------------------------------------- /resources/pbrdemo/cornellbox/cornellbox_ceiling_6.obj: -------------------------------------------------------------------------------- 1 | v -1.0 2.0 -1.0 2 | v 1.0 2.0 1.0 3 | v -1.0 2.0 1.0 4 | v 1.0 2.0 -1.0 5 | vn 0 -1 -0 6 | vt 0.5 0.5 7 | f 1/1/1 2/1/1 3/1/1 8 | f 1/1/1 4/1/1 2/1/1 9 | -------------------------------------------------------------------------------- /resources/pbrdemo/cornellbox/cornellbox_floor_0.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.80 (sub 74) OBJ File: '' 2 | # www.blender.org 3 | v 1.0 0.0 1.0 4 | v -1.0 0.0 -1.0 5 | v -1.0 0.0 1.0 6 | v 1.0 0.0 -1.0 7 | vt 0.0 0.0 8 | vt 1.0 1.0 9 | vt 0.0 1.0 10 | vt 1.0 0.0 11 | vn 0.0000 1.0000 0.0000 12 | s 1 13 | f 1/1/1 2/2/1 3/3/1 14 | f 1/1/1 4/4/1 2/2/1 15 | -------------------------------------------------------------------------------- /resources/pbrdemo/cornellbox/cornellbox_leftWall_24.obj: -------------------------------------------------------------------------------- 1 | v -1.0 -0.0 1.0 2 | v -1.0 2.0 -1.0 3 | v -1.0 2.0 1.0 4 | v -1.0 -0.0 1.0 5 | v -1.0 0.0 -1.0 6 | v -1.0 2.0 -1.0 7 | vn 1.0 0.0 0.0 8 | vt 0.5 0.5 9 | f 1/1/1 2/1/1 3/1/1 10 | f 4/1/1 5/1/1 6/1/1 11 | -------------------------------------------------------------------------------- /resources/pbrdemo/cornellbox/cornellbox_light_90.obj: -------------------------------------------------------------------------------- 1 | v -0.24 1.98 -0.22 2 | v 0.23 1.98 0.16 3 | v -0.24 1.98 0.16 4 | v 0.23 1.98 -0.22 5 | vn 0 -1 0 6 | vn 0 -1 0 7 | vn 0 -1 0 8 | vn 0 -1 0 9 | vt 0.5 0.5 10 | f 1/1/1 2/1/2 3/1/3 11 | f 1/1/1 4/1/4 2/1/2 12 | -------------------------------------------------------------------------------- /resources/pbrdemo/cornellbox/cornellbox_rightWall_18.obj: -------------------------------------------------------------------------------- 1 | v 1.0 0.0 1.0 2 | v 1.0 2.0 -1.0 3 | v 1.0 0.0 -1.0 4 | v 1.0 2.0 1.0 5 | vn -1 0 0 6 | vn -1 0 0 7 | vn -1 0 0 8 | vn -1 0 0 9 | vt 0.5 0.5 10 | f 1/1/1 2/1/2 3/1/3 11 | f 1/1/1 4/1/4 2/1/2 12 | -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_0_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/grey_cube/grey_cube_1_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/grey_cube/grey_cube_shcoeffs.txt: -------------------------------------------------------------------------------- 1 | 0.5 0.5 0.5 2 | 0.0 0.0 0.0 3 | 0.0 0.0 0.0 4 | 0.0 0.0 0.0 5 | 0.0 0.0 0.0 6 | 0.0 0.0 0.0 7 | 0.0 0.0 0.0 8 | 0.0 0.0 0.0 9 | 0.0 0.0 0.0 10 | -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_0_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_1_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_2_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_3_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_4_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_nx.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_nx.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_ny.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_ny.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_nz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_nz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_px.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_px.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_py.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_py.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_pz.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_5_pz.exr -------------------------------------------------------------------------------- /resources/pbrdemo/cubemaps/kiara_dawn/kiara_dawn_shcoeffs.txt: -------------------------------------------------------------------------------- 1 | 0.470512 0.422291 0.568391 2 | 0.148231 0.229858 0.380961 3 | -0.0388138 -0.0401815 0.0176612 4 | -0.0155762 -0.0287683 0.0110365 5 | -0.0500826 -0.0395163 -0.00654324 6 | -0.06901 -0.0563263 -0.0133796 7 | -0.00566574 -0.00463941 -0.028885 8 | 0.00622526 0.000175048 0.00810374 9 | 0.00271689 9.24972e-05 -0.0315401 10 | -------------------------------------------------------------------------------- /resources/pbrdemo/groundplane.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | v -1.000000 0.000000 1.000000 4 | v 1.000000 0.000000 1.000000 5 | v -1.000000 0.000000 -1.000000 6 | v 1.000000 0.000000 -1.000000 7 | vt 0.000100 0.000100 8 | vt 0.999900 0.000100 9 | vt 0.999900 0.999900 10 | vt 0.000100 0.999900 11 | vn 0.000000 1.000000 0.000000 12 | s off 13 | f 2/1/1 4/2/1 3/3/1 14 | f 1/4/1 2/1/1 3/3/1 15 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/deferred/background_gbuffer.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | #include "materials.glsl" 3 | #include "utils.glsl" 4 | 5 | layout(location = 0) in INTERFACE { 6 | vec2 uv; ///< Texture coordinates. 7 | } In ; 8 | 9 | layout(set = 2, binding = 0) uniform texture2D texture0; ///< Image. 10 | 11 | layout(set = 0, binding = 0) uniform UniformBlock { 12 | vec3 bgColor; ///< Background color. 13 | bool useTexture; ///< Should the texture be used instead of the color. 14 | }; 15 | 16 | layout (location = 0) out vec4 fragColor; ///< Color. 17 | layout (location = 1) out vec4 fragNormal; ///< View space normal. 18 | layout (location = 2) out vec4 fragEffects; ///< Effects. 19 | 20 | /** Transfer color along with the material ID, and output a null normal. */ 21 | void main(){ 22 | 23 | vec3 color = useTexture ? textureLod(sampler2D(texture0, sClampLinear), In.uv, 0.0).rgb : bgColor; 24 | // Normalize emissive color, store intensity in effects texture. 25 | float m = max(max(color.r, 0.001), max(color.g, color.b)); 26 | fragColor.rgb = color / m; 27 | fragColor.a = encodeMaterial(MATERIAL_UNLIT); 28 | fragNormal.rg = encodeNormal(vec3(0.0)); 29 | fragNormal.ba = vec2(0.0); 30 | fragEffects = floatToVec4(m); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/deferred/object_gbuffer.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | layout(location = 1) in vec3 n; ///< Normal. 5 | layout(location = 2) in vec2 uv; ///< Texture coordinates. 6 | layout(location = 3) in vec3 tang; ///< Tangent. 7 | layout(location = 4) in vec3 bitan; ///< Bitangent. 8 | 9 | layout(set = 0, binding = 1) uniform UniformBlock { 10 | mat4 mvp; ///< MVP transformation matrix. 11 | mat4 normalMatrix; ///< Normal transformation matrix. 12 | bool hasUV; ///< Does the mesh have texture coordinates. 13 | }; 14 | 15 | layout(location = 0) out INTERFACE { 16 | mat4 tbn; ///< Normal to view matrix. 17 | vec4 uv; ///< UV coordinateS. 18 | } Out ; 19 | 20 | /** Apply the transformation to the input vertex. 21 | Compute the tangent-to-view space transformation matrix. 22 | */ 23 | void main(){ 24 | // We multiply the coordinates by the MVP matrix, and ouput the result. 25 | gl_Position = mvp * vec4(v, 1.0); 26 | 27 | Out.uv.xy = hasUV ? uv : vec2(0.5); 28 | Out.uv.zw = vec2(0.0); 29 | 30 | // Compute the TBN matrix (from tangent space to view space). 31 | mat3 nMat = mat3(normalMatrix); 32 | vec3 T = hasUV ? (nMat * tang) : vec3(0.0); 33 | vec3 B = hasUV ? (nMat * bitan) : vec3(0.0); 34 | vec3 N = (nMat * n); 35 | Out.tbn = mat4(mat3(T, B, N)); 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/deferred/skybox_gbuffer.frag: -------------------------------------------------------------------------------- 1 | #include "utils.glsl" 2 | #include "samplers.glsl" 3 | #include "materials.glsl" 4 | 5 | layout(location = 0) in INTERFACE { 6 | vec3 pos; ///< Position in model space. 7 | } In ; 8 | 9 | layout(set = 2, binding = 0) uniform textureCube texture0; ///< Albedo. 10 | 11 | layout (location = 0) out vec4 fragColor; ///< Color. 12 | layout (location = 1) out vec4 fragNormal; ///< View space normal. 13 | layout (location = 2) out vec4 fragEffects; ///< Effects. 14 | 15 | /** Transfer albedo along with the material ID, and output a null normal. */ 16 | void main(){ 17 | vec3 color = textureLod(samplerCube(texture0, sClampLinear), toCube(normalize(In.pos)), 0.0).rgb; 18 | // Normalize emissive color, store intensity in effects texture. 19 | float m = max(max(color.r, 0.001), max(color.g, color.b)); 20 | fragColor.rgb = color / m; 21 | fragColor.a = encodeMaterial(MATERIAL_UNLIT); 22 | fragNormal.rg = encodeNormal(vec3(0.0)); 23 | fragNormal.ba = vec2(0.0); 24 | fragEffects = floatToVec4(m); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/forward/atmosphere_forward.frag: -------------------------------------------------------------------------------- 1 | 2 | #include "atmosphere.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec2 uv; ///< Texture coordinates. 6 | } In ; 7 | 8 | layout(set = 0, binding = 0) uniform UniformBlock { 9 | mat4 clipToWorld; ///< Clip-to-world space transformation matrix. 10 | vec3 viewPos; ///< The position in view space. 11 | vec3 lightDirection; ///< The light direction in world space. 12 | }; 13 | 14 | layout(set = 2, binding = 0) uniform texture2D precomputedScattering; ///< Secondary scattering lookup table. 15 | 16 | layout(location = 0) out vec4 fragColor; ///< Atmosphere color. 17 | 18 | /** Simulate sky color based on an atmospheric scattering approximate model. */ 19 | void main(){ 20 | // Move to -1,1 21 | vec4 clipVertex = vec4(-1.0+2.0*In.uv, 0.0, 1.0); 22 | // Then to world space. 23 | vec3 viewRay = normalize((clipToWorld * clipVertex).xyz); 24 | 25 | // We then move to the ground model space, where the ground is at y=0. 26 | vec3 groundSpaceViewPos = viewPos + vec3(0.0, 1.0, 0.0); 27 | vec3 atmosphereColor = computeAtmosphereRadiance(groundSpaceViewPos, viewRay, lightDirection, precomputedScattering, defaultAtmosphere); 28 | 29 | fragColor.rgb = atmosphereColor; 30 | fragColor.a = -1.0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/forward/background_forward.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< UV coordinates. 5 | } In; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D texture0; ///< Image. 8 | 9 | layout(set = 0, binding = 0) uniform UniformBlock { 10 | vec3 bgColor; ///< Background color. 11 | bool useTexture; ///< Should the texture be used instead of the color. 12 | }; 13 | 14 | layout(location = 0) out vec4 fragColor; ///< Color. 15 | 16 | /** Transfer color. */ 17 | void main(){ 18 | 19 | fragColor.rgb = useTexture ? textureLod(sampler2D(texture0, sRepeatLinear), In.uv, 0.0).rgb : bgColor; 20 | fragColor.a = -1.0; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/forward/object_prepass_forward.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | #include "utils.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec4 n; ///< Normal direction. 6 | vec2 uv; ///< Texture coordinates. 7 | } In ; 8 | 9 | layout(set = 2, binding = 0) uniform texture2D mask; ///< RGBA texture. 10 | 11 | layout(set = 0, binding = 0) uniform UniformBlock { 12 | bool hasMask; ///< Alpha masking applied. 13 | }; 14 | 15 | layout (location = 0) out vec4 fragNormal; ///< Geometric normal. 16 | 17 | /** Just output the interpolated normal. */ 18 | void main(){ 19 | 20 | // Mask cutout. 21 | if(hasMask){ 22 | float a = texture(sampler2D(mask, sRepeatLinearLinear), In.uv).a; 23 | if(a <= 0.01){ 24 | discard; 25 | } 26 | } 27 | 28 | // Flip the up of the local frame for back facing fragments. 29 | vec3 n = In.n.xyz; 30 | n *= (gl_FrontFacing ? 1.0 : -1.0); 31 | fragNormal= vec4(encodeNormal(normalize(n)), 0.0, 1.0); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/forward/object_prepass_forward.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v; ///< Position. 4 | layout(location = 1) in vec3 n; ///< Normal. 5 | layout(location = 2) in vec2 uv; ///< Texture coordinates. 6 | 7 | layout(set = 0, binding = 1) uniform UniformBlock { 8 | mat4 mvp; ///< MVP transformation matrix. 9 | mat4 normalMatrix; ///< Normal transformation matrix. 10 | bool hasUV; ///< Does the mesh have UV. 11 | }; 12 | 13 | layout(location = 0) out INTERFACE { 14 | vec4 n; ///< Normal direction. 15 | vec2 uv; ///< Texture coordinates. 16 | } Out ; 17 | 18 | /** Apply the transformation to the input vertex. 19 | */ 20 | void main(){ 21 | // We multiply the coordinates by the MVP matrix, and ouput the result. 22 | gl_Position = mvp * vec4(v, 1.0); 23 | 24 | Out.uv = hasUV ? uv : vec2(0.5); 25 | Out.n.xyz = normalize(mat3(normalMatrix) * n); 26 | Out.n.w = 0.0; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /resources/pbrdemo/shaders/forward/skybox_forward.frag: -------------------------------------------------------------------------------- 1 | #include "utils.glsl" 2 | #include "samplers.glsl" 3 | 4 | layout(location = 0) in INTERFACE { 5 | vec3 pos; ///< Position in model space. 6 | } In ; 7 | 8 | layout(set = 2, binding = 0) uniform textureCube texture0; ///< Cubemap color. 9 | 10 | layout(location = 0) out vec4 fragColor; ///< Color. 11 | 12 | /** Use the normalized position to read in the cube map. */ 13 | void main(){ 14 | fragColor.rgb = textureLod(samplerCube(texture0, sClampLinear), toCube(normalize(In.pos)), 0.0).rgb; 15 | fragColor.a = -1.0; 16 | } 17 | -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ceramic_tiles_blue_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ceramic_tiles_blue_color.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ceramic_tiles_blue_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ceramic_tiles_blue_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ceramic_tiles_blue_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ceramic_tiles_blue_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_blue.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_green.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_grey.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_orange.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_red.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_rough_met_ao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_rough_met_ao.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/cornellbox_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/cornellbox_white.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ground_leaves_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ground_leaves_color.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ground_leaves_depth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ground_leaves_depth.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ground_leaves_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ground_leaves_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/ground_leaves_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/ground_leaves_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leather_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leather_color.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leather_depth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leather_depth.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leather_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leather_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leather_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leather_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leaves_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leaves_color.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leaves_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leaves_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/leaves_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/leaves_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/light_grid.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/light_grid.exr -------------------------------------------------------------------------------- /resources/pbrdemo/textures/metal_brushed_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/metal_brushed_color.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/metal_brushed_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/metal_brushed_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/metal_brushed_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/metal_brushed_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/plastic_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/plastic_color.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/plastic_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/plastic_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/plastic_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/plastic_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/squares_rough_met_ao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/squares_rough_met_ao.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/vitrail_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/vitrail_color.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/vitrail_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/vitrail_normal.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/vitrail_rough_met_ao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/vitrail_rough_met_ao.png -------------------------------------------------------------------------------- /resources/pbrdemo/textures/wood_floor_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/wood_floor_color.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/wood_floor_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/wood_floor_normal.jpg -------------------------------------------------------------------------------- /resources/pbrdemo/textures/wood_floor_rough_met_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/pbrdemo/textures/wood_floor_rough_met_ao.jpg -------------------------------------------------------------------------------- /resources/shaderbench/non-2d-texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/shaderbench/non-2d-texture.png -------------------------------------------------------------------------------- /resources/shaderbench/shaders/shaderbench.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec3 v;///< Position. 2 | 3 | layout(set = 0, binding = 1) uniform UniformBlock { 4 | mat4 iViewProjInv; ///< Inverse view proj matrix. 5 | }; 6 | 7 | layout(location = 0) out INTERFACE { 8 | vec4 dir; ///< View world direction. 9 | vec2 uv; ///< Texture coordinates. 10 | } Out ; 11 | 12 | /** Render triangle on screen. Interpolate UV and view direction.*/ 13 | void main(){ 14 | vec2 temp = 0.5 * v.xy + 0.5; 15 | Out.uv = temp; 16 | gl_Position.xy = v.xy; 17 | gl_Position.zw = vec2(1.0); 18 | 19 | // Perform back projection to get a world space ray dir. 20 | Out.dir.xyz = vec3(iViewProjInv * gl_Position); 21 | Out.dir.w = 0.0; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /resources/shaderbench/shadertoy-font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/shaderbench/shadertoy-font.png -------------------------------------------------------------------------------- /resources/snakegame/cubemap/env_nx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/cubemap/env_nx.png -------------------------------------------------------------------------------- /resources/snakegame/cubemap/env_ny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/cubemap/env_ny.png -------------------------------------------------------------------------------- /resources/snakegame/cubemap/env_nz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/cubemap/env_nz.png -------------------------------------------------------------------------------- /resources/snakegame/cubemap/env_px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/cubemap/env_px.png -------------------------------------------------------------------------------- /resources/snakegame/cubemap/env_py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/cubemap/env_py.png -------------------------------------------------------------------------------- /resources/snakegame/cubemap/env_pz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/cubemap/env_pz.png -------------------------------------------------------------------------------- /resources/snakegame/digits.fnt: -------------------------------------------------------------------------------- 1 | # Atlas name 2 | digits_font_atlas 3 | # First supported char 4 | 0 5 | # Last supported char 6 | 9 7 | # Margins around each glyph 8 | 4 8 9 | # Glyphs bounding boxes 10 | 16 16 101 162 11 | 125 16 170 162 12 | 210 16 295 162 13 | 305 16 390 162 14 | 402 16 497 162 15 | 18 188 104 333 16 | 114 188 200 333 17 | 214 188 298 333 18 | 308 188 394 333 19 | 405 188 491 333 20 | -------------------------------------------------------------------------------- /resources/snakegame/digits_font_atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/digits_font_atlas.png -------------------------------------------------------------------------------- /resources/snakegame/menubg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/menubg.png -------------------------------------------------------------------------------- /resources/snakegame/shaders/colored_object.frag: -------------------------------------------------------------------------------- 1 | #include "utils.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec3 n; ///< The world-space normal. 5 | } In; 6 | 7 | layout(set = 0, binding = 0) uniform UniformBlock { 8 | int matID; ///< The material index. 9 | }; 10 | 11 | layout(location = 0) out vec4 fragNormal; ///< Normal. 12 | layout(location = 1) out float fragId; ///< Material ID. 13 | 14 | /** Outputs the object world-space normal and the material index. */ 15 | void main(){ 16 | fragNormal.rg = encodeNormal(normalize(In.n)); 17 | fragNormal.ba = vec2(1.0); 18 | fragId = float(matID)/255.0; 19 | } 20 | -------------------------------------------------------------------------------- /resources/snakegame/shaders/colored_object.vert: -------------------------------------------------------------------------------- 1 | 2 | // Attributes 3 | layout(location = 0) in vec3 v;///< Position. 4 | layout(location = 1) in vec3 n; ///< Normal. 5 | 6 | layout(set = 0, binding = 1) uniform UniformBlock { 7 | mat4 mvp; ///< The transformation matrix. 8 | mat4 normalMat; ///< Model to world space for normals. 9 | }; 10 | 11 | layout(location = 0) out INTERFACE { 12 | vec3 n; ///< The world space normal. 13 | } Out; 14 | 15 | /** Apply the MVP transformation to the input vertex. */ 16 | void main(){ 17 | // We multiply the coordinates by the MVP matrix, and ouput the result. 18 | gl_Position = mvp * vec4(v, 1.0); 19 | Out.n = mat3(normalMat) * n; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /resources/snakegame/shaders/menu_button.frag: -------------------------------------------------------------------------------- 1 | layout(set = 0, binding = 0) uniform UniformBlock { 2 | vec4 color; ///< The button color. 3 | }; 4 | 5 | layout(location = 0) out vec4 fragColor; ///< Color. 6 | 7 | /** Apply the button color. */ 8 | void main(){ 9 | fragColor = color; 10 | } 11 | -------------------------------------------------------------------------------- /resources/snakegame/shaders/menu_button.vert: -------------------------------------------------------------------------------- 1 | // Attributes 2 | layout(location = 0) in vec3 v;///< Position. 3 | 4 | // Uniforms. 5 | layout(set = 0, binding = 1) uniform UniformBlock { 6 | vec2 position; ///< Image position. 7 | vec2 scale; ///< Image scale. 8 | float depth; ///< Image Z-layer. 9 | }; 10 | 11 | /** Compute the position of the button on screen. */ 12 | void main(){ 13 | gl_Position.xy = scale * v.xy + position; 14 | gl_Position.zw = vec2(depth, 1.0); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /resources/snakegame/shaders/menu_image.frag: -------------------------------------------------------------------------------- 1 | #include "samplers.glsl" 2 | 3 | layout(location = 0) in INTERFACE { 4 | vec2 uv; ///< Texture coordinates. 5 | } In ; 6 | 7 | layout(set = 2, binding = 0) uniform texture2D imageTexture; ///< Image to display. 8 | layout(location = 0) out vec4 fragColor; ///< Color. 9 | 10 | /** Apply the image. */ 11 | void main(){ 12 | fragColor = texture(sampler2D(imageTexture, sClampLinearLinear), In.uv); 13 | } 14 | -------------------------------------------------------------------------------- /resources/snakegame/shaders/menu_image.vert: -------------------------------------------------------------------------------- 1 | // Attributes 2 | layout(location = 0) in vec3 v;///< Position. 3 | 4 | // Uniforms. 5 | layout(set = 0, binding = 1) uniform UniformBlock { 6 | vec2 position; ///< Image position. 7 | vec2 scale; ///< Image scale. 8 | float depth; ///< Image Z-layer. 9 | }; 10 | 11 | layout(location = 0) out INTERFACE { 12 | vec2 uv; ///< Texture coordinates. 13 | } Out ; 14 | 15 | /** Compute the position of the menu image on screen. */ 16 | void main(){ 17 | gl_Position.xy = scale * v.xy + position; 18 | gl_Position.zw = vec2(depth, 1.0); 19 | Out.uv = 0.5 * v.xy + 0.5; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /resources/snakegame/texts/button-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-back.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-fullscreen.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-halfres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-halfres.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-menu.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-newgame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-newgame.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-options.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-quit.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-resume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-resume.png -------------------------------------------------------------------------------- /resources/snakegame/texts/button-vsync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/texts/button-vsync.png -------------------------------------------------------------------------------- /resources/snakegame/titles/title-dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/titles/title-dead.png -------------------------------------------------------------------------------- /resources/snakegame/titles/title-options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/titles/title-options.png -------------------------------------------------------------------------------- /resources/snakegame/titles/title-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/titles/title-pause.png -------------------------------------------------------------------------------- /resources/snakegame/titles/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/resources/snakegame/titles/title.png -------------------------------------------------------------------------------- /src/engine/Common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | # define NOMINMAX 5 | #endif 6 | 7 | #define GLM_FORCE_RADIANS 8 | #define GLM_FORCE_DEPTH_ZERO_TO_ONE 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | typedef unsigned char uchar; 25 | typedef unsigned int uint; 26 | typedef unsigned long ulong; 27 | 28 | #ifdef _WIN32 29 | # undef near 30 | # undef far 31 | # undef ERROR 32 | #endif 33 | 34 | #include "system/Logger.hpp" 35 | 36 | #define STD_HASH(ENUM_NAME) \ 37 | template <> struct std::hash { \ 38 | std::size_t operator()(const ENUM_NAME & t) const { return static_cast::type>(t); } \ 39 | }; 40 | -------------------------------------------------------------------------------- /src/engine/input/controller/GamepadController.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "input/controller/Controller.hpp" 3 | 4 | /** 5 | \brief Represents a controller with a predefined mapping provided by GLFW/SDL. 6 | \ingroup Input 7 | */ 8 | class GamepadController final : public Controller { 9 | 10 | public: 11 | /** 12 | \copydoc Controller::activate 13 | */ 14 | bool activate(int id) override; 15 | 16 | /** 17 | \copydoc Controller::deactivate 18 | */ 19 | void deactivate() override; 20 | 21 | /** 22 | \copydoc Controller::update 23 | */ 24 | void update() override; 25 | }; 26 | -------------------------------------------------------------------------------- /src/engine/input/controller/RawController.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "input/controller/Controller.hpp" 4 | #include "Common.hpp" 5 | 6 | /** 7 | \brief Represents a controller used for debug, where all raw buttons are shown. 8 | \ingroup Input 9 | */ 10 | class RawController final : public Controller { 11 | 12 | public: 13 | /** 14 | \copydoc Controller::activate 15 | */ 16 | bool activate(int id) override; 17 | 18 | /** 19 | \copydoc Controller::deactivate 20 | */ 21 | void deactivate() override; 22 | 23 | /** 24 | \copydoc Controller::update 25 | */ 26 | void update() override; 27 | 28 | std::vector allAxes; ///< Raw intensity values on all axes. 29 | std::vector allButtons; ///< State of each button. 30 | 31 | private: 32 | int _rawAxesCount = 0; ///< Number of axes returned by the system. 33 | int _rawButtonsCount = 0; ///< Number of buttons returned by the system. 34 | }; 35 | -------------------------------------------------------------------------------- /src/engine/renderers/LightRenderer.cpp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/engine/renderers/LightRenderer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "system/Config.hpp" 3 | 4 | class DirectionalLight; 5 | class PointLight; 6 | class SpotLight; 7 | 8 | /** 9 | \brief Base structure of a per-light specialized renderer. 10 | \details It can be applied to a light by calling light->draw(renderer), which will then call the corresponding method below. 11 | \ingroup Renderers 12 | */ 13 | class LightRenderer { 14 | 15 | public: 16 | 17 | /** Perform a rendering task for a directional light. 18 | \param light the light to visit. 19 | */ 20 | virtual void draw(const DirectionalLight * light) = 0; 21 | 22 | /** Perform a rendering task for a point light. 23 | \param light the light to visit. 24 | */ 25 | virtual void draw(const PointLight * light) = 0; 26 | 27 | /** Perform a rendering task for a spot light. 28 | \param light the light to visit. 29 | */ 30 | virtual void draw(const SpotLight * light) = 0; 31 | 32 | 33 | }; 34 | -------------------------------------------------------------------------------- /src/engine/renderers/Renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "Renderer.hpp" 2 | 3 | Renderer::Renderer(const std::string & name) : _name(name) { 4 | 5 | } 6 | 7 | void Renderer::draw(const Camera &, Texture*, Texture*, uint){ 8 | Log::Error() << "Renderer: Unimplemented draw function." << std::endl; 9 | assert(false); 10 | } 11 | 12 | void Renderer::interface(){ 13 | Log::Error() << "Renderer: Unimplemented interface function." << std::endl; 14 | assert(false); 15 | } 16 | 17 | void Renderer::resize(uint, uint){ 18 | } 19 | -------------------------------------------------------------------------------- /src/engine/scene/Sky.cpp: -------------------------------------------------------------------------------- 1 | #include "scene/Sky.hpp" 2 | 3 | Sky::Sky(Storage options) : 4 | Object(Resources::manager().getMesh("plane", options), false) { 5 | } 6 | 7 | bool Sky::decode(const KeyValues & params, Storage options) { 8 | bool success = Object::decode(params, options); 9 | for(const auto & param : params.elements) { 10 | if(param.key == "sun") { 11 | const glm::vec3 newDir = Codable::decodeVec3(param); 12 | if(newDir == glm::vec3(0.0f)){ 13 | Log::Info() << "Invalid null sun direction." << std::endl; 14 | return false; 15 | } 16 | _sunDirection.reset(glm::normalize(newDir)); 17 | 18 | } 19 | } 20 | return success; 21 | } 22 | 23 | KeyValues Sky::encode() const { 24 | KeyValues obj = Object::encode(); 25 | obj.elements.emplace_back("sun"); 26 | obj.elements.back().values = Codable::encode(_sunDirection.initial()); 27 | return obj; 28 | } 29 | 30 | void Sky::update(double fullTime, double frameTime) { 31 | glm::vec4 dir = glm::vec4(_sunDirection.get(), 0.0f); 32 | for(auto & anim : _animations) { 33 | dir = anim->apply(dir, fullTime, frameTime); 34 | } 35 | _sunDirection = glm::normalize(glm::vec3(dir)); 36 | } 37 | -------------------------------------------------------------------------------- /src/engine/system/Query.cpp: -------------------------------------------------------------------------------- 1 | #include "system/Query.hpp" 2 | 3 | Query::Query() { 4 | 5 | } 6 | 7 | void Query::begin() { 8 | if(_running) { 9 | Log::Warning() << "A query is already running. Ignoring the restart." << std::endl; 10 | return; 11 | } 12 | _start = std::chrono::high_resolution_clock::now(); 13 | _running = true; 14 | } 15 | 16 | void Query::end() { 17 | if(!_running) { 18 | Log::Warning() << "No query running currently. Ignoring the stop." << std::endl; 19 | return; 20 | } 21 | _end = std::chrono::high_resolution_clock::now(); 22 | _running = false; 23 | } 24 | 25 | uint64_t Query::value() { 26 | if(_running) { 27 | Log::Warning() << "A query is currently running, stopping it first." << std::endl; 28 | end(); 29 | } 30 | const long long duration = std::chrono::duration_cast(_end - _start).count(); 31 | return uint64_t(duration); 32 | } 33 | -------------------------------------------------------------------------------- /src/engine/system/Query.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "system/Config.hpp" 4 | #include "Common.hpp" 5 | 6 | #include 7 | 8 | /** 9 | \brief Perform CPU duration measurement between two time points. 10 | \ingroup System 11 | */ 12 | class Query { 13 | public: 14 | 15 | 16 | /** Constructor. 17 | */ 18 | Query(); 19 | 20 | /** Start measuring the timing. */ 21 | void begin(); 22 | 23 | /** End the measurement. */ 24 | void end(); 25 | 26 | /** Query the last timing measured. Unit used is nanoseconds. 27 | \return the raw metric value */ 28 | uint64_t value(); 29 | 30 | private: 31 | 32 | std::chrono::time_point _start; ///< Timing start point. 33 | std::chrono::time_point _end; ///< Timing end point. 34 | bool _running = false; ///< Is a measurement currently taking place. 35 | }; 36 | -------------------------------------------------------------------------------- /src/libs/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /src/libs/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION@ 9 | URL: https://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /src/libs/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 2 | -------------------------------------------------------------------------------- /src/libs/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //! Workaround for compatibility with other libraries 4 | #ifdef max 5 | #undef max 6 | #endif 7 | 8 | //! Workaround for compatibility with other libraries 9 | #ifdef min 10 | #undef min 11 | #endif 12 | 13 | //! Workaround for Android 14 | #ifdef isnan 15 | #undef isnan 16 | #endif 17 | 18 | //! Workaround for Android 19 | #ifdef isinf 20 | #undef isinf 21 | #endif 22 | 23 | //! Workaround for Chrone Native Client 24 | #ifdef log2 25 | #undef log2 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /src/libs/glm/detail/compute_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#include "compute_common.hpp" 4 | #include "setup.hpp" 5 | #include 6 | 7 | namespace glm{ 8 | namespace detail 9 | { 10 | template 11 | struct compute_equal 12 | { 13 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) 14 | { 15 | return a == b; 16 | } 17 | }; 18 | /* 19 | template 20 | struct compute_equal 21 | { 22 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) 23 | { 24 | return detail::compute_abs::is_signed>::call(b - a) <= static_cast(0); 25 | //return std::memcmp(&a, &b, sizeof(T)) == 0; 26 | } 27 | }; 28 | */ 29 | }//namespace detail 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /src/libs/glm/detail/func_exponential_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_exponential_simd.inl 3 | 4 | #include "../simd/exponential.h" 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | template 12 | struct compute_sqrt<4, float, Q, true> 13 | { 14 | GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) 15 | { 16 | vec<4, float, Q> Result; 17 | Result.data = _mm_sqrt_ps(v.data); 18 | return Result; 19 | } 20 | }; 21 | 22 | # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE 23 | template<> 24 | struct compute_sqrt<4, float, aligned_lowp, true> 25 | { 26 | GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v) 27 | { 28 | vec<4, float, aligned_lowp> Result; 29 | Result.data = glm_vec4_sqrt_lowp(v.data); 30 | return Result; 31 | } 32 | }; 33 | # endif 34 | }//namespace detail 35 | }//namespace glm 36 | 37 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 38 | -------------------------------------------------------------------------------- /src/libs/glm/detail/func_packing_simd.inl: -------------------------------------------------------------------------------- 1 | namespace glm{ 2 | namespace detail 3 | { 4 | 5 | }//namespace detail 6 | }//namespace glm 7 | -------------------------------------------------------------------------------- /src/libs/glm/detail/func_trigonometric_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/src/libs/glm/detail/func_trigonometric_simd.inl -------------------------------------------------------------------------------- /src/libs/glm/detail/func_vector_relational_simd.inl: -------------------------------------------------------------------------------- 1 | namespace glm{ 2 | namespace detail 3 | { 4 | 5 | }//namespace detail 6 | }//namespace glm 7 | -------------------------------------------------------------------------------- /src/libs/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "setup.hpp" 4 | 5 | namespace glm{ 6 | namespace detail 7 | { 8 | typedef short hdata; 9 | 10 | GLM_FUNC_DECL float toFloat32(hdata value); 11 | GLM_FUNC_DECL hdata toFloat16(float const& value); 12 | 13 | }//namespace detail 14 | }//namespace glm 15 | 16 | #include "type_half.inl" 17 | -------------------------------------------------------------------------------- /src/libs/glm/detail/type_mat4x4_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | 3 | namespace glm 4 | { 5 | 6 | }//namespace glm 7 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_common.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_matrix_common 2 | /// @file glm/ext/matrix_common.hpp 3 | /// 4 | /// @defgroup ext_matrix_common GLM_EXT_matrix_common 5 | /// @ingroup ext 6 | /// 7 | /// Defines functions for common matrix operations. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_matrix_common 12 | 13 | #pragma once 14 | 15 | #include "../detail/qualifier.hpp" 16 | #include "../detail/_fixes.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_matrix_transform extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_matrix_common 25 | /// @{ 26 | 27 | template 28 | GLM_FUNC_DECL mat mix(mat const& x, mat const& y, mat const& a); 29 | 30 | template 31 | GLM_FUNC_DECL mat mix(mat const& x, mat const& y, U a); 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "matrix_common.inl" 37 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_common.inl: -------------------------------------------------------------------------------- 1 | #include "../matrix.hpp" 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, U a) 7 | { 8 | return mat(x) * (static_cast(1) - a) + mat(y) * a; 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, mat const& a) 13 | { 14 | return matrixCompMult(mat(x), static_cast(1) - a) + matrixCompMult(mat(y), a); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double2x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double2x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 2 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 2, double, defaultp> dmat2x2; 16 | 17 | /// 2 columns of 2 components matrix of double-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<2, 2, double, defaultp> dmat2; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double2x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double2x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 3 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 3, double, defaultp> dmat2x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double2x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double2x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 4 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 4, double, defaultp> dmat2x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double3x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double3x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 2 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 2, double, defaultp> dmat3x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double3x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double3x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 3 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 3, double, defaultp> dmat3x3; 16 | 17 | /// 3 columns of 3 components matrix of double-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<3, 3, double, defaultp> dmat3; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double3x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double3x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 4 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 4, double, defaultp> dmat3x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double4x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double4x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 2 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 2, double, defaultp> dmat4x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double4x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double4x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 3 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 3, double, defaultp> dmat4x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_double4x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_double4x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 4 components matrix of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 4, double, defaultp> dmat4x4; 16 | 17 | /// 4 columns of 4 components matrix of double-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<4, 4, double, defaultp> dmat4; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float2x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float2x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 2 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 2, float, defaultp> mat2x2; 16 | 17 | /// 2 columns of 2 components matrix of single-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<2, 2, float, defaultp> mat2; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float2x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float2x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 3 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 3, float, defaultp> mat2x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float2x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float2x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat2x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 2 columns of 4 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<2, 4, float, defaultp> mat2x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float3x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float3x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core 10 | /// @{ 11 | 12 | /// 3 columns of 2 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 2, float, defaultp> mat3x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float3x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float3x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 3 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 3, float, defaultp> mat3x3; 16 | 17 | /// 3 columns of 3 components matrix of single-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<3, 3, float, defaultp> mat3; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float3x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float3x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat3x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 3 columns of 4 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<3, 4, float, defaultp> mat3x4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float4x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float4x2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 2 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 2, float, defaultp> mat4x2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float4x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float4x3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 3 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 3, float, defaultp> mat4x3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/matrix_float4x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/matrix_float4x4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_mat4x4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @ingroup core_matrix 10 | /// @{ 11 | 12 | /// 4 columns of 4 components matrix of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 15 | typedef mat<4, 4, float, defaultp> mat4x4; 16 | 17 | /// 4 columns of 4 components matrix of single-precision floating-point numbers. 18 | /// 19 | /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices 20 | typedef mat<4, 4, float, defaultp> mat4; 21 | 22 | /// @} 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/ext/quaternion_common_simd.inl: -------------------------------------------------------------------------------- 1 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 2 | 3 | namespace glm{ 4 | namespace detail 5 | { 6 | template 7 | struct compute_dot, float, true> 8 | { 9 | static GLM_FUNC_QUALIFIER float call(qua const& x, qua const& y) 10 | { 11 | return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); 12 | } 13 | }; 14 | }//namespace detail 15 | }//namespace glm 16 | 17 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 18 | 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/quaternion_double.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_double 2 | /// @file glm/ext/quaternion_double.hpp 3 | /// 4 | /// @defgroup ext_quaternion_double GLM_EXT_quaternion_double 5 | /// @ingroup ext 6 | /// 7 | /// Exposes double-precision floating point quaternion type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_quaternion_float 12 | /// @see ext_quaternion_double_precision 13 | /// @see ext_quaternion_common 14 | /// @see ext_quaternion_exponential 15 | /// @see ext_quaternion_geometric 16 | /// @see ext_quaternion_relational 17 | /// @see ext_quaternion_transform 18 | /// @see ext_quaternion_trigonometric 19 | 20 | #pragma once 21 | 22 | // Dependency: 23 | #include "../detail/type_quat.hpp" 24 | 25 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 26 | # pragma message("GLM: GLM_EXT_quaternion_double extension included") 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup ext_quaternion_double 32 | /// @{ 33 | 34 | /// Quaternion of double-precision floating-point numbers. 35 | typedef qua dquat; 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | -------------------------------------------------------------------------------- /src/libs/glm/ext/quaternion_float.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_quaternion_float 2 | /// @file glm/ext/quaternion_float.hpp 3 | /// 4 | /// @defgroup ext_quaternion_float GLM_EXT_quaternion_float 5 | /// @ingroup ext 6 | /// 7 | /// Exposes single-precision floating point quaternion type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_quaternion_double 12 | /// @see ext_quaternion_float_precision 13 | /// @see ext_quaternion_common 14 | /// @see ext_quaternion_exponential 15 | /// @see ext_quaternion_geometric 16 | /// @see ext_quaternion_relational 17 | /// @see ext_quaternion_transform 18 | /// @see ext_quaternion_trigonometric 19 | 20 | #pragma once 21 | 22 | // Dependency: 23 | #include "../detail/type_quat.hpp" 24 | 25 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 26 | # pragma message("GLM: GLM_EXT_quaternion_float extension included") 27 | #endif 28 | 29 | namespace glm 30 | { 31 | /// @addtogroup ext_quaternion_float 32 | /// @{ 33 | 34 | /// Quaternion of single-precision floating-point numbers. 35 | typedef qua quat; 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | -------------------------------------------------------------------------------- /src/libs/glm/ext/quaternion_relational.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) 5 | { 6 | vec<4, bool, Q> Result; 7 | for(length_t i = 0; i < x.length(); ++i) 8 | Result[i] = x[i] == y[i]; 9 | return Result; 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) 14 | { 15 | vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); 16 | return lessThan(abs(v), vec<4, T, Q>(epsilon)); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) 21 | { 22 | vec<4, bool, Q> Result; 23 | for(length_t i = 0; i < x.length(); ++i) 24 | Result[i] = x[i] != y[i]; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) 30 | { 31 | vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); 32 | return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); 33 | } 34 | }//namespace glm 35 | 36 | -------------------------------------------------------------------------------- /src/libs/glm/ext/quaternion_transform.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) 5 | { 6 | vec<3, T, Q> Tmp = v; 7 | 8 | // Axis of rotation must be normalised 9 | T len = glm::length(Tmp); 10 | if(abs(len - static_cast(1)) > static_cast(0.001)) 11 | { 12 | T oneOverLen = static_cast(1) / len; 13 | Tmp.x *= oneOverLen; 14 | Tmp.y *= oneOverLen; 15 | Tmp.z *= oneOverLen; 16 | } 17 | 18 | T const AngleRad(angle); 19 | T const Sin = sin(AngleRad * static_cast(0.5)); 20 | 21 | return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); 22 | } 23 | }//namespace glm 24 | 25 | -------------------------------------------------------------------------------- /src/libs/glm/ext/quaternion_trigonometric.inl: -------------------------------------------------------------------------------- 1 | #include "scalar_constants.hpp" 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T angle(qua const& x) 7 | { 8 | if (abs(x.w) > cos_one_over_two()) 9 | { 10 | return asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); 11 | } 12 | 13 | return acos(x.w) * static_cast(2); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) 18 | { 19 | T const tmp1 = static_cast(1) - x.w * x.w; 20 | if(tmp1 <= static_cast(0)) 21 | return vec<3, T, Q>(0, 0, 1); 22 | T const tmp2 = static_cast(1) / sqrt(tmp1); 23 | return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) 28 | { 29 | T const a(angle); 30 | T const s = glm::sin(a * static_cast(0.5)); 31 | 32 | return qua(glm::cos(a * static_cast(0.5)), v * s); 33 | } 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /src/libs/glm/ext/scalar_constants.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_scalar_constants 2 | /// @file glm/ext/scalar_constants.hpp 3 | /// 4 | /// @defgroup ext_scalar_constants GLM_EXT_scalar_constants 5 | /// @ingroup ext 6 | /// 7 | /// Provides a list of constants and precomputed useful values. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | // Dependencies 14 | #include "../detail/setup.hpp" 15 | 16 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 17 | # pragma message("GLM: GLM_EXT_scalar_constants extension included") 18 | #endif 19 | 20 | namespace glm 21 | { 22 | /// @addtogroup ext_scalar_constants 23 | /// @{ 24 | 25 | /// Return the epsilon constant for floating point types. 26 | template 27 | GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); 28 | 29 | /// Return the pi constant for floating point types. 30 | template 31 | GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); 32 | 33 | /// Return the value of cos(1 / 2) for floating point types. 34 | template 35 | GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | #include "scalar_constants.inl" 41 | -------------------------------------------------------------------------------- /src/libs/glm/ext/scalar_constants.inl: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() 7 | { 8 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'epsilon' only accepts floating-point inputs"); 9 | return std::numeric_limits::epsilon(); 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() 14 | { 15 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'pi' only accepts floating-point inputs"); 16 | return static_cast(3.14159265358979323846264338327950288); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() 21 | { 22 | return genType(0.877582561890372716130286068203503191); 23 | } 24 | } //namespace glm 25 | -------------------------------------------------------------------------------- /src/libs/glm/ext/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | #include "../common.hpp" 2 | #include "../ext/scalar_int_sized.hpp" 3 | #include "../ext/scalar_uint_sized.hpp" 4 | #include "../detail/type_float.hpp" 5 | 6 | namespace glm 7 | { 8 | template 9 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) 10 | { 11 | return abs(x - y) <= epsilon; 12 | } 13 | 14 | template 15 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) 16 | { 17 | return abs(x - y) > epsilon; 18 | } 19 | 20 | template 21 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) 22 | { 23 | detail::float_t const a(x); 24 | detail::float_t const b(y); 25 | 26 | // Different signs means they do not match. 27 | if(a.negative() != b.negative()) 28 | return false; 29 | 30 | // Find the difference in ULPs. 31 | typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); 32 | return DiffULPs <= MaxULPs; 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) 37 | { 38 | return !equal(x, y, ULPs); 39 | } 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_bool1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_bool1 2 | /// @file glm/ext/vector_bool1.hpp 3 | /// 4 | /// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes bvec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_bool1_precision extension. 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_bool1 extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_bool1 24 | /// @{ 25 | 26 | /// 1 components vector of boolean. 27 | typedef vec<1, bool, defaultp> bvec1; 28 | 29 | /// @} 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_bool1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_bool1_precision 2 | /// @file glm/ext/vector_bool1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_bool1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of bool values. 25 | typedef vec<1, bool, highp> highp_bvec1; 26 | 27 | /// 1 component vector of bool values. 28 | typedef vec<1, bool, mediump> mediump_bvec1; 29 | 30 | /// 1 component vector of bool values. 31 | typedef vec<1, bool, lowp> lowp_bvec1; 32 | 33 | /// @} 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_bool2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, bool, defaultp> bvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_bool3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, bool, defaultp> bvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_bool4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, bool, defaultp> bvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_double1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_double1 2 | /// @file glm/ext/vector_double1.hpp 3 | /// 4 | /// @defgroup ext_vector_double1 GLM_EXT_vector_double1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes double-precision floating point vector type with one component. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_double1_precision extension. 12 | /// @see ext_vector_float1 extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_double1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_double1 25 | /// @{ 26 | 27 | /// 1 components vector of double-precision floating-point numbers. 28 | typedef vec<1, double, defaultp> dvec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_double2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, double, defaultp> dvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_double3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, double, defaultp> dvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_double4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, double, defaultp> dvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_float1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_float1 2 | /// @file glm/ext/vector_float1.hpp 3 | /// 4 | /// @defgroup ext_vector_float1 GLM_EXT_vector_float1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes single-precision floating point vector type with one component. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_float1_precision extension. 12 | /// @see ext_vector_double1 extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_float1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_float1 25 | /// @{ 26 | 27 | /// 1 components vector of single-precision floating-point numbers. 28 | typedef vec<1, float, defaultp> vec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_float2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, float, defaultp> vec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_float3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, float, defaultp> vec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_float4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, float, defaultp> vec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_int1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_int1 2 | /// @file glm/ext/vector_int1.hpp 3 | /// 4 | /// @defgroup ext_vector_int1 GLM_EXT_vector_int1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes ivec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_uint1 extension. 12 | /// @see ext_vector_int1_precision extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_int1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_int1 25 | /// @{ 26 | 27 | /// 1 component vector of signed integer numbers. 28 | typedef vec<1, int, defaultp> ivec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | 33 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_int1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_int1_precision 2 | /// @file glm/ext/vector_int1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_int1_precision GLM_EXT_vector_int1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_ivec1, mediump_ivec1 and lowp_ivec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_int1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_int1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of signed integer values. 25 | typedef vec<1, int, highp> highp_ivec1; 26 | 27 | /// 1 component vector of signed integer values. 28 | typedef vec<1, int, mediump> mediump_ivec1; 29 | 30 | /// 1 component vector of signed integer values. 31 | typedef vec<1, int, lowp> lowp_ivec1; 32 | 33 | /// @} 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_int2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, int, defaultp> ivec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_int3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, int, defaultp> ivec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_int4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, int, defaultp> ivec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_uint1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_uint1 2 | /// @file glm/ext/vector_uint1.hpp 3 | /// 4 | /// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes uvec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_int1 extension. 12 | /// @see ext_vector_uint1_precision extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_uint1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_uint1 25 | /// @{ 26 | 27 | /// 1 component vector of unsigned integer numbers. 28 | typedef vec<1, unsigned int, defaultp> uvec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | 33 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_uint1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_uint1_precision 2 | /// @file glm/ext/vector_uint1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_uint1_precision GLM_EXT_vector_uint1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_uvec1, mediump_uvec1 and lowp_uvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_uint1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_uint1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of unsigned integer values. 25 | /// 26 | /// @see ext_vector_uint1_precision 27 | typedef vec<1, unsigned int, highp> highp_uvec1; 28 | 29 | /// 1 component vector of unsigned integer values. 30 | /// 31 | /// @see ext_vector_uint1_precision 32 | typedef vec<1, unsigned int, mediump> mediump_uvec1; 33 | 34 | /// 1 component vector of unsigned integer values. 35 | /// 36 | /// @see ext_vector_uint1_precision 37 | typedef vec<1, unsigned int, lowp> lowp_uvec1; 38 | 39 | /// @} 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_uint2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, unsigned int, defaultp> uvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_uint3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, unsigned int, defaultp> uvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/ext/vector_uint4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, unsigned int, defaultp> uvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /src/libs/glm/gtc/matrix_transform.inl: -------------------------------------------------------------------------------- 1 | #include "../geometric.hpp" 2 | #include "../trigonometric.hpp" 3 | #include "../matrix.hpp" 4 | -------------------------------------------------------------------------------- /src/libs/glm/gtc/quaternion_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/src/libs/glm/gtc/quaternion_simd.inl -------------------------------------------------------------------------------- /src/libs/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_precision 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/libs/glm/gtc/vec1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_vec1 2 | /// @file glm/gtc/vec1.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_vec1 GLM_GTC_vec1 7 | /// @ingroup gtc 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Add vec1, ivec1, uvec1 and bvec1 types. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../ext/vector_bool1.hpp" 17 | #include "../ext/vector_bool1_precision.hpp" 18 | #include "../ext/vector_float1.hpp" 19 | #include "../ext/vector_float1_precision.hpp" 20 | #include "../ext/vector_double1.hpp" 21 | #include "../ext/vector_double1_precision.hpp" 22 | #include "../ext/vector_int1.hpp" 23 | #include "../ext/vector_int1_precision.hpp" 24 | #include "../ext/vector_uint1.hpp" 25 | #include "../ext/vector_uint1_precision.hpp" 26 | 27 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 28 | # pragma message("GLM: GLM_GTC_vec1 extension included") 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/extend.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | /// @file glm/gtx/extend.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_extend GLM_GTX_extend 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Extend a position from a source to a position at a defined length. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_extend extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_extend 29 | /// @{ 30 | 31 | /// Extends of Length the Origin position using the (Source - Origin) direction. 32 | /// @see gtx_extend 33 | template 34 | GLM_FUNC_DECL genType extend( 35 | genType const& Origin, 36 | genType const& Source, 37 | typename genType::value_type const Length); 38 | 39 | /// @} 40 | }//namespace glm 41 | 42 | #include "extend.inl" 43 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType extend 7 | ( 8 | genType const& Origin, 9 | genType const& Source, 10 | genType const& Distance 11 | ) 12 | { 13 | return Origin + (Source - Origin) * Distance; 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER vec<2, T, Q> extend 18 | ( 19 | vec<2, T, Q> const& Origin, 20 | vec<2, T, Q> const& Source, 21 | T const& Distance 22 | ) 23 | { 24 | return Origin + (Source - Origin) * Distance; 25 | } 26 | 27 | template 28 | GLM_FUNC_QUALIFIER vec<3, T, Q> extend 29 | ( 30 | vec<3, T, Q> const& Origin, 31 | vec<3, T, Q> const& Source, 32 | T const& Distance 33 | ) 34 | { 35 | return Origin + (Source - Origin) * Distance; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER vec<4, T, Q> extend 40 | ( 41 | vec<4, T, Q> const& Origin, 42 | vec<4, T, Q> const& Source, 43 | T const& Distance 44 | ) 45 | { 46 | return Origin + (Source - Origin) * Distance; 47 | } 48 | }//namespace glm 49 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/exterior_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_exterior_product 2 | 3 | #include 4 | 5 | namespace glm { 6 | namespace detail 7 | { 8 | template 9 | struct compute_cross_vec2 10 | { 11 | GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) 12 | { 13 | GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); 14 | 15 | return v.x * u.y - u.x * v.y; 16 | } 17 | }; 18 | }//namespace detail 19 | 20 | template 21 | GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) 22 | { 23 | return detail::compute_cross_vec2::value>::call(x, y); 24 | } 25 | }//namespace glm 26 | 27 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/float_notmalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_float_normalize 2 | 3 | #include 4 | 5 | namespace glm 6 | { 7 | template 8 | GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) 9 | { 10 | return vec(v) / static_cast(std::numeric_limits::max()); 11 | } 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/functions.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_functions 2 | 3 | #include "../exponential.hpp" 4 | 5 | namespace glm 6 | { 7 | template 8 | GLM_FUNC_QUALIFIER T gauss 9 | ( 10 | T x, 11 | T ExpectedValue, 12 | T StandardDeviation 13 | ) 14 | { 15 | return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER T gauss 20 | ( 21 | vec<2, T, Q> const& Coord, 22 | vec<2, T, Q> const& ExpectedValue, 23 | vec<2, T, Q> const& StandardDeviation 24 | ) 25 | { 26 | vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); 27 | return exp(-(Squared.x + Squared.y)); 28 | } 29 | }//namespace glm 30 | 31 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T radialGradient 7 | ( 8 | vec<2, T, Q> const& Center, 9 | T const& Radius, 10 | vec<2, T, Q> const& Focal, 11 | vec<2, T, Q> const& Position 12 | ) 13 | { 14 | vec<2, T, Q> F = Focal - Center; 15 | vec<2, T, Q> D = Position - Focal; 16 | T Radius2 = pow2(Radius); 17 | T Fx2 = pow2(F.x); 18 | T Fy2 = pow2(F.y); 19 | 20 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 21 | T Denominator = Radius2 - (Fx2 + Fy2); 22 | return Numerator / Denominator; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER T linearGradient 27 | ( 28 | vec<2, T, Q> const& Point0, 29 | vec<2, T, Q> const& Point1, 30 | vec<2, T, Q> const& Position 31 | ) 32 | { 33 | vec<2, T, Q> Dist = Point1 - Point0; 34 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 35 | } 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER bool rightHanded 7 | ( 8 | vec<3, T, Q> const& tangent, 9 | vec<3, T, Q> const& binormal, 10 | vec<3, T, Q> const& normal 11 | ) 12 | { 13 | return dot(cross(normal, tangent), binormal) > T(0); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER bool leftHanded 18 | ( 19 | vec<3, T, Q> const& tangent, 20 | vec<3, T, Q> const& binormal, 21 | vec<3, T, Q> const& normal 22 | ) 23 | { 24 | return dot(cross(normal, tangent), binormal) < T(0); 25 | } 26 | }//namespace glm 27 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) 7 | { 8 | return glm::log(x) / glm::log(base); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) 13 | { 14 | return glm::log(x) / glm::log(base); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 7 | ( 8 | vec<3, T, Q> const& x 9 | ) 10 | { 11 | mat<3, 3, T, Q> Result(T(0)); 12 | Result[0][1] = x.z; 13 | Result[1][0] = -x.z; 14 | Result[0][2] = -x.y; 15 | Result[2][0] = x.y; 16 | Result[1][2] = x.x; 17 | Result[2][1] = -x.x; 18 | return Result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 23 | ( 24 | vec<3, T, Q> const& x 25 | ) 26 | { 27 | mat<4, 4, T, Q> Result(T(0)); 28 | Result[0][1] = x.z; 29 | Result[1][0] = -x.z; 30 | Result[0][2] = -x.y; 31 | Result[2][0] = x.y; 32 | Result[1][2] = x.x; 33 | Result[2][1] = -x.x; 34 | return Result; 35 | } 36 | 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/matrix_factorisation.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kosua20/Rendu/c8e30b5447bacd09cebc062f861ae342fb9c5fcb/src/libs/glm/gtx/matrix_factorisation.inl -------------------------------------------------------------------------------- /src/libs/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | /// @file glm/gtx/mixed_product.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Mixed product of 3 vectors. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_mixed_product 29 | /// @{ 30 | 31 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 32 | template 33 | GLM_FUNC_DECL T mixedProduct( 34 | vec<3, T, Q> const& v1, 35 | vec<3, T, Q> const& v2, 36 | vec<3, T, Q> const& v3); 37 | 38 | /// @} 39 | }// namespace glm 40 | 41 | #include "mixed_product.inl" 42 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T mixedProduct 7 | ( 8 | vec<3, T, Q> const& v1, 9 | vec<3, T, Q> const& v2, 10 | vec<3, T, Q> const& v3 11 | ) 12 | { 13 | return dot(cross(v1, v2), v3); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | /// @file glm/gtx/normal.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_normal GLM_GTX_normal 8 | /// @ingroup gtx 9 | /// 10 | /// Include to use the features of this extension. 11 | /// 12 | /// Compute the normal of a triangle. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # ifndef GLM_ENABLE_EXPERIMENTAL 21 | # pragma message("GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 22 | # else 23 | # pragma message("GLM: GLM_GTX_normal extension included") 24 | # endif 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_normal 30 | /// @{ 31 | 32 | /// Computes triangle normal from triangle points. 33 | /// 34 | /// @see gtx_normal 35 | template 36 | GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); 37 | 38 | /// @} 39 | }//namespace glm 40 | 41 | #include "normal.inl" 42 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal 7 | ( 8 | vec<3, T, Q> const& p1, 9 | vec<3, T, Q> const& p2, 10 | vec<3, T, Q> const& p3 11 | ) 12 | { 13 | return normalize(cross(p1 - p2, p1 - p3)); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) 7 | { 8 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) 13 | { 14 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType pow2(genType const& x) 7 | { 8 | return x * x; 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER genType pow3(genType const& x) 13 | { 14 | return x * x * x; 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER genType pow4(genType const& x) 19 | { 20 | return (x * x) * (x * x); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) 7 | { 8 | mat<3, 3, T, Q> r = m; 9 | 10 | r[0] = normalize(r[0]); 11 | 12 | T d0 = dot(r[0], r[1]); 13 | r[1] -= r[0] * d0; 14 | r[1] = normalize(r[1]); 15 | 16 | T d1 = dot(r[1], r[2]); 17 | d0 = dot(r[0], r[2]); 18 | r[2] -= r[0] * d0 + r[1] * d1; 19 | r[2] = normalize(r[2]); 20 | 21 | return r; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) 26 | { 27 | return normalize(x - y * dot(y, x)); 28 | } 29 | }//namespace glm 30 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | /// @file glm/gtx/perpendicular.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_projection (dependence) 6 | /// 7 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 8 | /// @ingroup gtx 9 | /// 10 | /// Include to use the features of this extension. 11 | /// 12 | /// Perpendicular of a vector from other one 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | #include "../gtx/projection.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 21 | # ifndef GLM_ENABLE_EXPERIMENTAL 22 | # pragma message("GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 23 | # else 24 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 25 | # endif 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtx_perpendicular 31 | /// @{ 32 | 33 | //! Projects x a perpendicular axis of Normal. 34 | //! From GLM_GTX_perpendicular extension. 35 | template 36 | GLM_FUNC_DECL genType perp(genType const& x, genType const& Normal); 37 | 38 | /// @} 39 | }//namespace glm 40 | 41 | #include "perpendicular.inl" 42 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType perp(genType const& x, genType const& Normal) 7 | { 8 | return x - proj(x, Normal); 9 | } 10 | }//namespace glm 11 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> polar 7 | ( 8 | vec<3, T, Q> const& euclidean 9 | ) 10 | { 11 | T const Length(length(euclidean)); 12 | vec<3, T, Q> const tmp(euclidean / Length); 13 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 14 | 15 | return vec<3, T, Q>( 16 | asin(tmp.y), // latitude 17 | atan(tmp.x, tmp.z), // longitude 18 | xz_dist); // xz distance 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean 23 | ( 24 | vec<2, T, Q> const& polar 25 | ) 26 | { 27 | T const latitude(polar.x); 28 | T const longitude(polar.y); 29 | 30 | return vec<3, T, Q>( 31 | cos(latitude) * sin(longitude), 32 | sin(latitude), 33 | cos(latitude) * cos(longitude)); 34 | } 35 | 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | /// @file glm/gtx/projection.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_projection GLM_GTX_projection 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Projection of a vector to other one 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../geometric.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_projection extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_projection 29 | /// @{ 30 | 31 | /// Projects x on Normal. 32 | /// 33 | /// @param[in] x A vector to project 34 | /// @param[in] Normal A normal that doesn't need to be of unit length. 35 | /// 36 | /// @see gtx_projection 37 | template 38 | GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); 39 | 40 | /// @} 41 | }//namespace glm 42 | 43 | #include "projection.inl" 44 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType proj(genType const& x, genType const& Normal) 7 | { 8 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 9 | } 10 | }//namespace glm 11 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | 3 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | /// @file glm/gtx/scalar_relational.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 7 | /// @ingroup gtx 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Extend a position from a source to a position at a defined length. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_extend extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_scalar_relational 29 | /// @{ 30 | 31 | 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "scalar_relational.inl" 37 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/texture.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_texture 2 | 3 | namespace glm 4 | { 5 | template 6 | inline T levels(vec const& Extent) 7 | { 8 | return glm::log2(compMax(Extent)) + static_cast(1); 9 | } 10 | 11 | template 12 | inline T levels(T Extent) 13 | { 14 | return vec<1, T, defaultp>(Extent).x; 15 | } 16 | }//namespace glm 17 | 18 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/transform.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_transform 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(vec<3, T, Q> const& v) 7 | { 8 | return translate(mat<4, 4, T, Q>(static_cast(1)), v); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(T angle, vec<3, T, Q> const& v) 13 | { 14 | return rotate(mat<4, 4, T, Q>(static_cast(1)), angle, v); 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(vec<3, T, Q> const& v) 19 | { 20 | return scale(mat<4, 4, T, Q>(static_cast(1)), v); 21 | } 22 | 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /src/libs/glm/gtx/type_aligned.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_type_aligned 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/libs/glm/mat2x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat2x2.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double2x2.hpp" 6 | #include "./ext/matrix_double2x2_precision.hpp" 7 | #include "./ext/matrix_float2x2.hpp" 8 | #include "./ext/matrix_float2x2_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/mat2x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat2x3.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double2x3.hpp" 6 | #include "./ext/matrix_double2x3_precision.hpp" 7 | #include "./ext/matrix_float2x3.hpp" 8 | #include "./ext/matrix_float2x3_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/mat2x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat2x4.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double2x4.hpp" 6 | #include "./ext/matrix_double2x4_precision.hpp" 7 | #include "./ext/matrix_float2x4.hpp" 8 | #include "./ext/matrix_float2x4_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/mat3x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat3x2.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double3x2.hpp" 6 | #include "./ext/matrix_double3x2_precision.hpp" 7 | #include "./ext/matrix_float3x2.hpp" 8 | #include "./ext/matrix_float3x2_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/mat3x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat3x3.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double3x3.hpp" 6 | #include "./ext/matrix_double3x3_precision.hpp" 7 | #include "./ext/matrix_float3x3.hpp" 8 | #include "./ext/matrix_float3x3_precision.hpp" 9 | -------------------------------------------------------------------------------- /src/libs/glm/mat3x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat3x4.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double3x4.hpp" 6 | #include "./ext/matrix_double3x4_precision.hpp" 7 | #include "./ext/matrix_float3x4.hpp" 8 | #include "./ext/matrix_float3x4_precision.hpp" 9 | -------------------------------------------------------------------------------- /src/libs/glm/mat4x2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat4x2.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double4x2.hpp" 6 | #include "./ext/matrix_double4x2_precision.hpp" 7 | #include "./ext/matrix_float4x2.hpp" 8 | #include "./ext/matrix_float4x2_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/mat4x3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat4x3.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double4x3.hpp" 6 | #include "./ext/matrix_double4x3_precision.hpp" 7 | #include "./ext/matrix_float4x3.hpp" 8 | #include "./ext/matrix_float4x3_precision.hpp" 9 | -------------------------------------------------------------------------------- /src/libs/glm/mat4x4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/mat4x4.hpp 3 | 4 | #pragma once 5 | #include "./ext/matrix_double4x4.hpp" 6 | #include "./ext/matrix_double4x4_precision.hpp" 7 | #include "./ext/matrix_float4x4.hpp" 8 | #include "./ext/matrix_float4x4_precision.hpp" 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/simd/exponential.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/experimental.h 3 | 4 | #pragma once 5 | 6 | #include "platform.h" 7 | 8 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | 10 | GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) 11 | { 12 | return _mm_mul_ss(_mm_rsqrt_ss(x), x); 13 | } 14 | 15 | GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) 16 | { 17 | return _mm_mul_ps(_mm_rsqrt_ps(x), x); 18 | } 19 | 20 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 21 | -------------------------------------------------------------------------------- /src/libs/glm/simd/packing.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/packing.h 3 | 4 | #pragma once 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | -------------------------------------------------------------------------------- /src/libs/glm/simd/trigonometric.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/trigonometric.h 3 | 4 | #pragma once 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | 10 | -------------------------------------------------------------------------------- /src/libs/glm/simd/vector_relational.h: -------------------------------------------------------------------------------- 1 | /// @ref simd 2 | /// @file glm/simd/vector_relational.h 3 | 4 | #pragma once 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 9 | -------------------------------------------------------------------------------- /src/libs/glm/vec2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/vec2.hpp 3 | 4 | #pragma once 5 | #include "./ext/vector_bool2.hpp" 6 | #include "./ext/vector_bool2_precision.hpp" 7 | #include "./ext/vector_float2.hpp" 8 | #include "./ext/vector_float2_precision.hpp" 9 | #include "./ext/vector_double2.hpp" 10 | #include "./ext/vector_double2_precision.hpp" 11 | #include "./ext/vector_int2.hpp" 12 | #include "./ext/vector_int2_precision.hpp" 13 | #include "./ext/vector_uint2.hpp" 14 | #include "./ext/vector_uint2_precision.hpp" 15 | -------------------------------------------------------------------------------- /src/libs/glm/vec3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/vec3.hpp 3 | 4 | #pragma once 5 | #include "./ext/vector_bool3.hpp" 6 | #include "./ext/vector_bool3_precision.hpp" 7 | #include "./ext/vector_float3.hpp" 8 | #include "./ext/vector_float3_precision.hpp" 9 | #include "./ext/vector_double3.hpp" 10 | #include "./ext/vector_double3_precision.hpp" 11 | #include "./ext/vector_int3.hpp" 12 | #include "./ext/vector_int3_precision.hpp" 13 | #include "./ext/vector_uint3.hpp" 14 | #include "./ext/vector_uint3_precision.hpp" 15 | -------------------------------------------------------------------------------- /src/libs/glm/vec4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/vec4.hpp 3 | 4 | #pragma once 5 | #include "./ext/vector_bool4.hpp" 6 | #include "./ext/vector_bool4_precision.hpp" 7 | #include "./ext/vector_float4.hpp" 8 | #include "./ext/vector_float4_precision.hpp" 9 | #include "./ext/vector_double4.hpp" 10 | #include "./ext/vector_double4_precision.hpp" 11 | #include "./ext/vector_int4.hpp" 12 | #include "./ext/vector_int4_precision.hpp" 13 | #include "./ext/vector_uint4.hpp" 14 | #include "./ext/vector_uint4_precision.hpp" 15 | 16 | -------------------------------------------------------------------------------- /src/libs/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2023 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/libs/miniz/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013-2014 RAD Game Tools and Valve Software 2 | Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC 3 | 4 | All Rights Reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/libs/nfd/LICENSE: -------------------------------------------------------------------------------- 1 | This software is provided 'as-is', without any express or implied 2 | warranty. In no event will the authors be held liable for any damages 3 | arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any purpose, 6 | including commercial applications, and to alter it and redistribute it 7 | freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not 10 | claim that you wrote the original software. If you use this software 11 | in a product, an acknowledgment in the product documentation would be 12 | appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be 14 | misrepresented as being the original software. 15 | 3. This notice may not be removed or altered from any source distribution. 16 | 17 | -------------------------------------------------------------------------------- /src/libs/nfd/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | Internal, common across platforms 5 | 6 | http://www.frogtoss.com/labs 7 | */ 8 | 9 | 10 | #ifndef _NFD_COMMON_H 11 | #define _NFD_COMMON_H 12 | 13 | #define NFD_MAX_STRLEN 256 14 | #define _NFD_UNUSED(x) ((void)x) 15 | 16 | void *NFDi_Malloc( size_t bytes ); 17 | void NFDi_Free( void *ptr ); 18 | void NFDi_SetError( const char *msg ); 19 | void NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy ); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/libs/nfd/nfd_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | Internal, common across platforms 5 | 6 | http://www.frogtoss.com/labs 7 | */ 8 | 9 | 10 | #ifndef _NFD_COMMON_H 11 | #define _NFD_COMMON_H 12 | 13 | #include "nfd.h" 14 | 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define NFD_MAX_STRLEN 256 22 | #define _NFD_UNUSED(x) ((void)x) 23 | 24 | #define NFD_UTF8_BOM "\xEF\xBB\xBF" 25 | 26 | 27 | void *NFDi_Malloc( size_t bytes ); 28 | void NFDi_Free( void *ptr ); 29 | void NFDi_SetError( const char *msg ); 30 | int NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy ); 31 | int32_t NFDi_UTF8_Strlen( const nfdchar_t *str ); 32 | int NFDi_IsFilterSegmentChar( char ch ); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/libs/vma/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/libs/volk/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018-2023 Arseny Kapoulkine 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/tools/ALL.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /** 4 | Do nothing. This is useful for 'meta' compilation targets (such as ALL). 5 | In the future, this could become a CPU-only test suite. 6 | \return an error/success code 7 | \ingroup Tools 8 | */ 9 | int main(int, char **) { 10 | std::cout << "Successful execution." << std::endl; 11 | return 0; 12 | } 13 | --------------------------------------------------------------------------------