├── .gitignore ├── LICENSE.md ├── README.md ├── SIBR_viewers ├── CMakeLists.txt ├── LICENSE.md ├── README.md ├── assets │ └── images │ │ ├── cmake.png │ │ ├── select.png │ │ ├── step1.png │ │ ├── step2.png │ │ ├── step3.png │ │ ├── step4.png │ │ ├── step5.png │ │ └── step6.png ├── cmake │ ├── linux │ │ ├── MSVCsetUserCommand.cmake │ │ ├── Modules │ │ │ ├── FindASSIMP.cmake │ │ │ ├── FindEGL.cmake │ │ │ ├── FindEmbree.cmake │ │ │ ├── FindFFMPEG.cmake │ │ │ └── FindGLFW.cmake │ │ ├── Win3rdParty.cmake │ │ ├── cmake_policies.cmake │ │ ├── dependencies.cmake │ │ ├── downloadAndExtractZipFile.cmake │ │ ├── git_describe.cmake │ │ ├── include_once.cmake │ │ ├── install_runtime.cmake │ │ ├── parse_arguments_multi.cmake │ │ └── sibr_library.cmake │ └── windows │ │ ├── MSVCsetUserCommand.cmake │ │ ├── Modules │ │ ├── FindASSIMP.cmake │ │ ├── FindEmbree.cmake │ │ └── FindFFmpeg.cmake │ │ ├── Win3rdParty.cmake │ │ ├── cmake_policies.cmake │ │ ├── dependencies.cmake │ │ ├── downloadAndExtractZipFile.cmake │ │ ├── git_describe.cmake │ │ ├── include_once.cmake │ │ ├── install_runtime.cmake │ │ ├── parse_arguments_multi.cmake │ │ └── sibr_library.cmake ├── docs │ ├── CMakeLists.txt │ ├── doxyfile.in │ ├── doxygen_prebuild.cmake.in │ ├── img │ │ ├── capreal │ │ │ ├── caprealaddinputs.png │ │ │ ├── caprealalignimages.png │ │ │ ├── caprealcolorizesimplify.png │ │ │ ├── caprealexportmodel.png │ │ │ ├── caprealinputsonly.png │ │ │ ├── caprealmesh.png │ │ │ ├── caprealmeshreconstruction.png │ │ │ ├── caprealnew.png │ │ │ ├── caprealpointcloud.png │ │ │ └── meshlab.png │ │ ├── cmake.gif │ │ ├── diagramas │ │ │ ├── class │ │ │ │ ├── sibr_classes_v2.png │ │ │ │ └── unity_ulr.png │ │ │ └── sequence │ │ │ │ ├── AssetStreamer │ │ │ │ └── seq_assetStreamer.pdf │ │ │ │ ├── Renderers │ │ │ │ ├── seq_insideOut.pdf │ │ │ │ ├── seq_ulr_stream.pdf │ │ │ │ └── seq_ulr_v3_landscape.pdf │ │ │ │ └── Unity │ │ │ │ ├── seq_unity_ulr_rendering.pdf │ │ │ │ └── seq_unity_ulr_texture_upload.pdf │ │ ├── ibr_common_cmake.png │ │ ├── ibr_common_globale.png │ │ ├── ibr_common_principle.png │ │ ├── jesnault_git_cheat_sheet.png │ │ ├── multimeshmanager.png │ │ ├── multiviewmanager.png │ │ ├── sibr_dataset.png │ │ ├── sibr_diagram_lvl2.svg │ │ ├── sibr_new_architecture.png │ │ └── ulr_screenshot.png │ ├── layout.xml.in │ └── pages │ │ ├── 1_Getting_Started.dox │ │ ├── 2_Projects.dox │ │ ├── 2_Projects.dox.in │ │ ├── 3_Tutorials.dox │ │ ├── 4_Architecture.dox │ │ └── Tutorials │ │ ├── How to generate your dataset │ │ ├── How_to_create_dataset_from_colmap.dox │ │ └── How_to_create_dataset_from_realitycapture.dox │ │ ├── How to setup your own project │ │ ├── Configuring_your_project.dox │ │ ├── Creating_your_library.dox │ │ ├── Documenting_a_project.dox │ │ └── Project_structure.dox │ │ ├── How_to_generate_your_dataset.dox │ │ ├── How_to_setup_your_own_project.dox │ │ ├── Paths_and_cameras.dox │ │ └── Useful_sibr_elements.dox └── src │ ├── CMakeLists.txt │ ├── core │ ├── assets │ │ ├── ActiveImageFile.cpp │ │ ├── ActiveImageFile.hpp │ │ ├── CMakeLists.txt │ │ ├── CameraRecorder.cpp │ │ ├── CameraRecorder.hpp │ │ ├── Config.hpp │ │ ├── IFileLoader.hpp │ │ ├── ImageListFile.cpp │ │ ├── ImageListFile.hpp │ │ ├── InputCamera.cpp │ │ ├── InputCamera.hpp │ │ ├── Resources.cpp │ │ ├── Resources.hpp │ │ ├── UVUnwrapper.cpp │ │ ├── UVUnwrapper.hpp │ │ ├── colmapheader.h │ │ └── sibr_assets.dox │ ├── graphics │ │ ├── CMakeLists.txt │ │ ├── Camera.cpp │ │ ├── Camera.hpp │ │ ├── Config.hpp │ │ ├── Frustum.cpp │ │ ├── Frustum.hpp │ │ ├── GPUQuery.cpp │ │ ├── GPUQuery.hpp │ │ ├── GUI.cpp │ │ ├── GUI.hpp │ │ ├── Image.cpp │ │ ├── Image.hpp │ │ ├── Input.cpp │ │ ├── Input.hpp │ │ ├── MaterialMesh.cpp │ │ ├── MaterialMesh.hpp │ │ ├── Mesh.cpp │ │ ├── Mesh.hpp │ │ ├── MeshBufferGL.cpp │ │ ├── MeshBufferGL.hpp │ │ ├── RenderTarget.cpp │ │ ├── RenderTarget.hpp │ │ ├── RenderUtility.cpp │ │ ├── RenderUtility.hpp │ │ ├── Shader.cpp │ │ ├── Shader.hpp │ │ ├── Shader.inl │ │ ├── Texture.cpp │ │ ├── Texture.hpp │ │ ├── Types.hpp │ │ ├── Utils.cpp │ │ ├── Utils.hpp │ │ ├── Viewport.cpp │ │ ├── Viewport.hpp │ │ ├── Window.cpp │ │ ├── Window.hpp │ │ ├── resources │ │ │ └── imgui_default.ini │ │ └── sibr_graphics.dox │ ├── imgproc │ │ ├── CMakeLists.txt │ │ ├── Config.hpp │ │ ├── CropScaleImageUtility.cpp │ │ ├── CropScaleImageUtility.hpp │ │ ├── DistordCropUtility.cpp │ │ ├── DistordCropUtility.hpp │ │ ├── MRFSolver.cpp │ │ ├── MRFSolver.h │ │ ├── MeshTexturing.cpp │ │ ├── MeshTexturing.hpp │ │ ├── PoissonReconstruction.cpp │ │ ├── PoissonReconstruction.hpp │ │ └── sibr_imgproc.dox │ ├── raycaster │ │ ├── CMakeLists.txt │ │ ├── CameraRaycaster.cpp │ │ ├── CameraRaycaster.hpp │ │ ├── Config.hpp │ │ ├── Intersector2D.cpp │ │ ├── Intersector2D.h │ │ ├── KdTree.hpp │ │ ├── PlaneEstimator.cpp │ │ ├── PlaneEstimator.hpp │ │ ├── Ray.cpp │ │ ├── Ray.hpp │ │ ├── Raycaster.cpp │ │ ├── Raycaster.hpp │ │ ├── VoxelGrid.cpp │ │ ├── VoxelGrid.hpp │ │ └── sibr_raycaster.dox │ ├── renderer │ │ ├── AddShadowRenderer.cpp │ │ ├── AddShadowRenderer.hpp │ │ ├── BinaryMeshRenderer.cpp │ │ ├── BinaryMeshRenderer.hpp │ │ ├── BlurRenderer.cpp │ │ ├── BlurRenderer.hpp │ │ ├── CMakeLists.txt │ │ ├── ColoredMeshRenderer.cpp │ │ ├── ColoredMeshRenderer.hpp │ │ ├── Config.hpp │ │ ├── CopyRenderer.cpp │ │ ├── CopyRenderer.hpp │ │ ├── DepthRenderer.cpp │ │ ├── DepthRenderer.hpp │ │ ├── NormalRenderer.cpp │ │ ├── NormalRenderer.hpp │ │ ├── PointBasedRenderer.cpp │ │ ├── PointBasedRenderer.hpp │ │ ├── PoissonRenderer.cpp │ │ ├── PoissonRenderer.hpp │ │ ├── PositionRender.cpp │ │ ├── PositionRender.hpp │ │ ├── RenderMaskHolder.cpp │ │ ├── RenderMaskHolder.hpp │ │ ├── ShadowMapRenderer.cpp │ │ ├── ShadowMapRenderer.hpp │ │ ├── TexturedMeshRenderer.cpp │ │ ├── TexturedMeshRenderer.hpp │ │ ├── shaders │ │ │ ├── addshadow.frag │ │ │ ├── blur.frag │ │ │ ├── colored_mesh.frag │ │ │ ├── colored_mesh.vert │ │ │ ├── copy.frag │ │ │ ├── copy_depth.frag │ │ │ ├── depthRenderer.fp │ │ │ ├── depthRenderer.vp │ │ │ ├── emotive_relight.frag │ │ │ ├── emotive_relight.vert │ │ │ ├── hdrEnvMap.frag │ │ │ ├── hdrEnvMap.vert │ │ │ ├── longlat.gp │ │ │ ├── longlat.tcs │ │ │ ├── longlat.tes │ │ │ ├── longlat.vp │ │ │ ├── longlatColor.fp │ │ │ ├── longlatDepth.fp │ │ │ ├── noproj.vert │ │ │ ├── normalRenderer.fp │ │ │ ├── normalRenderer.vp │ │ │ ├── normalRendererGen.gp │ │ │ ├── normalRendererGen.vp │ │ │ ├── poisson_diverg.frag │ │ │ ├── poisson_interp.frag │ │ │ ├── poisson_jacobi.frag │ │ │ ├── poisson_restrict.frag │ │ │ ├── positionReflectedDirRenderer.frag │ │ │ ├── positionReflectedDirRenderer.vert │ │ │ ├── positionRenderer.frag │ │ │ ├── positionRenderer.vert │ │ │ ├── shadowMapRenderer.fp │ │ │ ├── shadowMapRenderer.vp │ │ │ ├── texture-invert.frag │ │ │ ├── texture.frag │ │ │ ├── texture.vert │ │ │ ├── textured_mesh.frag │ │ │ ├── textured_mesh.vert │ │ │ └── textured_mesh_flipY.vert │ │ └── sibr_renderer.dox │ ├── scene │ │ ├── BasicIBRScene.cpp │ │ ├── BasicIBRScene.hpp │ │ ├── CMakeLists.txt │ │ ├── CalibratedCameras.cpp │ │ ├── CalibratedCameras.hpp │ │ ├── Config.hpp │ │ ├── ICalibratedCameras.hpp │ │ ├── IIBRScene.hpp │ │ ├── IInputImages.hpp │ │ ├── IParseData.hpp │ │ ├── IProxyMesh.hpp │ │ ├── InputImages.cpp │ │ ├── InputImages.hpp │ │ ├── ParseData.cpp │ │ ├── ParseData.hpp │ │ ├── ProxyMesh.cpp │ │ ├── ProxyMesh.hpp │ │ ├── RenderTargetTextures.cpp │ │ ├── RenderTargetTextures.hpp │ │ └── sibr_scene.dox │ ├── system │ │ ├── Array2d.hpp │ │ ├── ByteStream.cpp │ │ ├── ByteStream.hpp │ │ ├── CMakeLists.txt │ │ ├── CommandLineArgs.cpp │ │ ├── CommandLineArgs.hpp │ │ ├── Config.cpp │ │ ├── Config.hpp │ │ ├── LoadingProgress.cpp │ │ ├── LoadingProgress.hpp │ │ ├── MD5.h │ │ ├── Matrix.cpp │ │ ├── Matrix.hpp │ │ ├── MatrixBasePlugin.hpp │ │ ├── MatrixPlugin.hpp │ │ ├── Quaternion.cpp │ │ ├── Quaternion.hpp │ │ ├── Rect.hpp │ │ ├── SimpleTimer.hpp │ │ ├── String.cpp │ │ ├── String.hpp │ │ ├── ThreadIdWorker.cpp │ │ ├── ThreadIdWorker.hpp │ │ ├── Transform3.hpp │ │ ├── Utils.cpp │ │ ├── Utils.hpp │ │ ├── Vector.cpp │ │ ├── Vector.hpp │ │ ├── VectorUtils.cpp │ │ ├── VectorUtils.hpp │ │ ├── XMLTree.cpp │ │ ├── XMLTree.h │ │ └── sibr_system.dox │ ├── video │ │ ├── CMakeLists.txt │ │ ├── Config.hpp │ │ ├── FFmpegVideoEncoder.cpp │ │ ├── FFmpegVideoEncoder.hpp │ │ ├── MultipleVideoDecoder.hpp │ │ ├── Video.cpp │ │ ├── Video.hpp │ │ ├── VideoUtils.cpp │ │ ├── VideoUtils.hpp │ │ └── sibr_video.dox │ └── view │ │ ├── CMakeLists.txt │ │ ├── Config.hpp │ │ ├── DatasetView.cpp │ │ ├── DatasetView.hpp │ │ ├── FPSCamera.cpp │ │ ├── FPSCamera.hpp │ │ ├── FPSCounter.cpp │ │ ├── FPSCounter.hpp │ │ ├── IBRBasicUtils.cpp │ │ ├── IBRBasicUtils.hpp │ │ ├── ICameraHandler.cpp │ │ ├── ICameraHandler.hpp │ │ ├── ImageView.cpp │ │ ├── ImageView.hpp │ │ ├── ImagesGrid.cpp │ │ ├── ImagesGrid.hpp │ │ ├── InteractiveCameraHandler.cpp │ │ ├── InteractiveCameraHandler.hpp │ │ ├── MultiMeshManager.cpp │ │ ├── MultiMeshManager.hpp │ │ ├── MultiViewManager.cpp │ │ ├── MultiViewManager.hpp │ │ ├── Orbit.cpp │ │ ├── Orbit.hpp │ │ ├── RenderingMode.cpp │ │ ├── RenderingMode.hpp │ │ ├── SceneDebugView.cpp │ │ ├── SceneDebugView.hpp │ │ ├── Skybox.cpp │ │ ├── Skybox.hpp │ │ ├── TrackBall.cpp │ │ ├── TrackBall.h │ │ ├── UIShortcuts.cpp │ │ ├── UIShortcuts.hpp │ │ ├── ViewBase.cpp │ │ ├── ViewBase.hpp │ │ ├── interface │ │ ├── Interface.cpp │ │ ├── Interface.h │ │ ├── InterfaceUtils.cpp │ │ ├── InterfaceUtils.h │ │ ├── MeshViewer.cpp │ │ └── MeshViewer.h │ │ ├── shaders │ │ ├── alpha_colored_mesh.frag │ │ ├── alpha_colored_mesh.vert │ │ ├── alpha_colored_per_triangle_normals.geom │ │ ├── alpha_colored_per_triangle_normals.vert │ │ ├── alpha_colored_per_vertex_normals.geom │ │ ├── alpha_colored_per_vertex_normals.vert │ │ ├── alpha_points.frag │ │ ├── alpha_points.vert │ │ ├── alpha_uv_tex.frag │ │ ├── alpha_uv_tex_array.frag │ │ ├── alphaimgview.fp │ │ ├── alphaimgview.vp │ │ ├── anaglyph.fp │ │ ├── anaglyph.vp │ │ ├── axisgizmo.fp │ │ ├── axisgizmo.vp │ │ ├── camstub.fp │ │ ├── camstub.vp │ │ ├── depth.fp │ │ ├── depth.vp │ │ ├── depthonly.fp │ │ ├── depthonly.vp │ │ ├── image_viewer.frag │ │ ├── image_viewer.vert │ │ ├── mesh_color.fp │ │ ├── mesh_color.vp │ │ ├── mesh_debugview.fp │ │ ├── mesh_debugview.vp │ │ ├── mesh_normal.fp │ │ ├── mesh_normal.vp │ │ ├── number.fp │ │ ├── number.vp │ │ ├── skybox.fp │ │ ├── skybox.vp │ │ ├── text-imgui.fp │ │ ├── text-imgui.vp │ │ ├── texture.fp │ │ ├── texture.vp │ │ ├── topview.fp │ │ ├── topview.vp │ │ └── uv_mesh.vert │ │ └── sibr_view.dox │ └── projects │ ├── basic │ ├── CMakeLists.txt │ ├── apps │ │ ├── CMakeLists.txt │ │ ├── pointBased │ │ │ ├── .CMakeLists.txt.un~ │ │ │ ├── .main.cpp.un~ │ │ │ ├── CMakeLists.txt │ │ │ ├── CMakeLists.txt~ │ │ │ ├── main.cpp │ │ │ └── main.cpp~ │ │ └── texturedMesh │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── resources │ │ │ └── sibr_texturedMesh_app.ini │ └── renderer │ │ ├── CMakeLists.txt │ │ ├── Config.hpp │ │ ├── PointBasedView.cpp │ │ ├── PointBasedView.hpp │ │ ├── TexturedMeshView.cpp │ │ └── TexturedMeshView.hpp │ ├── dataset_tools │ ├── CMakeLists.txt │ ├── documentation │ │ ├── dataset_tools.dox │ │ ├── dataset_tools_doc.cmake │ │ ├── fullColmapProcess.dox │ │ └── img │ │ │ └── colmapfullpipeline.png │ ├── preprocess │ │ ├── CMakeLists.txt │ │ ├── alignMeshes │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── cameraConverter │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── clippingPlanes │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── converters │ │ │ ├── CMakeLists.txt │ │ │ ├── bundle.py │ │ │ ├── colmap2sibr.py │ │ │ ├── generate_list_images.py │ │ │ ├── get_image_size.py │ │ │ ├── ibr_convert_old_to_new.py │ │ │ ├── ibr_preprocess_rc_to_sibr.py │ │ │ ├── meshlab │ │ │ │ ├── simplify.mlx │ │ │ │ ├── simplify200.mlx │ │ │ │ ├── simplify250.mlx │ │ │ │ ├── simplify300.mlx │ │ │ │ ├── simplify350.mlx │ │ │ │ └── wedge_to_vertex_uvs.mlx │ │ │ ├── simplify_mesh.py │ │ │ └── wedge_to_vertex_uvs.py │ │ ├── cropFromCenter │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── distordCrop │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── fullColmapProcess │ │ │ ├── CMakeLists.txt │ │ │ ├── ColmapProcessSteps.json │ │ │ ├── ColmapQualityParameters.json │ │ │ ├── SelectiveColmapProcessSteps.json │ │ │ ├── colmap2nerf.py │ │ │ ├── fullColmapProcess.py │ │ │ ├── read_write_model.py │ │ │ ├── selectiveColmapProcess.py │ │ │ ├── selective_colmap_process.py │ │ │ └── textureOnly.py │ │ ├── meshroomPythonScripts │ │ │ ├── CMakeLists.txt │ │ │ └── ULR.py │ │ ├── nvmToSIBR │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── prepareColmap4Sibr │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── realityCaptureTools │ │ │ ├── CMakeLists.txt │ │ │ ├── SetVariables.bat │ │ │ ├── exportModel.xml │ │ │ ├── fixup.bat │ │ │ ├── processRCSteps.json │ │ │ ├── rc_tools.py │ │ │ ├── registrationConfig.xml │ │ │ └── runRC.bat │ │ ├── textureMesh │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── tonemapper │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── unwrapMesh │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ └── utils │ │ │ ├── CMakeLists.txt │ │ │ ├── TaskPipeline.py │ │ │ ├── color.py │ │ │ ├── commands.py │ │ │ ├── convert.py │ │ │ ├── datasets.py │ │ │ └── paths.py │ └── scripts │ │ └── processRC.py │ ├── gaussianviewer │ ├── CMakeLists.txt │ ├── apps │ │ ├── CMakeLists.txt │ │ └── gaussianViewer │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ └── renderer │ │ ├── CMakeLists.txt │ │ ├── Config.hpp │ │ ├── GaussianSurfaceRenderer.cpp │ │ ├── GaussianSurfaceRenderer.hpp │ │ ├── GaussianView.cpp │ │ ├── GaussianView.hpp │ │ └── shaders │ │ ├── copy.frag │ │ ├── copy.vert │ │ ├── gaussian_surface.frag │ │ └── gaussian_surface.vert │ ├── remote │ ├── CMakeLists.txt │ ├── apps │ │ ├── CMakeLists.txt │ │ └── remoteGaussianUI │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ ├── json.hpp │ └── renderer │ │ ├── CMakeLists.txt │ │ ├── Config.hpp │ │ ├── RemotePointView.cpp │ │ └── RemotePointView.hpp │ ├── trackChanges.sh │ └── ulr │ ├── CMakeLists.txt │ ├── apps │ ├── CMakeLists.txt │ ├── ulr │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ └── resources │ │ │ └── sibr_ulr_app.ini │ └── ulrv2 │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ └── resources │ │ └── sibr_ulrv2_app.ini │ ├── documentation │ ├── IBR_ULR.dox │ └── ulr_doc.cmake │ └── renderer │ ├── CMakeLists.txt │ ├── Config.hpp │ ├── ULRRenderer.cpp │ ├── ULRRenderer.hpp │ ├── ULRV2Renderer.cpp │ ├── ULRV2Renderer.hpp │ ├── ULRV2View.cpp │ ├── ULRV2View.hpp │ ├── ULRV3Renderer.cpp │ ├── ULRV3Renderer.hpp │ ├── ULRV3View.cpp │ ├── ULRV3View.hpp │ ├── ULRView.cpp │ ├── ULRView.hpp │ └── shaders │ ├── ulr.vert │ ├── ulr1.frag │ ├── ulr2.frag │ ├── ulr_intersect.frag │ ├── ulr_intersect.vert │ ├── ulr_v2.frag │ ├── ulr_v2.vert │ ├── ulr_v2_alt.frag │ ├── ulr_v3.frag │ ├── ulr_v3.vert │ ├── ulr_v3_alt.frag │ └── ulr_v3_fast.frag ├── assets ├── pipeline.png └── teaser.png ├── config ├── base │ ├── large_scene │ │ ├── coarse.yaml │ │ ├── fine.yaml │ │ └── global.yaml │ └── small_scene │ │ ├── coarse.yaml │ │ └── fine.yaml ├── our_2d │ ├── large_scene │ │ ├── .DS_Store │ │ └── block_A │ │ │ ├── chunk_coarse │ │ │ ├── 0_0.yaml │ │ │ ├── 0_1.yaml │ │ │ ├── 1_0.yaml │ │ │ ├── 1_1.yaml │ │ │ ├── 2_0.yaml │ │ │ ├── 2_1.yaml │ │ │ ├── 3_0.yaml │ │ │ └── 3_1.yaml │ │ │ ├── chunk_fine │ │ │ ├── 0_0.yaml │ │ │ ├── 0_1.yaml │ │ │ ├── 1_0.yaml │ │ │ ├── 1_1.yaml │ │ │ ├── 2_0.yaml │ │ │ ├── 2_1.yaml │ │ │ ├── 3_0.yaml │ │ │ └── 3_1.yaml │ │ │ └── config.yaml │ ├── matrix_city │ │ ├── block_A │ │ │ ├── coarse.yaml │ │ │ ├── config.yaml │ │ │ └── fine.yaml │ │ └── block_small │ │ │ ├── coarse.yaml │ │ │ ├── config.yaml │ │ │ └── fine.yaml │ ├── ucgs │ │ ├── nyc │ │ │ ├── coarse.yaml │ │ │ ├── config.yaml │ │ │ └── fine.yaml │ │ └── sf │ │ │ ├── coarse.yaml │ │ │ ├── config.yaml │ │ │ └── fine.yaml │ └── urbangs │ │ ├── real │ │ ├── park │ │ │ ├── coarse.yaml │ │ │ ├── config.yaml │ │ │ └── fine.yaml │ │ └── road │ │ │ ├── coarse.yaml │ │ │ ├── config.yaml │ │ │ └── fine.yaml │ │ └── synthetic │ │ ├── citysample │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ │ ├── colosseum │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ │ ├── elvenruin │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ │ ├── hillside_morning │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ │ └── hillside_summer │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml └── ours │ ├── large_scene │ └── block_A │ │ ├── chunk_coarse │ │ ├── 0_0.yaml │ │ ├── 0_1.yaml │ │ ├── 1_0.yaml │ │ ├── 1_1.yaml │ │ ├── 2_0.yaml │ │ ├── 2_1.yaml │ │ ├── 3_0.yaml │ │ └── 3_1.yaml │ │ ├── chunk_fine │ │ ├── 0_0.yaml │ │ ├── 0_1.yaml │ │ ├── 1_0.yaml │ │ ├── 1_1.yaml │ │ ├── 2_0.yaml │ │ ├── 2_1.yaml │ │ ├── 3_0.yaml │ │ └── 3_1.yaml │ │ └── config.yaml │ ├── matrix_city │ ├── block_A │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ └── block_small │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ ├── ucgs │ ├── nyc │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ └── sf │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ └── urbangs │ ├── real │ ├── park │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ └── road │ │ ├── coarse.yaml │ │ ├── config.yaml │ │ └── fine.yaml │ └── synthetic │ ├── citysample │ ├── coarse.yaml │ ├── config.yaml │ └── fine.yaml │ ├── colosseum │ ├── coarse.yaml │ ├── config.yaml │ └── fine.yaml │ ├── elvenruin │ ├── coarse.yaml │ ├── config.yaml │ └── fine.yaml │ ├── hillside_morning │ ├── coarse.yaml │ ├── config.yaml │ └── fine.yaml │ └── hillside_summer │ ├── coarse.yaml │ ├── config.yaml │ └── fine.yaml ├── environment.yml ├── export_mesh.py ├── gaussian_renderer ├── __init__.py ├── network_gui.py └── render.py ├── lpipsPyTorch ├── __init__.py └── modules │ ├── lpips.py │ ├── networks.py │ └── utils.py ├── merge.py ├── metrics.py ├── preprocess ├── convert.py ├── data_preprocess.py ├── depth2pc.py ├── generate_chunks_config.py ├── generate_config.py ├── generate_depth.py ├── make_depth_scale.py └── read_write_model.py ├── render.py ├── scene ├── __init__.py ├── base_model.py ├── basic_model.py ├── cameras.py ├── colmap_loader.py ├── dataset_readers.py ├── embedding.py └── lod_model.py ├── train.py └── utils ├── camera_utils.py ├── general_utils.py ├── graphics_utils.py ├── image_utils.py ├── loss_utils.py ├── mesh_utils.py ├── partition_utils.py ├── render_utils.py ├── sh_utils.py ├── system_utils.py └── visualize_utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .vscode 3 | temp* 4 | outputs* 5 | debug* 6 | log* 7 | wandb* 8 | *.bak 9 | data 10 | *build/* 11 | *__pycache__* 12 | tensorboard_3d 13 | screenshots 14 | *.so 15 | 16 | submodules/Depth-Anything-V2/* 17 | -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/cmake.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/select.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/step1.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/step2.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/step3.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/step4.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/step5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/step5.png -------------------------------------------------------------------------------- /SIBR_viewers/assets/images/step6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/assets/images/step6.png -------------------------------------------------------------------------------- /SIBR_viewers/cmake/linux/cmake_policies.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | if(__set_policies_INCLUDED__) 12 | return() 13 | else() 14 | set(__set_policies_INCLUDED__ ON) 15 | endif() 16 | 17 | macro(setPolicies) 18 | # No more policies to enforce 19 | endmacro() 20 | -------------------------------------------------------------------------------- /SIBR_viewers/cmake/linux/include_once.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | macro(include_once file) 12 | get_filename_component(INCLUDE_ONCE_FILEPATH ${file} REALPATH) 13 | string(REGEX REPLACE "(\\.|\\/+|\\:|\\\\+)" "_" INCLUDE_ONCE_FILEPATH ${INCLUDE_ONCE_FILEPATH}) 14 | get_property(INCLUDED_${INCLUDE_ONCE_FILEPATH}_LOCAL GLOBAL PROPERTY INCLUDED_${INCLUDE_ONCE_FILEPATH}) 15 | if (INCLUDED_${INCLUDE_ONCE_FILEPATH}_LOCAL) 16 | return() 17 | else() 18 | set_property(GLOBAL PROPERTY INCLUDED_${INCLUDE_ONCE_FILEPATH} true) 19 | 20 | include(${file}) 21 | endif() 22 | endmacro() -------------------------------------------------------------------------------- /SIBR_viewers/cmake/windows/cmake_policies.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | if(__set_policies_INCLUDED__) 12 | return() 13 | else() 14 | set(__set_policies_INCLUDED__ ON) 15 | endif() 16 | 17 | macro(setPolicies) 18 | # No more policies to enforce 19 | endmacro() 20 | -------------------------------------------------------------------------------- /SIBR_viewers/cmake/windows/include_once.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | macro(include_once file) 12 | get_filename_component(INCLUDE_ONCE_FILEPATH ${file} REALPATH) 13 | string(REGEX REPLACE "(\\.|\\/+|\\:|\\\\+)" "_" INCLUDE_ONCE_FILEPATH ${INCLUDE_ONCE_FILEPATH}) 14 | get_property(INCLUDED_${INCLUDE_ONCE_FILEPATH}_LOCAL GLOBAL PROPERTY INCLUDED_${INCLUDE_ONCE_FILEPATH}) 15 | if (INCLUDED_${INCLUDE_ONCE_FILEPATH}_LOCAL) 16 | return() 17 | else() 18 | set_property(GLOBAL PROPERTY INCLUDED_${INCLUDE_ONCE_FILEPATH} true) 19 | 20 | include(${file}) 21 | endif() 22 | endmacro() -------------------------------------------------------------------------------- /SIBR_viewers/docs/doxygen_prebuild.cmake.in: -------------------------------------------------------------------------------- 1 | set(SIBR_PROJECTS_SAMPLES_SUBPAGE_REF "@SIBR_PROJECTS_SAMPLES_SUBPAGE_REF@") 2 | set(SIBR_PROJECTS_OURS_SUBPAGE_REF "@SIBR_PROJECTS_OURS_SUBPAGE_REF@") 3 | set(SIBR_PROJECTS_TOOLBOX_SUBPAGE_REF "@SIBR_PROJECTS_TOOLBOX_SUBPAGE_REF@") 4 | set(SIBR_PROJECTS_OTHERS_SUBPAGE_REF "@SIBR_PROJECTS_OTHERS_SUBPAGE_REF@") 5 | set(SIBR_PROJECTS_SAMPLES_REF_REF "@SIBR_PROJECTS_SAMPLES_REF_REF@") 6 | set(SIBR_PROJECTS_OURS_REF_REF "@SIBR_PROJECTS_OURS_REF_REF@") 7 | set(SIBR_PROJECTS_TOOLBOX_REF_REF "@SIBR_PROJECTS_TOOLBOX_REF_REF@") 8 | set(SIBR_PROJECTS_OTHERS_REF_REF "@SIBR_PROJECTS_OTHERS_REF_REF@") 9 | set(DOXY_DOC_DEST_DIR "@DOXY_DOC_DEST_DIR@") 10 | set(DOXY_DOC_GENERATED_DOC_DIR "@DOXY_DOC_GENERATED_DOC_DIR@") 11 | set(DOXY_DOC_PAGES_DIR "@DOXY_DOC_PAGES_DIR@") 12 | 13 | ## Cleaning documentation folders 14 | file(REMOVE_RECURSE "${DOXY_DOC_GENERATED_DOC_DIR}") 15 | file(REMOVE_RECURSE "${DOXY_DOC_DEST_DIR}") 16 | 17 | ## Generating documentation pages with variables 18 | file(GLOB_RECURSE doc_files "${DOXY_DOC_PAGES_DIR}/*.in") 19 | foreach(filename ${doc_files}) 20 | message(STATUS "Generating ${filename}...") 21 | get_filename_component(output_filename ${filename} NAME_WLE) 22 | message(STATUS "Output in ${DOXY_DOC_GENERATED_DOC_DIR}/${output_filename}...") 23 | configure_file(${filename} ${DOXY_DOC_GENERATED_DOC_DIR}/${output_filename} @ONLY) 24 | endforeach() -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealaddinputs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealaddinputs.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealalignimages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealalignimages.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealcolorizesimplify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealcolorizesimplify.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealexportmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealexportmodel.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealinputsonly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealinputsonly.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealmesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealmesh.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealmeshreconstruction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealmeshreconstruction.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealnew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealnew.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/caprealpointcloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/caprealpointcloud.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/capreal/meshlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/capreal/meshlab.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/cmake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/cmake.gif -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/class/sibr_classes_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/class/sibr_classes_v2.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/class/unity_ulr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/class/unity_ulr.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/sequence/AssetStreamer/seq_assetStreamer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/sequence/AssetStreamer/seq_assetStreamer.pdf -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/sequence/Renderers/seq_insideOut.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/sequence/Renderers/seq_insideOut.pdf -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/sequence/Renderers/seq_ulr_stream.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/sequence/Renderers/seq_ulr_stream.pdf -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/sequence/Renderers/seq_ulr_v3_landscape.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/sequence/Renderers/seq_ulr_v3_landscape.pdf -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/sequence/Unity/seq_unity_ulr_rendering.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/sequence/Unity/seq_unity_ulr_rendering.pdf -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/diagramas/sequence/Unity/seq_unity_ulr_texture_upload.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/diagramas/sequence/Unity/seq_unity_ulr_texture_upload.pdf -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/ibr_common_cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/ibr_common_cmake.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/ibr_common_globale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/ibr_common_globale.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/ibr_common_principle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/ibr_common_principle.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/jesnault_git_cheat_sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/jesnault_git_cheat_sheet.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/multimeshmanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/multimeshmanager.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/multiviewmanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/multiviewmanager.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/sibr_dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/sibr_dataset.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/sibr_new_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/sibr_new_architecture.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/img/ulr_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/docs/img/ulr_screenshot.png -------------------------------------------------------------------------------- /SIBR_viewers/docs/pages/2_Projects.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | @page projects Projects 15 | */ 16 | -------------------------------------------------------------------------------- /SIBR_viewers/docs/pages/3_Tutorials.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | @page tutorials Dataset Documentation & Tutorials 15 | 16 | - @subpage howto_generate_dataset 17 | - @subpage howto_sibr_useful_objects 18 | - @subpage howto_setup_project 19 | - @subpage howto_cameras_paths 20 | 21 | */ 22 | -------------------------------------------------------------------------------- /SIBR_viewers/docs/pages/Tutorials/How to generate your dataset/How_to_create_dataset_from_colmap.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | @page HowToColmap How to create a dataset from Colmap 15 | 16 | We provide a python script that runs the entire Colmap pipeline, see here: @ref sibr_projects_dataset_tools_preprocess_tools_fullColmapProcess 17 | 18 | @note The previous link might not be available if you did not build the doc with `BUILD_IBR_DATASET_TOOLS` on 19 | 20 | However, you can also run your own Colmap reconstruction by yourself, and use `ColmapToSIBR` to create an SIBR project (i.e., images without borders, of the same size) from colmap data. In the install\scripts directory run: 21 | 22 | @code 23 | python colmap2sibr PATH_TO_DATASET 24 | @endcode 25 | 26 | This will create a *sibr_cm* subdirectory containing the modified scene. 27 | 28 | \section HowToColmap_example_datasets Example Datasets 29 | 30 | Example datasets processed with *fullColmapProcess* and *colmap2Sibr* are here: 31 | \n 32 | https://repo-sam.inria.fr/fungraph/sibr-datasets/ 33 | \n 34 | 35 | 36 | */ 37 | -------------------------------------------------------------------------------- /SIBR_viewers/docs/pages/Tutorials/How_to_setup_your_own_project.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | @page howto_setup_project How to setup your own project 15 | 16 | - @subpage project_structure 17 | - @subpage configure_project 18 | - @subpage create_library 19 | - @subpage document_project 20 | 21 | */ -------------------------------------------------------------------------------- /SIBR_viewers/src/core/assets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(sibr_assets) 12 | 13 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp" ) 14 | source_group("Source Files" FILES ${SOURCES}) 15 | 16 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 17 | 18 | 19 | ## Specify target rules 20 | add_library(${PROJECT_NAME} SHARED ${SOURCES}) 21 | 22 | include_directories( 23 | ${Boost_INCLUDE_DIRS} 24 | ${xatlas_INCLUDE_DIRS} 25 | ) 26 | target_link_libraries(${PROJECT_NAME} 27 | ${Boost_LIBRARIES} 28 | ${ASSIMP_LIBRARIES} 29 | ${GLEW_LIBRARIES} 30 | ${OPENGL_LIBRARIES} 31 | ${OpenCV_LIBRARIES} 32 | OpenMP::OpenMP_CXX 33 | sibr_graphics 34 | xatlas 35 | ) 36 | 37 | add_definitions(-DSIBR_ASSETS_EXPORTS -DBOOST_ALL_DYN_LINK) 38 | 39 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${SIBR_FOLDER}) 40 | 41 | ## High level macro to install in an homogen way all our ibr targets 42 | include(install_runtime) 43 | ibr_install_target(${PROJECT_NAME} 44 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 45 | ) 46 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/assets/IFileLoader.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | # include "core/assets/Config.hpp" 16 | 17 | namespace sibr 18 | { 19 | /** General file loading interface. 20 | \ingroup sibr_assets 21 | */ 22 | class SIBR_ASSETS_EXPORT IFileLoader 23 | { 24 | public: 25 | 26 | /** Destructor. */ 27 | virtual ~IFileLoader( void ) { } 28 | 29 | /** Load the file content from disk. 30 | \param filename path to the file 31 | \param verbose display information 32 | \return a boolean denoting success 33 | */ 34 | virtual bool load( const std::string& filename, bool verbose = true ) = 0; 35 | }; 36 | 37 | } // namespace sibr 38 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/assets/ImageListFile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | # include 15 | # include 16 | # include "core/assets/ImageListFile.hpp" 17 | 18 | namespace sibr 19 | { 20 | bool ImageListFile::load( const std::string& filename, bool verbose ) 21 | { 22 | 23 | std::fstream file(filename, std::ios::in); 24 | 25 | _infos.clear(); 26 | if (file) 27 | { 28 | while (file.eof() == false) 29 | { 30 | Infos i; 31 | file >> i.filename >> i.width >> i.height; 32 | if (i.filename.size()) 33 | _infos.emplace_back(std::move(i)); 34 | } 35 | 36 | // store basename 37 | boost::filesystem::path path(filename); 38 | _basename = path.parent_path().string(); 39 | 40 | if( verbose ) 41 | SIBR_FLOG << "'"<< filename <<"' successfully loaded." << std::endl; 42 | 43 | return true; 44 | } 45 | else 46 | SIBR_WRG << "file not found: '"< 16 | 17 | 18 | # ifdef SIBR_OS_WINDOWS 19 | # ifdef SIBR_STATIC_RAYCASTER_DEFINE 20 | # define SIBR_RAYCASTER_EXPORT 21 | # define SIBR_NO_RAYCASTER_EXPORT 22 | # else 23 | # ifndef SIBR_RAYCASTER_EXPORT 24 | # ifdef SIBR_RAYCASTER_EXPORTS 25 | /* We are building this library */ 26 | # define SIBR_RAYCASTER_EXPORT __declspec(dllexport) 27 | # else 28 | /* We are using this library */ 29 | # define SIBR_RAYCASTER_EXPORT __declspec(dllimport) 30 | # endif 31 | # endif 32 | # endif 33 | # else 34 | # define SIBR_RAYCASTER_EXPORT 35 | # endif 36 | 37 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/raycaster/Ray.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include "Ray.hpp" 15 | 16 | namespace sibr 17 | { 18 | /*static*/ SIBR_RAYCASTER_EXPORT const float RayHit::InfinityDist = std::numeric_limits::infinity(); 19 | 20 | Ray::Ray( const sibr::Vector3f& orig, const sibr::Vector3f& dir ) 21 | : _orig(orig), _dir(dir) 22 | { 23 | if (_dir[0] != 0.f || _dir[1] != 0.f || _dir[2] != 0.f) 24 | _dir.normalize(); 25 | } 26 | 27 | RayHit::RayHit( const Ray& r, float dist, const BCCoord& coord, 28 | const sibr::Vector3f& normal, const Primitive& prim ) 29 | : _ray(r), _dist(dist), _coord(coord), _normal(normal), _prim(prim) 30 | { 31 | _dist = std::max(dist, 0.f); 32 | 33 | // normalize '_normal' 34 | float len = length(_normal); 35 | if (len > 1e-10) 36 | _normal = _normal / len; 37 | 38 | } 39 | 40 | sibr::Vector3f RayHit::interpolateUV( void ) const 41 | { 42 | float ucoord = barycentricCoord().u; 43 | float vcoord = barycentricCoord().v; 44 | return sibr::Vector3f(std::max((1.f-ucoord-vcoord), 0.f), ucoord, vcoord); 45 | } 46 | 47 | } // namespace sibr 48 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/raycaster/sibr_raycaster.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | \defgroup sibr_raycaster sibr_raycaster 15 | 16 | \brief Raycasting utilities. 17 | 18 | This module provides functionalities related to raycasting on 2D and 3D geometry. 19 | It contains basic 2D intersection tests, a wrapper around the embree raycasting library (http://embree.github.io/), 20 | and helpers to perform raycasting over all pixels of an image. 21 | 22 | */ 23 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/BinaryMeshRenderer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #include "BinaryMeshRenderer.hpp" 14 | 15 | namespace sibr { 16 | 17 | BinaryMeshRenderer::BinaryMeshRenderer() 18 | { 19 | std::string vertex_shader = 20 | SIBR_SHADER(420, 21 | uniform mat4 MVP; 22 | layout(location = 0) in vec3 in_vertex; 23 | void main(void) { 24 | gl_Position = MVP * vec4(in_vertex, 1.0); 25 | } 26 | ); 27 | 28 | std::string fragment_shader = SIBR_SHADER(420, 29 | out vec4 out_color; 30 | uniform float epsilon; 31 | void main(void) { 32 | out_color = vec4(1, 1, 1, 1); 33 | gl_FragDepth = gl_FragCoord.z * (1.0 - epsilon); 34 | } 35 | ); 36 | 37 | _shader.init("binaryMeshShader", vertex_shader, fragment_shader); 38 | _paramMVP.init(_shader, "MVP"); 39 | epsilon.init(_shader, "epsilon"); 40 | } 41 | 42 | void BinaryMeshRenderer::process(const Mesh & mesh, const Camera & eye, IRenderTarget & dst) 43 | { 44 | dst.bind(); 45 | _shader.begin(); 46 | _paramMVP.set(eye.viewproj()); 47 | epsilon.send(); 48 | 49 | mesh.render(true, false); 50 | 51 | _shader.end(); 52 | dst.unbind(); 53 | } 54 | } -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/BlurRenderer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include 15 | 16 | namespace sibr { 17 | BlurRenderer::BlurRenderer( void ) 18 | { 19 | _shader.init("BlurShader", 20 | sibr::loadFile(sibr::getShadersDirectory("core") + "/texture.vert"), 21 | sibr::loadFile(sibr::getShadersDirectory("core") + "/blur.frag")); 22 | _paramImgSize.init(_shader, "in_image_size"); 23 | } 24 | 25 | void BlurRenderer::process( uint textureID, const Vector2f& textureSize, IRenderTarget& dst ) 26 | { 27 | dst.bind(); 28 | 29 | glDisable(GL_DEPTH_TEST); 30 | glDisable(GL_BLEND); 31 | 32 | glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, textureID ); 33 | glDisable(GL_DEPTH_TEST); 34 | _shader.begin(); 35 | _paramImgSize.set(textureSize); 36 | RenderUtility::renderScreenQuad(); 37 | _shader.end(); 38 | 39 | dst.unbind(); 40 | } 41 | 42 | } /*namespace sibr*/ 43 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/BlurRenderer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | # include 16 | # include 17 | 18 | # include 19 | 20 | namespace sibr { 21 | 22 | /** Blur on color edges present in a texture. 23 | \ingroup sibr_renderer 24 | */ 25 | class SIBR_EXP_RENDERER_EXPORT BlurRenderer 26 | { 27 | public: 28 | typedef std::shared_ptr Ptr; 29 | 30 | public: 31 | 32 | /// Constructor. 33 | BlurRenderer( void ); 34 | 35 | /** Process the texture. 36 | \param textureID the texture to blur 37 | \param textureSize the texture dimensions 38 | \param dst the destination rendertarget 39 | */ 40 | void process( 41 | /*input*/ uint textureID, 42 | /*input*/ const Vector2f& textureSize, 43 | /*output*/ IRenderTarget& dst ); 44 | 45 | private: 46 | 47 | GLShader _shader; ///< Blur shader. 48 | GLParameter _paramImgSize; ///< Texture size uniform. 49 | 50 | }; 51 | 52 | } /*namespace sibr*/ 53 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/ColoredMeshRenderer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include "core/graphics/Texture.hpp" 15 | #include 16 | 17 | namespace sibr { 18 | ColoredMeshRenderer::ColoredMeshRenderer( void ) 19 | { 20 | _shader.init("ColoredMesh", 21 | sibr::loadFile(sibr::getShadersDirectory("core") + "/colored_mesh.vert"), 22 | sibr::loadFile(sibr::getShadersDirectory("core") + "/colored_mesh.frag")); 23 | _paramMVP.init(_shader,"MVP"); 24 | } 25 | 26 | void ColoredMeshRenderer::process( const Mesh& mesh, const Camera& eye, IRenderTarget& target, sibr::Mesh::RenderMode mode, bool backFaceCulling ) 27 | { 28 | //glViewport(0.f, 0.f, target.w(), target.h()); 29 | target.bind(); 30 | glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); 31 | _shader.begin(); 32 | _paramMVP.set(eye.viewproj()); 33 | mesh.render(true, backFaceCulling); 34 | _shader.end(); 35 | target.unbind(); 36 | } 37 | 38 | } /*namespace sibr*/ 39 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/Config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | # include 16 | 17 | # ifdef SIBR_OS_WINDOWS 18 | # ifdef SIBR_STATIC_DEFINE 19 | # define SIBR_EXPORT 20 | # define SIBR_NO_EXPORT 21 | # else 22 | # ifndef SIBR_EXP_RENDERER_EXPORT 23 | # ifdef SIBR_EXP_RENDERER_EXPORTS 24 | /* We are building this library */ 25 | # define SIBR_EXP_RENDERER_EXPORT __declspec(dllexport) 26 | # else 27 | /* We are using this library */ 28 | # define SIBR_EXP_RENDERER_EXPORT __declspec(dllimport) 29 | # endif 30 | # endif 31 | # ifndef SIBR_NO_EXPORT 32 | # define SIBR_NO_EXPORT 33 | # endif 34 | # endif 35 | # else 36 | # define SIBR_EXP_RENDERER_EXPORT 37 | # endif 38 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/PositionRender.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | # include "PositionRender.hpp" 14 | 15 | #include 16 | 17 | namespace sibr 18 | { 19 | PositionRenderer::PositionRenderer(int w,int h) 20 | { 21 | _shader.init("positionRendere", 22 | sibr::loadFile(sibr::Resources::Instance()->getResourceFilePathName("positionRenderer.vert")), 23 | sibr::loadFile(sibr::Resources::Instance()->getResourceFilePathName("positionRenderer.frag"))); 24 | 25 | _MVP.init(_shader,"MVP"); 26 | _RT.reset(new sibr::RenderTargetRGB32F(w,h)); 27 | } 28 | 29 | void PositionRenderer::render( const sibr::Camera& cam, const Mesh& mesh, bool backFaceCulling, bool frontFaceCulling) 30 | { 31 | glViewport(0, 0, _RT->w(), _RT->h()); 32 | _RT->bind(); 33 | glClearColor(0.0, 0.0, 0.0, 1.0); 34 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 35 | 36 | _shader.begin(); 37 | _MVP.set(cam.viewproj()); 38 | 39 | mesh.render(true, backFaceCulling, sibr::Mesh::FillRenderMode, frontFaceCulling); 40 | 41 | _shader.end(); 42 | _RT->unbind(); 43 | } 44 | 45 | } // namespace -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/colored_mesh.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | out vec4 out_color; 16 | 17 | in vec3 vertColor; 18 | 19 | void main(void) { 20 | out_color = vec4(vertColor, 1.0); 21 | } 22 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/colored_mesh.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 1) in vec3 in_color; 19 | 20 | out vec3 vertColor; 21 | 22 | void main(void) { 23 | gl_Position = MVP * vec4(in_vertex,1.0); 24 | 25 | vertColor = in_color; 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/copy.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | uniform sampler2D image; 18 | uniform bool flip = false; 19 | 20 | in vec4 texcoord; 21 | 22 | void main(void) 23 | { 24 | vec4 color = texture(image, flip ? vec2(texcoord.x, 1.0 - texcoord.y) : texcoord.xy); 25 | out_color = color;//vec4(color.rgb, 1.0); 26 | gl_FragDepth = color.w; 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/copy_depth.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | layout(binding = 0) uniform sampler2D image; 18 | 19 | in vec4 texcoord; 20 | 21 | void main(void) 22 | { 23 | vec4 color = texture(image, texcoord.xy); 24 | out_color = vec4(vec3(color.r), 1.0); 25 | gl_FragDepth = color.r; 26 | //gl_FragDepth = color.r == 0? 1.0 : color.r; 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/depthRenderer.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | out float out_depth; 16 | 17 | void main(void) { 18 | 19 | out_depth = 2.0*gl_FragCoord.z-1.0; 20 | //out_color = fragTexCoord.x*vec4(1.0,0.0,0.0,1.0); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/depthRenderer.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | 20 | void main(void) { 21 | 22 | gl_Position = MVP * vec4(in_vertex,1.0); 23 | //fragTexCoord = vec2(0.2,0.8); 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/emotive_relight.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 1) in vec3 in_ao; 19 | layout(location = 2) in vec2 in_uv; 20 | layout(location = 3) in vec3 in_normal; 21 | 22 | out vec2 vertUV; 23 | out float vertAO; 24 | out vec3 VtoF_normal; 25 | out vec3 vertPos; 26 | 27 | void main(void) { 28 | gl_Position = MVP * vec4(in_vertex,1.0); 29 | 30 | vertUV = in_uv; 31 | vertAO = in_ao.x; 32 | VtoF_normal = in_normal; 33 | vertPos = in_vertex; 34 | } 35 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/hdrEnvMap.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform sampler2D tex; 16 | 17 | out vec4 out_color; 18 | 19 | in vec2 vertUV; 20 | 21 | float lin2sRGBF(float inF){ 22 | 23 | if(inF<0.0031308){ 24 | return 12.92*inF; 25 | } 26 | else{ 27 | return 1.055*pow(inF,1.0/2.4)-0.055; 28 | } 29 | 30 | } 31 | 32 | vec4 lin2sRGB(vec4 inVec){ 33 | return vec4(lin2sRGBF(inVec.x),lin2sRGBF(inVec.y),lin2sRGBF(inVec.z),inVec.w); 34 | } 35 | 36 | void main(void) { 37 | vec2 uv = vertUV; 38 | uv.y = 1.0 - uv.y; /// \todo TODO: Why Texture are flipped in y ? 39 | out_color = lin2sRGB(texture(tex, uv)); 40 | } -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/hdrEnvMap.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 2) in vec2 in_uv; 19 | 20 | out vec2 vertUV; 21 | 22 | void main(void) { 23 | gl_Position = MVP * vec4(in_vertex,1.0); 24 | 25 | vertUV = in_uv; 26 | } -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/longlat.tes: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | 3 | layout(triangles, equal_spacing, cw) in; 4 | 5 | layout(location = 1) in vec3 colors_tcs[]; 6 | layout(location = 2) in vec2 coordsTex_tcs[]; 7 | layout(location = 3) in vec3 normals_tcs[]; 8 | 9 | layout(location = 1) out vec3 colors_tes; 10 | layout(location = 2) out vec2 coordsTex_tes; 11 | layout(location = 3) out vec3 normals_tes; 12 | 13 | void main(void) { 14 | colors_tes = colors_tcs[0]; 15 | coordsTex_tes = coordsTex_tcs[0]; 16 | normals_tes = normals_tcs[0]; 17 | vec4 inPos = (gl_TessCoord.x*gl_in[0].gl_Position + gl_TessCoord.y*gl_in[1].gl_Position + gl_TessCoord.z*gl_in[2].gl_Position); 18 | 19 | gl_Position = inPos; 20 | } 21 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/longlat.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 450 14 | layout(location = 0) in vec3 inPos; 15 | layout(location = 1) in vec3 inColors; 16 | layout(location = 2) in vec2 inCoordsTex; 17 | layout(location = 3) in vec3 inNormals; 18 | 19 | layout(location = 1) out vec3 vs_colors; 20 | layout(location = 2) out vec2 vs_coordsTex; 21 | layout(location = 3) out vec3 vs_normals; 22 | 23 | void main() 24 | { 25 | vs_colors= inColors; 26 | vs_coordsTex = inCoordsTex; 27 | vs_normals = inNormals; 28 | gl_Position = vec4(inPos,1.0f); 29 | } 30 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/longlatColor.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 450 14 | layout(location = 0) out vec4 outColor; 15 | layout(location = 0) in vec4 position; 16 | layout(location = 1) in vec3 colors_gs; 17 | layout(location = 2) in vec2 texCoords_gs; 18 | layout(location = 3) in vec3 normals_gs; 19 | 20 | void main() 21 | { 22 | 23 | if(100.f*position.z<0.001) 24 | discard; 25 | //outColor = vec4(1.f-10.f*position.z, 1.f-10.f*position.z, 1.f-10.f*position.z , 1.0f); 26 | outColor = vec4(colors_gs.x, colors_gs.y, colors_gs.z , 1.0f); 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/longlatDepth.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 450 14 | layout(location = 0) out vec4 outColor; 15 | layout(location = 0) in vec4 position; 16 | layout(location = 1) in vec3 colors_gs; 17 | layout(location = 2) in vec2 texCoords_gs; 18 | layout(location = 3) in vec3 normals_gs; 19 | 20 | void main() 21 | { 22 | 23 | if(100.f*position.z<0.001) 24 | discard; 25 | outColor = vec4(1.f-10.f*position.z, 1.f-10.f*position.z, 1.f-10.f*position.z , 1.0f); 26 | //outColor = vec4(colors_gs.x, colors_gs.y, colors_gs.z , 1.0f); 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/noproj.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /** \file ibr.vp 14 | * 15 | * Vertex shader WITHOUT projection and modelview transformations. 16 | */ 17 | 18 | #version 420 19 | 20 | layout(location = 0) in vec4 in_vertex; /**< Input vertex coordinates */ 21 | layout(location = 1) in vec4 in_texcoord; /**< Input texture coordinates */ 22 | layout(location = 2) in vec4 in_color; /**< Input colour value */ 23 | 24 | out vec4 texcoord; /**< Output texture coordinates */ 25 | out vec4 color; /**< Output color value */ 26 | 27 | void main(void) { 28 | gl_Position = in_vertex; 29 | texcoord = in_texcoord; 30 | color = in_color; 31 | } 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/normalRenderer.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | in vec3 GtoF_normal; 16 | layout(location = 0) out vec4 out_color; 17 | 18 | void main(void) { 19 | 20 | vec3 colorN=(GtoF_normal+1.0)/2.0; 21 | out_color = vec4(colorN,1.0); 22 | //out_color = fragTexCoord.x*vec4(1.0,0.0,0.0,1.0); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/normalRenderer.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | uniform mat4 M; 17 | uniform mat4 V; 18 | uniform bool imSpaceNormals; 19 | 20 | layout(location = 0) in vec3 in_vertex; 21 | layout(location = 3) in vec3 in_normal; 22 | 23 | out vec3 GtoF_normal; 24 | 25 | void main(void) { 26 | gl_Position = MVP * vec4(in_vertex,1.0); 27 | 28 | if(imSpaceNormals) 29 | GtoF_normal = normalize((inverse(transpose(V*M)) * vec4(in_normal,0.0)).xyz); 30 | else 31 | GtoF_normal = normalize((inverse(transpose(M)) * vec4(in_normal,0.0)).xyz); 32 | } 33 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/normalRendererGen.gp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVPinv; 16 | 17 | layout(triangles) in; 18 | layout (triangle_strip) out; 19 | layout (max_vertices = 3) out; 20 | 21 | out vec3 GtoF_normal; 22 | 23 | void main(void) { 24 | 25 | vec3 P0 = (MVPinv *gl_in[0].gl_Position).xyz; 26 | vec3 P1 = (MVPinv *gl_in[1].gl_Position).xyz; 27 | vec3 P2 = (MVPinv *gl_in[2].gl_Position).xyz; 28 | 29 | vec3 V0 = P0 - P1; 30 | vec3 V1 = P2 - P1; 31 | 32 | vec3 N = normalize( cross(V1, V0) ); 33 | 34 | int i; 35 | 36 | for (i = 0; i < gl_in.length(); i++) 37 | { 38 | GtoF_normal = N; // Specs say we need to set again output values after calling EmitVertex 39 | gl_Position = gl_in[i].gl_Position; 40 | EmitVertex(); 41 | } 42 | EndPrimitive(); 43 | 44 | } -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/normalRendererGen.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | void main(void) { 20 | gl_Position = MVP * vec4(in_vertex,1.0); 21 | //fragTexCoord = vec2(0.2,0.8); 22 | } 23 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/poisson_diverg.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(binding = 0) uniform sampler2D synth; 16 | layout(location= 0) out vec4 out_constraint; 17 | 18 | void main(void) { 19 | vec4 I = texelFetch(synth, ivec2(gl_FragCoord.xy), 0); 20 | 21 | // hole - perform Poisson synthesis here 22 | if (all(lessThan(I.xyz,vec3(0.01)))) 23 | out_constraint = vec4(0); 24 | else 25 | out_constraint = I; 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/poisson_interp.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform float scale; 16 | 17 | layout(binding = 0) uniform sampler2D coarse; 18 | layout(binding = 1) uniform sampler2D constraint; 19 | layout(location= 0) out vec4 out_color; 20 | 21 | in vec4 texcoord; 22 | 23 | 24 | void main(void) { 25 | // sample color from lower multigrid level by scaling texture coordinates 26 | vec4 color = texture(coarse,vec2(gl_FragCoord.xy/scale)/textureSize(coarse,0).xy,0); 27 | 28 | // sample Dirichlet constraint without texture filtering because pixel without 29 | // Dirichlet constraint are black and texture filtering may break this check 30 | vec4 cons = texelFetch(constraint,ivec2(gl_FragCoord),0); 31 | 32 | // write color of lower level to output except holes pixels in the constraint 33 | if (any(greaterThan(cons.rgb,vec3(0.01)))) 34 | out_color = cons; 35 | else 36 | out_color = color; 37 | } 38 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/poisson_restrict.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform float scale; 16 | 17 | layout(binding = 0) uniform sampler2D cons; 18 | layout(location= 0) out vec4 out_constraint; 19 | 20 | void main(void) { 21 | mat3 f = mat3( 22 | 0.25, 0.50, 0.25, 23 | 0.50, 1.00, 0.50, 24 | 0.25, 0.50, 0.25); 25 | 26 | vec4 constr = vec4(0); 27 | 28 | float sum = 0; 29 | 30 | ivec2 coord = ivec2(gl_FragCoord.xy*scale); 31 | for (int i=0; i<3; i++) { 32 | for (int j=0; j<3; j++) { 33 | vec4 c = texelFetch(cons,coord+ivec2(i-1,j-1),0); 34 | float a = float(any(greaterThan(c.rgb, vec3(0.01)))); 35 | constr += f[i][j] * a * c; 36 | sum += f[i][j] * a; 37 | } 38 | } 39 | out_constraint = constr / sum; 40 | } 41 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/positionReflectedDirRenderer.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | in vec3 position; 16 | in vec3 normal; 17 | 18 | uniform vec3 cameraPos; 19 | 20 | layout(location = 0) out vec3 outPosition; 21 | layout(location = 1) out vec3 outDirection; 22 | 23 | void main(void) { 24 | outPosition = position; 25 | outDirection = reflect(normalize(position - cameraPos), normal); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/positionReflectedDirRenderer.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 3) in vec3 in_normal; 19 | 20 | out vec3 position; 21 | out vec3 normal; 22 | 23 | void main(void) { 24 | gl_Position = MVP * vec4(in_vertex,1.0); 25 | position = in_vertex; 26 | normal = in_normal; 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/positionRenderer.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | out vec3 out_position; 16 | 17 | in vec3 position; 18 | 19 | void main(void) { 20 | out_position = position; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/positionRenderer.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | out vec3 position; 20 | 21 | void main(void) { 22 | gl_Position = MVP * vec4(in_vertex,1.0); 23 | position = in_vertex; 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/shadowMapRenderer.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | uniform mat4 depthMapMVP; 17 | 18 | layout(location = 0) in vec3 in_vertex; 19 | layout(location = 3) in vec3 in_normal; 20 | 21 | out vec4 depthMapProj; 22 | out vec3 VtoF_normal; 23 | out vec3 VtoF_pos; 24 | 25 | void main(void) { 26 | 27 | gl_Position = MVP * vec4(in_vertex,1.0); 28 | 29 | depthMapProj = depthMapMVP * vec4(in_vertex,1.0); 30 | 31 | VtoF_normal = in_normal; 32 | VtoF_pos = in_vertex; 33 | } 34 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/texture-invert.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(binding = 0) uniform sampler2D tex; 16 | layout(location= 0) out vec4 out_color; 17 | 18 | in vec2 tex_coord; 19 | 20 | void main(void) { 21 | vec2 texcoord = tex_coord ; 22 | out_color = vec4(1, 1, 1, 1) - texture(tex,texcoord); 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/texture.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(binding = 0) uniform sampler2D tex; 16 | layout(location= 0) out vec4 out_color; 17 | 18 | in vec2 tex_coord; 19 | 20 | void main(void) { 21 | vec2 texcoord = tex_coord ; 22 | out_color = texture(tex,texcoord); 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/texture.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | #define VERTICAL_FLIP (0) 16 | 17 | layout(location = 0) in vec2 in_vertex; 18 | layout(location = 1) in vec2 in_texcoord; 19 | 20 | 21 | out vec2 tex_coord; 22 | 23 | void main(void) { 24 | gl_Position = vec4(in_vertex, 0.0, 1.0); 25 | tex_coord.x = in_texcoord.x; 26 | if (VERTICAL_FLIP==1) { 27 | tex_coord.y = 1.0 - in_texcoord.y; 28 | } 29 | else { 30 | tex_coord.y = in_texcoord.y; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/textured_mesh.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform sampler2D tex; 16 | 17 | out vec4 out_color; 18 | 19 | in vec2 vertUV; 20 | 21 | void main(void) { 22 | vec2 uv = vertUV; 23 | if(uv.x==0.0 && uv.y==0.0){ 24 | out_color = vec4(1.0,1.0,1.0,1.0); 25 | } 26 | else{ 27 | uv.y = 1.0 - uv.y; /// \todo TODO: Why Texture are flipped in y ? 28 | out_color = texture(tex, uv); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/textured_mesh.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 2) in vec2 in_uv; 19 | 20 | out vec2 vertUV; 21 | 22 | void main(void) { 23 | gl_Position = MVP * vec4(in_vertex,1.0); 24 | 25 | vertUV = in_uv; 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/shaders/textured_mesh_flipY.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 2) in vec2 in_uv; 19 | 20 | out vec2 vertUV; 21 | 22 | void main(void) { 23 | gl_Position = MVP * vec4(in_vertex,1.0); 24 | vec2 uv = in_uv; 25 | uv.y = 1.0 - uv.y ; 26 | vertUV = uv; 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/renderer/sibr_renderer.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | \defgroup sibr_renderer sibr_renderer 15 | 16 | \brief Renderer utilities. 17 | 18 | */ 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/scene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(sibr_scene) 12 | 13 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 14 | source_group("Source Files" FILES ${SOURCES}) 15 | 16 | 17 | ## Specify target rules 18 | add_library(${PROJECT_NAME} SHARED ${SOURCES}) 19 | 20 | include_directories(${Boost_INCLUDE_DIRS}) 21 | target_link_libraries(${PROJECT_NAME} 22 | ${Boost_LIBRARIES} 23 | ${ASSIMP_LIBRARIES} 24 | ${GLEW_LIBRARIES} 25 | ${OPENGL_LIBRARIES} 26 | ${OpenCV_LIBRARIES} 27 | OpenMP::OpenMP_CXX 28 | sibr_assets 29 | sibr_graphics 30 | sibr_raycaster 31 | ) 32 | 33 | add_definitions( -DSIBR_SCENE_EXPORTS -DBOOST_ALL_DYN_LINK ) 34 | 35 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${SIBR_FOLDER}) 36 | 37 | ## High level macro to install in an homogen way all our ibr targets 38 | include(install_runtime) 39 | ibr_install_target(${PROJECT_NAME} 40 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 41 | ) 42 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/scene/CalibratedCameras.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #include "CalibratedCameras.hpp" 14 | 15 | namespace sibr { 16 | void CalibratedCameras::setupFromData(const sibr::IParseData::Ptr& data) 17 | { 18 | 19 | 20 | _inputCameras.resize(data->numCameras()); 21 | _inputCameras = data->cameras(); 22 | return; 23 | } 24 | 25 | void CalibratedCameras::debugFlagCameraAsUsed(const std::vector& selectedCameras) 26 | { 27 | // Used for Debugging -- Display colored cameras in TopView 28 | std::vector cameraUsed(inputCameras().size(), false); 29 | for (uint usedID : selectedCameras) 30 | cameraUsed[usedID] = true; 31 | usedCameraForRendering(cameraUsed); 32 | 33 | } 34 | 35 | const void CalibratedCameras::updateNearsFars(std::vector & nearsFars) 36 | { 37 | if (_inputCameras.size() != nearsFars.size()) 38 | SIBR_ERR << "InputCamera size does not match Clipping Planes size!" << std::endl; 39 | 40 | for (int c = 0; c < _inputCameras.size(); c++){ 41 | _inputCameras[c]->znear(nearsFars[c].x()); 42 | _inputCameras[c]->zfar(nearsFars[c].y()); 43 | } 44 | } 45 | 46 | 47 | 48 | 49 | } -------------------------------------------------------------------------------- /SIBR_viewers/src/core/scene/Config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | # include "core/graphics/Config.hpp" 16 | # include 17 | 18 | 19 | #ifdef SIBR_OS_WINDOWS 20 | //// Export Macro (used for creating DLLs) //// 21 | # ifdef SIBR_STATIC_DEFINE 22 | # define SIBR_EXPORT 23 | # define SIBR_NO_EXPORT 24 | # else 25 | # ifndef SIBR_SCENE_EXPORT 26 | # ifdef SIBR_SCENE_EXPORTS 27 | /* We are building this library */ 28 | # define SIBR_SCENE_EXPORT __declspec(dllexport) 29 | # else 30 | /* We are using this library */ 31 | # define SIBR_SCENE_EXPORT __declspec(dllimport) 32 | # endif 33 | # endif 34 | # ifndef SIBR_NO_EXPORT 35 | # define SIBR_NO_EXPORT 36 | # endif 37 | # endif 38 | # else 39 | # define SIBR_SCENE_EXPORT 40 | # endif 41 | 42 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/scene/IProxyMesh.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | #include "core/scene/Config.hpp" 16 | #include "core/scene/IParseData.hpp" 17 | #include "core/graphics/Mesh.hpp" 18 | 19 | namespace sibr { 20 | /** 21 | \ingroup sibr_scene 22 | */ 23 | class SIBR_SCENE_EXPORT IProxyMesh { 24 | SIBR_DISALLOW_COPY(IProxyMesh); 25 | public: 26 | typedef std::shared_ptr Ptr; 27 | 28 | virtual void loadFromData(const IParseData::Ptr & data) = 0; 29 | virtual void replaceProxy(Mesh::Ptr newProxy) = 0; 30 | virtual void replaceProxyPtr(Mesh::Ptr newProxy) = 0; 31 | virtual bool hasProxy(void) const = 0; 32 | virtual const Mesh& proxy(void) const = 0; 33 | virtual const Mesh::Ptr proxyPtr(void) const = 0; 34 | 35 | protected: 36 | IProxyMesh() {}; 37 | 38 | }; 39 | 40 | } -------------------------------------------------------------------------------- /SIBR_viewers/src/core/scene/sibr_scene.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | \defgroup sibr_scene sibr_scene 15 | 16 | \brief IBR Scene components. 17 | 18 | */ 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(sibr_system) 12 | 13 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 14 | source_group("Source Files" FILES ${SOURCES}) 15 | 16 | ## Specify target rules 17 | add_library(${PROJECT_NAME} SHARED ${SOURCES}) 18 | 19 | include_directories( 20 | ${Boost_INCLUDE_DIRS} 21 | ${picojson_INCLUDE_DIRS} 22 | ${rapidxml_INCLUDE_DIRS} 23 | ) 24 | if (WIN32) 25 | target_link_libraries(${PROJECT_NAME} 26 | ${Boost_LIBRARIES} 27 | picojson 28 | rapidxml 29 | nfd 30 | ) 31 | else() 32 | target_link_libraries(${PROJECT_NAME} 33 | ${Boost_LIBRARIES} 34 | picojson 35 | rapidxml 36 | nativefiledialog 37 | ) 38 | endif() 39 | 40 | add_definitions( -DSIBR_SYSTEM_EXPORTS -DBOOST_ALL_DYN_LINK ) 41 | 42 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${SIBR_FOLDER}) 43 | 44 | ## High level macro to install in an homogen way all our ibr targets 45 | include(install_runtime) 46 | ibr_install_target(${PROJECT_NAME} 47 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 48 | ) 49 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/Config.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include 15 | #include "core/system/Config.hpp" 16 | 17 | std::mutex gLogMutex; 18 | 19 | namespace sibr 20 | { 21 | 22 | LogExit::LogExit(void) : 23 | lock(gLogMutex) 24 | { } 25 | 26 | void LogExit::operator <<=( const std::ostream& /*stream*/ ) 27 | { 28 | // do exit, only profit a the rules of 'operator precedence' 29 | // to be executed after operator << when writing to the stream 30 | // itself. 31 | // So that this class is evaluated after writing the output and 32 | // it will exit (see dtor) 33 | //exit(EXIT_FAILURE); 34 | throw std::runtime_error("See log for message errors"); 35 | } 36 | 37 | DebugScopeProfiler::~DebugScopeProfiler( void ) 38 | { 39 | double t = double(clock() - _t0) / CLOCKS_PER_SEC; 40 | SIBR_LOG << "[PROFILER] Scope '" << _name << 41 | "' completed in " << t << "sec." << std::endl; 42 | } 43 | 44 | DebugScopeProfiler::DebugScopeProfiler( const std::string& name ) 45 | : _name(name) 46 | { 47 | _t0 = clock(); 48 | } 49 | 50 | } // namespace sirb -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/MatrixPlugin.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | // This file is used to extend Eigen's MatrixBase class using 15 | // the following tricks: 16 | // https://eigen.tuxfamily.org/dox-3.2/TopicCustomizingEigen.html 17 | 18 | public: 19 | 20 | typedef Scalar Type; 21 | enum { NumComp = RowsAtCompileTime }; 22 | 23 | //Matrix( const Scalar* data ) { for(int i=0; ioperator [] (i) = data[i]; } 24 | 25 | /** 26 | Matrix( float x, float y=0.f, float z=0.f, float w=0.f ) { 27 | float data[] = {x, y, z, w}; 28 | for(int i=0; ioperator [] (i) = data[i]; 29 | } 30 | **/ 31 | 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/Quaternion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include "core/system/Transform3.hpp" 15 | 16 | namespace sibr 17 | { 18 | 19 | } // namespace sibr 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/ThreadIdWorker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include "core/system/ThreadIdWorker.hpp" 15 | 16 | namespace sibr 17 | { 18 | /*static*/ std::mutex ThreadIdWorker::g_mutex; 19 | 20 | } // namespace sibr 21 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/Vector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #include "core/system/Vector.hpp" 15 | # include "core/system/Quaternion.hpp" 16 | 17 | namespace sibr 18 | { 19 | 20 | Vector3f toColorFloat(Vector3ub & colorUB ) { 21 | return colorUB.cast().unaryExpr( [] (unsigned char c) { return (float)c/255.0f; } ); 22 | } 23 | 24 | Vector3ub toColorUB( Vector3f & colorFloat ) { 25 | return colorFloat.unaryExpr( [] (float f) { return std::floor(f*255.0f); } ).cast(); 26 | } 27 | 28 | Eigen::Matrix alignRotationMatrix(const sibr::Vector3f & from, const sibr::Vector3f & to) 29 | { 30 | sibr::Quaternionf q = sibr::Quaternionf::FromTwoVectors(from, to); 31 | q.normalize(); 32 | Eigen::Matrix3f R = q.toRotationMatrix(); 33 | sibr::Matrix4f R4; 34 | R4.setIdentity(); 35 | R4.block<3, 3>(0, 0) = R; 36 | return R4; 37 | } 38 | 39 | } // namespace sibr 40 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/VectorUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #include "VectorUtils.hpp" -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/XMLTree.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #include "XMLTree.h" 14 | #include "rapidxml/rapidxml_print.hpp" 15 | #include 16 | #include 17 | #include 18 | 19 | 20 | namespace sibr { 21 | XMLTree::XMLTree(const std::string & path) 22 | { 23 | std::cout << "Parsing xml file < " << path << " > : "; 24 | std::ifstream file(path.c_str()); 25 | if (file) { 26 | std::stringstream buffer; 27 | buffer << file.rdbuf(); 28 | file.close(); 29 | xmlString = std::move(std::string(buffer.str())); 30 | this->parse<0>(&xmlString[0]); 31 | std::cout << "success " << std::endl; 32 | } 33 | else { 34 | std::cout << "error, cant open file " << std::endl; 35 | } 36 | } 37 | 38 | 39 | XMLTree::~XMLTree(void) 40 | { 41 | } 42 | 43 | 44 | bool XMLTree::save(const std::string & path) const { 45 | std::ofstream file(path); 46 | if(!file.is_open()) { 47 | SIBR_WRG << "Unable to save XML to path \"" << path << "\"." << std::endl; 48 | return false; 49 | } 50 | 51 | file << *this; 52 | file.close(); 53 | return true; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/XMLTree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | #include 16 | #include 17 | #include "Config.hpp" 18 | 19 | namespace sibr { 20 | 21 | /** Wrapper of rapidxml xml_document<> class so that the string associated to the xml file stays in memory. 22 | Needed to access nodes by their names. 23 | * \ingroup sibr_system 24 | */ 25 | class SIBR_SYSTEM_EXPORT XMLTree : public rapidxml::xml_document<> 26 | { 27 | public: 28 | /** Construct an XML structure from the content of a file. 29 | \param path the file path 30 | */ 31 | XMLTree(const std::string & path); 32 | 33 | /** Destructor. */ 34 | ~XMLTree(void); 35 | 36 | /** Save the XML structure to a file as a string representation. 37 | \param path output path 38 | \return a success flag 39 | */ 40 | bool save(const std::string & path) const; 41 | 42 | private: 43 | std::string xmlString; //< Internal copy of the laoded string. 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/system/sibr_system.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | \defgroup sibr_system sibr_system 15 | 16 | \brief System utilities. 17 | 18 | */ 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/video/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(sibr_video) 12 | 13 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 14 | source_group("Source Files" FILES ${SOURCES}) 15 | 16 | 17 | ## Specify target rules 18 | add_library(${PROJECT_NAME} SHARED ${SOURCES}) 19 | 20 | include_directories(${Boost_INCLUDE_DIRS}) 21 | target_link_libraries(${PROJECT_NAME} 22 | ${FFMPEG_LIBRARIES} 23 | OpenMP::OpenMP_CXX 24 | sibr_graphics 25 | ) 26 | 27 | 28 | 29 | add_definitions( -DSIBR_VIDEO_EXPORTS -DBOOST_ALL_DYN_LINK ) 30 | 31 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${SIBR_FOLDER}) 32 | 33 | 34 | ## High level macro to install in an homogen way all our ibr targets 35 | include(install_runtime) 36 | ibr_install_target(${PROJECT_NAME} 37 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 38 | ) 39 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/video/Config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | #include "core/graphics/Config.hpp" 16 | 17 | //// Export Macro (used for creating DLLs) //// 18 | # ifdef SIBR_OS_WINDOWS 19 | # ifdef SIBR_STATIC_VIDEO_DEFINE 20 | # define SIBR_VIDEO_EXPORT 21 | # define SIBR_NO_VIDEO_EXPORT 22 | # else 23 | # ifndef SIBR_VIDEO_EXPORT 24 | # ifdef SIBR_VIDEO_EXPORTS 25 | /* We are building this library */ 26 | # define SIBR_VIDEO_EXPORT __declspec(dllexport) 27 | # else 28 | /* We are using this library */ 29 | # define SIBR_VIDEO_EXPORT __declspec(dllimport) 30 | # endif 31 | # endif 32 | # ifndef SIBR_NO_EXPORT 33 | # define SIBR_NO_EXPORT 34 | # endif 35 | # endif 36 | # else 37 | # define SIBR_VIDEO_EXPORT 38 | # endif 39 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/video/sibr_video.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | \defgroup sibr_video sibr_video 15 | 16 | \brief Video loading, processing and display. 17 | 18 | */ 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/Config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | # include "core/graphics/Config.hpp" 16 | 17 | 18 | //// Export Macro (used for creating DLLs) //// 19 | # ifdef SIBR_OS_WINDOWS 20 | # ifdef SIBR_STATIC_VIEW_DEFINE 21 | # define SIBR_VIEW_EXPORT 22 | # define SIBR_NO_VIEW_EXPORT 23 | # else 24 | # ifndef SIBR_VIEW_EXPORT 25 | # ifdef SIBR_VIEW_EXPORTS 26 | /* We are building this library */ 27 | # define SIBR_VIEW_EXPORT __declspec(dllexport) 28 | # else 29 | /* We are using this library */ 30 | # define SIBR_VIEW_EXPORT __declspec(dllimport) 31 | # endif 32 | # endif 33 | # ifndef SIBR_NO_EXPORT 34 | # define SIBR_NO_EXPORT 35 | # endif 36 | # endif 37 | # else 38 | # define SIBR_VIEW_EXPORT 39 | # endif 40 | 41 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/ICameraHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #include "ICameraHandler.hpp" -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/UIShortcuts.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #pragma once 14 | 15 | # include 16 | # include "core/view/Config.hpp" 17 | 18 | namespace sibr 19 | { 20 | /** Register and display keyboard shortcuts. 21 | * \todo The system should be more robust for collision detection. 22 | * \ingroup sibr_view 23 | */ 24 | class SIBR_VIEW_EXPORT UIShortcuts 25 | { 26 | public: 27 | 28 | /** Singleton. */ 29 | static UIShortcuts& global( void ); 30 | 31 | /** Print all registered shortcuts. */ 32 | void list( void ); 33 | 34 | /** Register a shortcut. 35 | *\param shortcut the shortcut keys 36 | *\param desc the description 37 | */ 38 | void add( const std::string& shortcut, const char* desc ); 39 | 40 | 41 | private: 42 | std::unordered_map _shortcuts; ///< List of shortcuts. 43 | 44 | }; 45 | 46 | 47 | } // namespace sibr 48 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/ViewBase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | # include "core/view/ViewBase.hpp" 15 | 16 | namespace sibr 17 | { 18 | ViewBase::ViewBase(const unsigned int w, const unsigned int h) 19 | { 20 | _resolution = Vector2i(w, h); 21 | _whichRT = 6; // poisson filling 22 | } 23 | 24 | void ViewBase::onUpdate(Input& input, const Viewport & vp) { 25 | onUpdate(input); 26 | } 27 | 28 | void ViewBase::setResolution(const Vector2i& size) 29 | { 30 | _resolution = size; 31 | } 32 | 33 | const Vector2i& ViewBase::getResolution( void ) const 34 | { 35 | return _resolution; 36 | } 37 | 38 | void ViewBase::setFocus(bool focus) 39 | { 40 | _focus = focus; 41 | } 42 | 43 | bool ViewBase::isFocused(void) const 44 | { 45 | return _focus; 46 | } 47 | 48 | void ViewBase::setName(const std::string& name) { 49 | _name = name; 50 | } 51 | 52 | const std::string & ViewBase::name() const { 53 | return _name; 54 | } 55 | 56 | 57 | } // namespace sibr 58 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_colored_mesh.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | uniform vec3 light_position; 18 | uniform vec3 user_color; 19 | uniform float alpha; 20 | uniform bool phong_shading; 21 | uniform bool use_mesh_color; 22 | 23 | in vec3 color; 24 | in vec3 normal; 25 | in vec3 position; 26 | 27 | void main(void) { 28 | 29 | vec3 col; 30 | if(use_mesh_color){ 31 | col = color; 32 | } else { 33 | col = user_color; 34 | } 35 | 36 | out_color = vec4(col, alpha); 37 | 38 | if(phong_shading){ 39 | float kd = 0.2; 40 | float ks = 0.1; 41 | vec3 L = normalize(light_position - position); 42 | vec3 N = normalize(normal); 43 | vec3 R = - reflect(L,N); 44 | vec3 V = L; //light pos = eye 45 | float diffuse = max(0.0, dot(L,N)); 46 | float specular = max(0.0, dot(R,V)); 47 | out_color.xyz = (1.0 - kd - ks)*col + (kd*diffuse + ks*specular)* vec3(1, 1, 1); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_colored_mesh.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | layout(location = 1) in vec3 in_color; 17 | layout(location = 3) in vec3 in_normal; 18 | 19 | uniform mat4 mvp; 20 | 21 | out vec3 color; 22 | out vec3 normal; 23 | out vec3 position; 24 | 25 | void main(void) { 26 | gl_Position = mvp * vec4(in_vertex, 1.0); 27 | color = in_color; 28 | normal = in_normal; 29 | position = in_vertex; 30 | } 31 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_colored_per_triangle_normals.geom: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #version 420 15 | 16 | layout(triangles) in; 17 | layout(line_strip, max_vertices = 2) out; 18 | 19 | uniform mat4 mvp; 20 | uniform float normals_size; 21 | 22 | out vec3 color; 23 | out vec3 normal; 24 | out vec3 position; 25 | 26 | void main(void) { 27 | vec3 a = gl_in[0].gl_Position.xyz; 28 | vec3 b = gl_in[1].gl_Position.xyz; 29 | vec3 c = gl_in[2].gl_Position.xyz; 30 | 31 | vec3 tri_normal = normalize(cross(b-a,c-b)); 32 | vec3 tri_center = (a+b+c)/3.0; 33 | gl_Position = mvp*vec4(tri_center,1.0); 34 | color = vec3(0.0); 35 | normal = vec3(0.0); 36 | position = vec3(0.0); 37 | EmitVertex(); 38 | gl_Position = mvp*vec4(tri_center + normals_size*tri_normal, 1.0); 39 | color = vec3(0.0); 40 | normal = vec3(0.0); 41 | position = vec3(0.0); 42 | EmitVertex(); 43 | EndPrimitive(); 44 | } 45 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_colored_per_triangle_normals.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | 17 | void main(void) { 18 | gl_Position = vec4(in_vertex, 1.0); 19 | } 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_colored_per_vertex_normals.geom: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(points) in; 16 | layout(line_strip, max_vertices = 2) out; 17 | 18 | uniform mat4 mvp; 19 | uniform float normals_size; 20 | 21 | in vec3 normals[]; 22 | 23 | out vec3 color; 24 | out vec3 normal; 25 | out vec3 position; 26 | 27 | 28 | void main(void) { 29 | gl_Position = mvp*(gl_in[0].gl_Position); 30 | color = vec3(0.0); 31 | normal = vec3(0.0); 32 | position = vec3(0.0); 33 | EmitVertex(); 34 | gl_Position = mvp* vec4(gl_in[0].gl_Position.xyz + normals_size*normals[0],1.0); 35 | color = vec3(0.0); 36 | normal = vec3(0.0); 37 | position = vec3(0.0); 38 | EmitVertex(); 39 | EndPrimitive(); 40 | } 41 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_colored_per_vertex_normals.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | layout(location = 3) in vec3 in_normal; 17 | 18 | out vec3 normals; 19 | 20 | void main(void) { 21 | gl_Position = vec4(in_vertex, 1.0); 22 | normals = in_normal; 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_points.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | uniform vec3 user_color; 18 | uniform float alpha; 19 | in vec3 color; 20 | 21 | void main(void) { 22 | // out_color = vec4(user_color, alpha); 23 | out_color = vec4(color, alpha); 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_points.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | layout(location = 1) in vec3 in_color; 17 | 18 | uniform mat4 mvp; 19 | uniform int radius; 20 | out vec3 color; 21 | 22 | void main(void) { 23 | gl_Position = mvp * vec4(in_vertex, 1.0); 24 | gl_PointSize = radius; 25 | color = in_color; 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_uv_tex.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | layout(binding = 0) uniform sampler2D input_rgb; 17 | 18 | in vec2 out_uv; 19 | 20 | uniform float alpha; 21 | 22 | void main() { 23 | out_color = vec4(texture(input_rgb, out_uv).xyz, alpha); 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alpha_uv_tex_array.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | layout(binding = 0) uniform sampler2DArray input_rgbs; 17 | 18 | in vec2 out_uv; 19 | 20 | uniform float alpha; 21 | uniform int slice; 22 | 23 | void main() { 24 | vec3 uv_cam = vec3(out_uv, slice); 25 | out_color = vec4(texture(input_rgbs, uv_cam).xyz, alpha); 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alphaimgview.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(binding = 0) uniform sampler2D tex; 16 | layout(location= 0) out vec4 out_color; 17 | 18 | in vec2 tex_coord; 19 | uniform float alpha; 20 | 21 | void main(void) { 22 | vec2 texcoord = tex_coord ; 23 | out_color = vec4(texture(tex,texcoord).rgb, alpha); 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/alphaimgview.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec2 in_vertex; 16 | layout(location = 1) in vec2 in_texcoord; 17 | 18 | out vec2 tex_coord; 19 | 20 | uniform vec4 imagefit; 21 | 22 | vec2 fitTexcoord( vec2 tc ) { 23 | tc.x = tc.x*imagefit[0] + imagefit[2+0]; 24 | tc.y = tc.y*imagefit[1] + imagefit[2+1]; 25 | return tc; 26 | } 27 | 28 | void main(void) { 29 | gl_Position = vec4(in_vertex, 0.0, 1.0); 30 | tex_coord = fitTexcoord(in_texcoord); 31 | } 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/anaglyph.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(binding = 0) uniform sampler2D left; 16 | layout(binding = 1) uniform sampler2D right; 17 | layout(location= 0) out vec4 out_color; 18 | 19 | in vec2 vertex_coord; 20 | 21 | void main(void) { 22 | vec2 texcoord = (vertex_coord + vec2(1.0)) / 2.0; 23 | vec4 cl = texture(left, texcoord); 24 | vec4 cr = texture(right, texcoord); 25 | out_color = vec4(cl.r, cr.g, cr.b, 1.0); 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/anaglyph.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec2 in_vertex; 16 | 17 | out vec2 vertex_coord; 18 | 19 | void main(void) { 20 | gl_Position = vec4(in_vertex, 0.0, 1.0); 21 | vertex_coord = in_vertex; 22 | } 23 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/axisgizmo.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | in vec3 axis_color; 16 | out vec4 out_color; 17 | 18 | void main(void) { 19 | out_color = vec4(axis_color, 1.0); 20 | } 21 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/axisgizmo.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | layout(location = 1) in vec3 in_color; 19 | 20 | out vec3 axis_color; 21 | 22 | void main(void) { 23 | axis_color = in_color; 24 | gl_Position = MVP * vec4(in_vertex,1.0); 25 | } 26 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/camstub.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform vec3 color; 16 | 17 | out vec4 out_color; 18 | 19 | void main(void) { 20 | out_color = vec4(color, 1.0); 21 | } 22 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/camstub.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | void main(void) { 20 | gl_Position = MVP * vec4(in_vertex,1.0); 21 | } 22 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/depth.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | layout(binding = 0) uniform sampler2D image; /// \todo TODO: remove 17 | 18 | //in vec3 vertex_coord; 19 | //uniform vec3 iCamPos; 20 | 21 | uniform vec2 size; 22 | 23 | void main(void) { 24 | vec2 tC = gl_FragCoord.xy / size; 25 | out_color.xyz = vec3(0.0);//texture(image, tC.xy).xyz; 26 | out_color.w = gl_FragCoord.z; 27 | //out_color.w = distance(vertex_coord, iCamPos); 28 | } 29 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/depth.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 proj; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | //out vec2 texture_coord; 20 | //out vec3 normal_coord; 21 | 22 | void main(void) { 23 | gl_Position = proj * vec4(in_vertex,1.0); 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/depthonly.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out float out_color; 16 | 17 | void main(void) { 18 | out_color = gl_FragCoord.z; 19 | } 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/depthonly.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 proj; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | void main(void) { 20 | gl_Position = proj * vec4(in_vertex,1.0); 21 | } 22 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/image_viewer.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | in vec2 texcoord; 16 | 17 | layout(binding = 0) uniform sampler2D in_texture; 18 | 19 | uniform vec4 minVal = vec4(0.0); 20 | uniform vec4 maxVal = vec4(1.0); 21 | uniform vec4 channels = vec4(1.0); 22 | 23 | layout(location = 0) out vec4 out_color; 24 | 25 | void main(void) 26 | { 27 | if(any(greaterThan(texcoord, vec2(1.0))) || any(lessThan(texcoord, vec2(0.0)))){ 28 | discard; 29 | } 30 | 31 | vec4 col = texture(in_texture, texcoord); 32 | // Rescale. 33 | out_color = channels*(col - minVal)/(maxVal - minVal); 34 | 35 | // If only one channel is enabled, no alpha and B&W image. 36 | if(dot(channels, vec4(1.0)) == 1.0){ 37 | float val = dot(out_color, channels); 38 | out_color.rgb = vec3(val); 39 | out_color.a = 1.0; 40 | } 41 | 42 | // Ensure visibility when alpha is disabled. 43 | if(channels[3] == 0.0f){ 44 | out_color.a; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/image_viewer.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | 17 | uniform float scale; 18 | uniform vec2 pos; 19 | uniform vec2 size; 20 | uniform bool correctRatio; 21 | 22 | out vec2 texcoord; 23 | 24 | void main(void) { 25 | vec2 position = scale * vec2(1.0, correctRatio ? (size.y/size.x) : 1.0) * in_vertex.xy + pos; 26 | gl_Position = vec4(in_vertex.xy, 0.0, 1.0); 27 | texcoord = position * 0.5 + 0.5; 28 | } 29 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/mesh_color.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform vec3 lightDir; 16 | 17 | out vec4 out_color; 18 | 19 | in vec3 color_vert; 20 | in vec3 vertexPos; 21 | in vec3 normalPos; 22 | 23 | void main(void) { 24 | float kd = 0.2; 25 | vec3 normal = normalize(normalPos); 26 | vec3 shading = max(0.0,dot(lightDir,normal))*color_vert; 27 | 28 | out_color = vec4( (1.0-kd)*color_vert + kd*shading, 1.0); 29 | //out_color = vec4( normal , 1.0 ); 30 | } 31 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/mesh_color.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | uniform mat4 invMV; 17 | 18 | layout(location = 0) in vec3 in_vertex; 19 | layout(location = 1) in vec3 in_color; 20 | layout(location = 3) in vec3 in_normal; 21 | 22 | out vec3 color_vert; 23 | out vec3 vertexPos; 24 | out vec3 normalPos; 25 | 26 | void main(void) { 27 | gl_Position = MVP * vec4(in_vertex,1.0); 28 | vertexPos = vec3(MVP * vec4(in_vertex,1.0)); 29 | normalPos = vec3(invMV*vec4(in_normal,1.0)); 30 | 31 | color_vert = in_color; 32 | } 33 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/mesh_debugview.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform vec3 lightDir; 16 | 17 | uniform bool hasNormal = true; 18 | out vec4 out_color; 19 | 20 | in vec3 color_vert; 21 | in vec3 vertexPos; 22 | in vec3 normalPos; 23 | 24 | void main(void) { 25 | float kd = 0.8; 26 | float ks = 0.15; 27 | float diffuse = 1.0; 28 | float specular = 0.0; 29 | 30 | if(hasNormal){ 31 | vec3 L = normalize(lightDir); 32 | vec3 N = normalize(normalPos); 33 | vec3 R = reflect(L,N);//2.0*dot(L,N)*N - N; 34 | vec3 V = L; 35 | diffuse = max(0.0, dot(L,N)); 36 | specular = max(0.0, dot(R,V)); 37 | } 38 | out_color.rgb = (1.0-kd-ks)*color_vert + kd*diffuse*color_vert + ks*specular; 39 | out_color.a = 1.0; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/mesh_debugview.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 MVP; 16 | uniform mat4 invMV; 17 | uniform bool hasColor = true; 18 | uniform vec3 defaultColor = vec3(0.9,0.9,0.9); 19 | 20 | layout(location = 0) in vec3 in_vertex; 21 | layout(location = 1) in vec3 in_color; 22 | layout(location = 3) in vec3 in_normal; 23 | 24 | out vec3 color_vert; 25 | out vec3 vertexPos; 26 | out vec3 normalPos; 27 | 28 | void main(void) { 29 | gl_Position = MVP * vec4(in_vertex,1.0); 30 | vertexPos = vec3(MVP * vec4(in_vertex,1.0)); 31 | normalPos = vec3(vec4(in_normal,1.0)); 32 | 33 | color_vert = hasColor ? in_color : defaultColor; 34 | } 35 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/mesh_normal.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | in vec3 normal_coord; 18 | 19 | void main(void) { 20 | vec3 color = vec3(normalize(normal_coord)); 21 | color = color * 0.5 + 0.5; 22 | out_color = vec4(color, 1.0); 23 | //out_color = vec4(dot(normal_coord, vec3(0.58,-0.58,0.08))); 24 | if (length(normal_coord) == 0.0) { // no normal present 25 | out_color = vec4(0.8); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/mesh_normal.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 proj; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | //layout(location = 1) in vec2 in_texcoord; 19 | layout(location = 1) in vec3 in_normal; 20 | 21 | //out vec2 texture_coord; 22 | out vec3 normal_coord; 23 | 24 | void main(void) { 25 | gl_Position = proj * vec4(in_vertex,1.0); 26 | //texture_coord = in_texcoord; 27 | normal_coord = in_normal; 28 | } 29 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/number.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform vec2 position; 16 | uniform vec2 scale; 17 | uniform int count; 18 | 19 | layout(location = 0) in vec3 in_vertex; 20 | out vec2 uv_coord; 21 | 22 | void main(void) { 23 | uv_coord = vec2(count+0.5, 1.0) * (in_vertex.xy * 0.5 + 0.5); 24 | gl_Position = vec4(scale * vec2(count, 1.0) * (in_vertex.xy - position) + position,0.0, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/skybox.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | 14 | #version 420 15 | 16 | layout(binding = 0) uniform samplerCube in_CubeMap; 17 | layout(location= 0) out vec4 out_Color; 18 | 19 | in VSOUT 20 | { 21 | vec3 tc; 22 | } in_Frag; 23 | 24 | void main(void) 25 | { 26 | out_Color = texture(in_CubeMap, in_Frag.tc); 27 | } 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/text-imgui.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout (location = 0) out vec4 fragColor; 16 | 17 | in INTERFACE { 18 | vec4 col; 19 | vec2 uv; 20 | } In ; 21 | 22 | uniform sampler2D tex; 23 | 24 | void main(){ 25 | fragColor = In.col * texture(tex, In.uv); 26 | } 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/text-imgui.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | // Attributes 16 | layout(location = 0) in vec3 in_vertex; 17 | layout(location = 1) in vec3 in_color; 18 | layout(location = 2) in vec2 in_uv; 19 | //layout(location = 3) in vec3 in_normal; 20 | 21 | // Uniforms 22 | uniform vec3 position = vec3(0.0,0.0,0.0); // Position in NDC space 23 | uniform float scale = 1.0; 24 | uniform vec2 viewport = vec2(1.0); 25 | uniform bool forceOpacity = true; 26 | 27 | out INTERFACE { 28 | vec4 col; 29 | vec2 uv; 30 | } Out ; 31 | 32 | void main(){ 33 | // Should be in -1,1 34 | // Multiply by the w component to stay at a constant screen size. 35 | gl_Position = vec4(position.xy+scale*in_vertex.xy/viewport, 0.0, 1.0); 36 | Out.uv = in_uv; 37 | Out.col = vec4(in_color, forceOpacity ? 1.0 : in_vertex.z); 38 | } 39 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/texture.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(binding = 0) uniform sampler2D tex; 16 | layout(location= 0) out vec4 out_color; 17 | 18 | in vec2 tex_coord; 19 | 20 | void main(void) { 21 | vec2 texcoord = tex_coord ; 22 | out_color = texture(tex,texcoord); 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/texture.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec2 in_vertex; 16 | layout(location = 1) in vec2 in_texcoord; 17 | 18 | out vec2 tex_coord; 19 | 20 | void main(void) { 21 | gl_Position = vec4(in_vertex, 0.0, 1.0); 22 | tex_coord = in_texcoord; 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/topview.fp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /** 14 | * \file topview.fp 15 | * 16 | * Basic shader to render textured/colored geometry 17 | */ 18 | 19 | #version 420 20 | 21 | layout(binding = 0) uniform sampler2D tex;/**< Input texture */ 22 | layout(location= 0) out vec4 out_color; /**< Output texture map */ 23 | 24 | uniform vec4 in_color; /**< Uniform color */ 25 | in vec4 texcoord; /**< Texture coords at current pixel */ 26 | 27 | void main(void) { 28 | vec4 c1 = texture(tex,texcoord.xy); 29 | vec4 c2 = in_color; 30 | out_color = c2.a*in_color + clamp(1.0-c2.a,0.0,1.0)*c1; 31 | } 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/topview.vp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /** \file topview.vp 14 | * 15 | * Vertex shader with projection and modelview transformations 16 | * for rendering top view 17 | */ 18 | 19 | #version 420 20 | 21 | layout(location = 0) in vec4 in_vertex; /**< Input vertex coordinates */ 22 | layout(location = 1) in vec4 in_texcoord; /**< Input texture coordinates */ 23 | 24 | uniform mat4 proj; /**< Projection matrix */ 25 | out vec4 texcoord; /**< Output texture coordinates */ 26 | 27 | void main(void) { 28 | gl_Position = proj * in_vertex; 29 | texcoord = in_texcoord; 30 | } 31 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/shaders/uv_mesh.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | layout(location = 2) in vec2 in_uv; 17 | 18 | out vec2 out_uv; 19 | 20 | uniform mat4 mvp; 21 | 22 | void main() { 23 | out_uv = in_uv; 24 | gl_Position = mvp * vec4(in_vertex, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /SIBR_viewers/src/core/view/sibr_view.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /*! 14 | \defgroup sibr_view sibr_view 15 | 16 | \brief View, camera, high-level rendering utilities. 17 | 18 | */ 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(sibr_basic_all) 13 | 14 | add_subdirectory(apps) 15 | add_subdirectory(renderer) 16 | 17 | include(install_runtime) 18 | subdirectory_target(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR} "projects/basic") 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_basic_apps) 13 | 14 | add_subdirectory(texturedMesh/) 15 | add_subdirectory(pointBased/) 16 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/apps/pointBased/.CMakeLists.txt.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/src/projects/basic/apps/pointBased/.CMakeLists.txt.un~ -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/apps/pointBased/.main.cpp.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/src/projects/basic/apps/pointBased/.main.cpp.un~ -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/apps/pointBased/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_PointBased_app) 13 | 14 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 15 | source_group("Source Files" FILES ${SOURCES}) 16 | 17 | file(GLOB RESOURCES "resources/*.ini") 18 | source_group("Resources Files" FILES ${RESOURCES}) 19 | 20 | add_executable(${PROJECT_NAME} ${SOURCES}) 21 | target_link_libraries(${PROJECT_NAME} 22 | 23 | ${Boost_LIBRARIES} 24 | ${ASSIMP_LIBRARIES} 25 | ${GLEW_LIBRARIES} 26 | ${OPENGL_LIBRARIES} 27 | ${OpenCV_LIBRARIES} 28 | sibr_view 29 | sibr_assets 30 | sibr_basic 31 | ) 32 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/basic/apps") 33 | 34 | ## High level macro to install in an homogen way all our ibr targets 35 | include(install_runtime) 36 | ibr_install_target(${PROJECT_NAME} 37 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 38 | RESOURCES ${RESOURCES} 39 | RSC_FOLDER "basic" 40 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 41 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 42 | ) 43 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/apps/pointBased/CMakeLists.txt~: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_PointBased_app) 13 | 14 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 15 | source_group("Source Files" FILES ${SOURCES}) 16 | 17 | file(GLOB RESOURCES "resources/*.ini") 18 | source_group("Resources Files" FILES ${RESOURCES}) 19 | 20 | add_executable(${PROJECT_NAME} ${SOURCES}) 21 | target_link_libraries(${PROJECT_NAME} 22 | 23 | ${Boost_LIBRARIES} 24 | ${ASSIMP_LIBRARIES} 25 | ${GLEW_LIBRARIES} 26 | ${OPENGL_LIBRARIES} 27 | ${OpenCV_LIBRARIES} 28 | sibr_view 29 | sibr_assets 30 | sibr_ulr 31 | ) 32 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/ulr/apps") 33 | 34 | ## High level macro to install in an homogen way all our ibr targets 35 | include(install_runtime) 36 | ibr_install_target(${PROJECT_NAME} 37 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 38 | RESOURCES ${RESOURCES} 39 | RSC_FOLDER "ulr" 40 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 41 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 42 | ) 43 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/basic/apps/texturedMesh/resources/sibr_texturedMesh_app.ini: -------------------------------------------------------------------------------- 1 | 2 | [Window][Textured Mesh Renderer Settings] 3 | Pos=50,50 4 | Size=350,300 5 | Collapsed=0 6 | 7 | [Window][Camera TM View] 8 | Pos=400,50 9 | Size=550,300 10 | Collapsed=0 11 | 12 | [Window][Top view settings] 13 | Pos=950,50 14 | Size=450,300 15 | Collapsed=0 16 | 17 | [Window][Metrics##0] 18 | Pos=1400,50 19 | Size=450,300 20 | Collapsed=0 21 | 22 | [Window][TM View] 23 | Pos=50,350 24 | Size=900,600 25 | Collapsed=0 26 | 27 | [Window][Top view] 28 | Pos=950,350 29 | Size=900,600 30 | Collapsed=0 31 | 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(sibr_dataset_tools_all) 13 | 14 | add_subdirectory(preprocess) 15 | 16 | include(install_runtime) 17 | subdirectory_target(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR} "projects/dataset_tools") 18 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/documentation/dataset_tools_doc.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | set(PROJECT_PAGE "sibr_projects_dataset_tools") 12 | set(PROJECT_LINK "https://gitlab.inria.fr/sibr/sibr_core") 13 | set(PROJECT_TYPE "SAMPLES") 14 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/documentation/img/colmapfullpipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/src/projects/dataset_tools/documentation/img/colmapfullpipeline.png -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_dataset_tools_preprocess) 13 | 14 | add_subdirectory(alignMeshes) 15 | add_subdirectory(cameraConverter) 16 | add_subdirectory(clippingPlanes) 17 | add_subdirectory(converters) 18 | add_subdirectory(cropFromCenter) 19 | add_subdirectory(distordCrop) 20 | add_subdirectory(fullColmapProcess) 21 | add_subdirectory(meshroomPythonScripts) 22 | add_subdirectory(nvmToSIBR) 23 | add_subdirectory(textureMesh) 24 | add_subdirectory(tonemapper) 25 | add_subdirectory(unwrapMesh) 26 | add_subdirectory(utils) 27 | add_subdirectory(prepareColmap4Sibr) 28 | add_subdirectory(realityCaptureTools) 29 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/alignMeshes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | # project name 12 | project(alignMeshes) 13 | 14 | # Define build output for project 15 | add_executable(${PROJECT_NAME} main.cpp) 16 | 17 | target_link_libraries(${PROJECT_NAME} 18 | ${Boost_LIBRARIES} 19 | OpenMP::OpenMP_CXX 20 | sibr_assets 21 | sibr_system 22 | sibr_graphics 23 | sibr_renderer 24 | ) 25 | 26 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 27 | 28 | ## High level macro to install in an homogen way all our ibr targets 29 | include(install_runtime) 30 | ibr_install_target(${PROJECT_NAME} 31 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 32 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 33 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 34 | ) 35 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/cameraConverter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(cameraConverter) 12 | 13 | # Define build output for project 14 | add_executable(${PROJECT_NAME} main.cpp) 15 | 16 | target_link_libraries(${PROJECT_NAME} 17 | ${Boost_LIBRARIES} 18 | sibr_system 19 | sibr_assets 20 | sibr_graphics 21 | ) 22 | 23 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 24 | 25 | ## High level macro to install in an homogen way all our ibr targets 26 | include(install_runtime) 27 | ibr_install_target(${PROJECT_NAME} 28 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 29 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 30 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 31 | ) 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/clippingPlanes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(clippingPlanes) 12 | 13 | # libraries used: 14 | # * sibr graphics (vector2i class) 15 | # * sibr system (programArg class) 16 | # * boost filesystem (path class) 17 | # * openmp 18 | 19 | # Define build output for project 20 | add_executable(${PROJECT_NAME} main.cpp) 21 | 22 | target_link_libraries(${PROJECT_NAME} 23 | ${Boost_LIBRARIES} 24 | sibr_graphics 25 | sibr_assets 26 | sibr_raycaster 27 | sibr_system 28 | ) 29 | 30 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 31 | 32 | ## High level macro to install in an homogen way all our ibr targets 33 | include(install_runtime) 34 | ibr_install_target(${PROJECT_NAME} 35 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 36 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 37 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 38 | ) 39 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/converters/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(dataset_tools_converters) 12 | 13 | file(GLOB_RECURSE SCRIPTS "*.py" "*.sh" "*.mlx") 14 | 15 | add_custom_target(${PROJECT_NAME} ALL) 16 | 17 | include(install_runtime) 18 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 19 | ibr_install_rsc(${PROJECT_NAME} TYPE "scripts" FILES ${SCRIPTS} RELATIVE) 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/converters/meshlab/wedge_to_vertex_uvs.mlx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/cropFromCenter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(cropFromCenter) 12 | 13 | # libraries used: 14 | # * sibr graphics (vector2i class) 15 | # * sibr system (programArg class) 16 | # * boost filesystem (path class) 17 | # * openmp 18 | 19 | # Define build output for project 20 | add_executable(${PROJECT_NAME} main.cpp) 21 | 22 | target_link_libraries(${PROJECT_NAME} 23 | ${Boost_LIBRARIES} 24 | OpenMP::OpenMP_CXX 25 | sibr_system 26 | sibr_graphics 27 | sibr_imgproc 28 | ) 29 | 30 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 31 | 32 | ## High level macro to install in an homogen way all our ibr targets 33 | include(install_runtime) 34 | ibr_install_target(${PROJECT_NAME} 35 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 36 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 37 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 38 | ) 39 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/distordCrop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | # project name 12 | project(distordCrop) 13 | 14 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 15 | 16 | # Define build output for project 17 | add_executable(${PROJECT_NAME} ${SOURCES}) 18 | 19 | target_link_libraries(${PROJECT_NAME} 20 | ${Boost_LIBRARIES} 21 | OpenMP::OpenMP_CXX 22 | sibr_system 23 | sibr_graphics 24 | sibr_imgproc 25 | ) 26 | 27 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 28 | if (WIN32) 29 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") 30 | endif() 31 | 32 | 33 | ## High level macro to install in an homogen way all our ibr targets 34 | include(install_runtime) 35 | ibr_install_target(${PROJECT_NAME} 36 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 37 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 38 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 39 | ) 40 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/fullColmapProcess/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(fullColmapProcess) 12 | 13 | file(GLOB SCRIPTS "*.py" "*.json") 14 | 15 | add_custom_target(${PROJECT_NAME} ALL) 16 | 17 | include(install_runtime) 18 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 19 | ibr_install_rsc(${PROJECT_NAME} TYPE "scripts" FILES ${SCRIPTS}) 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/meshroomPythonScripts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(meshroomPythonScripts) 12 | 13 | file(GLOB SCRIPTS "*.py") 14 | 15 | add_custom_target(${PROJECT_NAME} ALL) 16 | 17 | include(install_runtime) 18 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 19 | ibr_install_rsc(${PROJECT_NAME} TYPE "scripts" FILES ${SCRIPTS}) 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/nvmToSIBR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(nvmToSIBR) 12 | 13 | # Define build output for project 14 | add_executable(${PROJECT_NAME} main.cpp) 15 | 16 | target_link_libraries(${PROJECT_NAME} 17 | ${Boost_LIBRARIES} 18 | sibr_graphics 19 | sibr_assets 20 | sibr_raycaster 21 | sibr_system 22 | sibr_view 23 | ) 24 | 25 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 26 | 27 | ## High level macro to install in an homogen way all our ibr targets 28 | include(install_runtime) 29 | ibr_install_target(${PROJECT_NAME} 30 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 31 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 32 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 33 | ) 34 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/prepareColmap4Sibr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(prepareColmap4Sibr) 12 | 13 | # Define build output for project 14 | add_executable(${PROJECT_NAME} main.cpp) 15 | 16 | target_link_libraries(${PROJECT_NAME} 17 | ${Boost_LIBRARIES} 18 | sibr_graphics 19 | sibr_assets 20 | sibr_raycaster 21 | sibr_system 22 | sibr_view 23 | ) 24 | 25 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 26 | 27 | ## High level macro to install in an homogen way all our ibr targets 28 | include(install_runtime) 29 | ibr_install_target(${PROJECT_NAME} 30 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 31 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 32 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 33 | ) 34 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/realityCaptureTools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(realityCaptureTools) 12 | 13 | file(GLOB SCRIPTS "*.py" "*.json" ".bat" ".xml") 14 | 15 | add_custom_target(${PROJECT_NAME} ALL) 16 | 17 | include(install_runtime) 18 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 19 | ibr_install_rsc(${PROJECT_NAME} TYPE "scripts" FILES ${SCRIPTS}) 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/realityCaptureTools/SetVariables.bat: -------------------------------------------------------------------------------- 1 | ::CapturingReality 2 | :: switch off console output 3 | ::@echo off 4 | 5 | 6 | :: root path to work folders where the dataset is stored 7 | set RootFolder=E:\datasets\Yorgos\Reflections\KitchenRCTest\ 8 | set Video="%RootFolder%\videos\MVI_3030.MP4" 9 | set FPS=0.2 10 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/realityCaptureTools/fixup.bat: -------------------------------------------------------------------------------- 1 | ::CapturingReality 2 | 3 | :: switch off console output 4 | ::@echo off 5 | @echo on 6 | set RootFolder=%1 7 | 8 | :: path to RealityCapture application 9 | set RealityCaptureExe="C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe" 10 | 11 | :: variable storing path to images for texturing model 12 | set Project="%RootFolder%\rcProj\RCproject.rcproj" 13 | 14 | :: run RealityCapture 15 | :: test and fix video import when RC working again 16 | 17 | %RealityCaptureExe% -load %Project% ^ 18 | -selectAllImages ^ 19 | -enableAlignment false ^ 20 | -selectImage *test_* ^ 21 | -enableAlignment true ^ 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/textureMesh/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(textureMesh) 12 | 13 | # Define build output for project 14 | add_executable(${PROJECT_NAME} main.cpp) 15 | 16 | target_link_libraries(${PROJECT_NAME} 17 | ${Boost_LIBRARIES} 18 | sibr_system 19 | sibr_assets 20 | sibr_graphics 21 | sibr_raycaster 22 | sibr_imgproc 23 | sibr_view 24 | ) 25 | 26 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 27 | 28 | ## High level macro to install in an homogen way all our ibr targets 29 | include(install_runtime) 30 | ibr_install_target(${PROJECT_NAME} 31 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 32 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 33 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 34 | ) 35 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/tonemapper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(tonemapper) 12 | 13 | # Define build output for project 14 | add_executable(${PROJECT_NAME} main.cpp) 15 | 16 | target_link_libraries(${PROJECT_NAME} 17 | ${Boost_LIBRARIES} 18 | sibr_system 19 | sibr_assets 20 | sibr_graphics 21 | sibr_imgproc 22 | ) 23 | 24 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 25 | 26 | ## High level macro to install in an homogen way all our ibr targets 27 | include(install_runtime) 28 | ibr_install_target(${PROJECT_NAME} 29 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 30 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 31 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 32 | ) 33 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/unwrapMesh/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(unwrapMesh) 12 | 13 | # Define build output for project 14 | add_executable(${PROJECT_NAME} main.cpp) 15 | 16 | target_link_libraries(${PROJECT_NAME} 17 | ${Boost_LIBRARIES} 18 | sibr_system 19 | sibr_assets 20 | sibr_graphics 21 | ) 22 | 23 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 24 | 25 | ## High level macro to install in an homogen way all our ibr targets 26 | include(install_runtime) 27 | ibr_install_target(${PROJECT_NAME} 28 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 29 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 30 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 31 | ) 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | project(dataset_tools_utils) 12 | 13 | file(GLOB SCRIPTS "*.py") 14 | 15 | add_custom_target(${PROJECT_NAME} ALL) 16 | 17 | include(install_runtime) 18 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/dataset_tools/preprocess") 19 | ibr_install_rsc(${PROJECT_NAME} TYPE "scripts" FOLDER "utils" FILES ${SCRIPTS}) 20 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/utils/color.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | import os 12 | os.system("color") 13 | 14 | COLOR = { 15 | "HEADER": "\033[95m", 16 | "BLUE": "\033[94m", 17 | "GREEN": "\033[92m", 18 | "RED": "\033[91m", 19 | "ENDC": "\033[0m", 20 | } 21 | 22 | #print(COLOR["GREEN"], "Testing Green!!", COLOR["ENDC"]) 23 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/utils/convert.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | #!/usr/bin/env python 12 | #! -*- encoding: utf-8 -*- 13 | 14 | import os 15 | import re 16 | 17 | def updateStringFromDict(string, map, format='${%s}', fix_paths=True): 18 | newstring = string 19 | 20 | for keyword, value in map.items(): 21 | newstring = newstring.replace(format % keyword, str(value)) 22 | # if it's a path, get absolute path 23 | if fix_paths and re.match(r"^(?:\w:[\\\/]*|[@A-Za-z_.0-9-]*[\\\/]+|\.{1,2}[\\\/])(?:[\\\/]|[@A-Za-z_.0-9-]+)*$", newstring): 24 | newstring = os.path.abspath(newstring) 25 | 26 | return newstring 27 | 28 | def fixMeshEol(meshPath, newMeshPath): 29 | with open(meshPath,"rb") as meshFile, open(newMeshPath, "wb") as newMeshFile: 30 | meshBytes = meshFile.read() 31 | endBytes = b"end_header" 32 | badEol = b"\r\n" 33 | newEol = b"\n" 34 | 35 | index = meshBytes.find(endBytes) + len(endBytes) + len(badEol) 36 | 37 | newMeshBytes = meshBytes[0:index].replace(badEol, newEol) 38 | newMeshBytes += meshBytes[index:] 39 | 40 | newMeshFile.write(newMeshBytes) -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/utils/datasets.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | #!/usr/bin/env python 12 | #! -*- encoding: utf-8 -*- 13 | 14 | import os 15 | from enum import Enum, unique 16 | 17 | @unique 18 | class DatasetType(Enum): 19 | SIBR = 'sibr' 20 | COLMAP = 'colmap' 21 | CAPREAL = 'capreal' 22 | 23 | datasetStructure = { 24 | "colmap": [ "colmap", "colmap/stereo", "colmap/sparse" ], 25 | "capreal": [ "capreal", "capreal/undistorted" ], 26 | "sibr": [ "cameras", "images", "meshes" ] 27 | } 28 | 29 | def buildDatasetStructure(path, types): 30 | for folder in [folder for type in types for folder in datasetStructure[type]]: 31 | new_folder = os.path.abspath(os.path.join(path, folder)) 32 | print("Creating folder %s..." % new_folder) 33 | os.makedirs(new_folder, exist_ok=True) -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/dataset_tools/preprocess/utils/paths.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | #!/usr/bin/env python 12 | #! -*- encoding: utf-8 -*- 13 | 14 | import os 15 | 16 | def getBinariesPath(): 17 | if os.path.exists(os.path.join(os.path.dirname(__file__), "../../bin")): 18 | return os.path.abspath(os.path.join(os.path.dirname(__file__), "../../bin")) 19 | else: 20 | return os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../../../install/bin")) 21 | 22 | def getColmapPath(): 23 | return os.environ['COLMAP_PATH'] if 'COLMAP_PATH' in os.environ else ("C:\\Program Files\\Colmap" if os.name == 'nt' else '') 24 | 25 | def getMeshlabPath(): 26 | return os.environ['MESHLAB_PATH'] if 'MESHLAB_PATH' in os.environ else ("C:\\Program Files\\VCG\\Meshlab" if os.name == 'nt' else '') 27 | 28 | def getRCPath(): 29 | return os.environ['RC_PATH'] if 'RC_PATH' in os.environ else "C:\\Program Files\\Capturing Reality\\RealityCapture\\" 30 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/gaussianviewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | project(sibr_gaussian_all) 11 | 12 | add_subdirectory(apps) 13 | add_subdirectory(renderer) 14 | 15 | include(install_runtime) 16 | subdirectory_target(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR} "projects/gaussian") 17 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/gaussianviewer/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_gaussian_apps) 13 | 14 | add_subdirectory(gaussianViewer/) -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/gaussianviewer/renderer/GaussianView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/SIBR_viewers/src/projects/gaussianviewer/renderer/GaussianView.cpp -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/gaussianviewer/renderer/shaders/copy.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 450 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | layout(std430, binding = 0) buffer colorLayout 18 | { 19 | float data[]; 20 | } source; 21 | 22 | uniform bool flip = false; 23 | uniform int width = 1000; 24 | uniform int height = 800; 25 | 26 | in vec4 texcoord; 27 | 28 | void main(void) 29 | { 30 | int x = int(texcoord.x * width); 31 | int y; 32 | 33 | if(flip) 34 | y = height - 1 - int(texcoord.y * height); 35 | else 36 | y = int(texcoord.y * height); 37 | 38 | float r = source.data[0 * width * height + (y * width + x)]; 39 | float g = source.data[1 * width * height + (y * width + x)]; 40 | float b = source.data[2 * width * height + (y * width + x)]; 41 | vec4 color = vec4(r, g, b, 1); 42 | out_color = color; 43 | } 44 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/gaussianviewer/renderer/shaders/copy.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | /** \file ibr.vp 14 | * 15 | * Vertex shader WITHOUT projection and modelview transformations. 16 | */ 17 | 18 | #version 450 19 | 20 | layout(location = 0) in vec4 in_vertex; /**< Input vertex coordinates */ 21 | layout(location = 1) in vec4 in_texcoord; /**< Input texture coordinates */ 22 | layout(location = 2) in vec4 in_color; /**< Input colour value */ 23 | 24 | out vec4 texcoord; /**< Output texture coordinates */ 25 | out vec4 color; /**< Output color value */ 26 | 27 | void main(void) { 28 | gl_Position = in_vertex; 29 | texcoord = in_texcoord; 30 | color = in_color; 31 | } 32 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/remote/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | project(sibr_remote_all) 11 | 12 | add_subdirectory(apps) 13 | add_subdirectory(renderer) 14 | 15 | include(install_runtime) 16 | subdirectory_target(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR} "projects/remote") 17 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/remote/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_remote_apps) 13 | 14 | add_subdirectory(remoteGaussianUI/) -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/trackChanges.sh: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | for d in */ ; do cd "$d"; echo "$d"; git status --porcelain ; cd ..; done 12 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(sibr_ulr_all) 13 | 14 | add_subdirectory(apps) 15 | add_subdirectory(renderer) 16 | 17 | include(install_runtime) 18 | subdirectory_target(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR} "projects/ulr") 19 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_ulr_apps) 13 | 14 | add_subdirectory(ulr/) 15 | add_subdirectory(ulrv2/) 16 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/apps/ulr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | 12 | project(SIBR_ulr_app) 13 | 14 | file(GLOB SOURCES "*.cpp" "*.h" "*.hpp") 15 | source_group("Source Files" FILES ${SOURCES}) 16 | 17 | file(GLOB RESOURCES "resources/*.ini") 18 | source_group("Resources Files" FILES ${RESOURCES}) 19 | 20 | add_executable(${PROJECT_NAME} ${SOURCES}) 21 | target_link_libraries(${PROJECT_NAME} 22 | 23 | ${Boost_LIBRARIES} 24 | ${ASSIMP_LIBRARIES} 25 | ${GLEW_LIBRARIES} 26 | ${OPENGL_LIBRARIES} 27 | ${OpenCV_LIBRARIES} 28 | sibr_view 29 | sibr_assets 30 | sibr_ulr 31 | sibr_graphics 32 | ) 33 | set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "projects/ulr/apps") 34 | 35 | ## High level macro to install in an homogen way all our ibr targets 36 | include(install_runtime) 37 | ibr_install_target(${PROJECT_NAME} 38 | INSTALL_PDB ## mean install also MSVC IDE *.pdb file (DEST according to target type) 39 | RESOURCES ${RESOURCES} 40 | RSC_FOLDER "ulr" 41 | STANDALONE ${INSTALL_STANDALONE} ## mean call install_runtime with bundle dependencies resolution 42 | COMPONENT ${PROJECT_NAME}_install ## will create custom target to install only this project 43 | ) 44 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/apps/ulr/resources/sibr_ulr_app.ini: -------------------------------------------------------------------------------- 1 | 2 | [Window][Camera ULR view] 3 | Pos=50,50 4 | Size=900,300 5 | Collapsed=0 6 | 7 | [Window][Top view settings] 8 | Pos=950,50 9 | Size=450,300 10 | Collapsed=0 11 | 12 | [Window][Metrics##0] 13 | Pos=1400,50 14 | Size=450,300 15 | Collapsed=0 16 | 17 | [Window][ULR view] 18 | Pos=50,350 19 | Size=900,600 20 | Collapsed=0 21 | 22 | [Window][Top view] 23 | Pos=950,350 24 | Size=900,600 25 | Collapsed=0 26 | 27 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/apps/ulrv2/resources/sibr_ulrv2_app.ini: -------------------------------------------------------------------------------- 1 | 2 | [Window][ULRV2 Settings (ULR view)] 3 | Pos=50,50 4 | Size=350,300 5 | Collapsed=0 6 | 7 | [Window][ULRV3 Settings (ULR view)] 8 | Pos=50,50 9 | Size=350,300 10 | Collapsed=0 11 | 12 | [Window][Camera ULR view] 13 | Pos=400,50 14 | Size=550,300 15 | Collapsed=0 16 | 17 | [Window][Top view settings] 18 | Pos=950,50 19 | Size=450,300 20 | Collapsed=0 21 | 22 | [Window][Metrics##0] 23 | Pos=1400,50 24 | Size=450,300 25 | Collapsed=0 26 | 27 | [Window][ULR view] 28 | Pos=50,350 29 | Size=900,600 30 | Collapsed=0 31 | 32 | [Window][Top view] 33 | Pos=950,350 34 | Size=900,600 35 | Collapsed=0 36 | 37 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/documentation/ulr_doc.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020, Inria 2 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 3 | # All rights reserved. 4 | # 5 | # This software is free for non-commercial, research and evaluation use 6 | # under the terms of the LICENSE.md file. 7 | # 8 | # For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 9 | 10 | 11 | set(PROJECT_PAGE "ulrPage") 12 | set(PROJECT_LINK "https://gitlab.inria.fr/sibr/sibr_core") 13 | set(PROJECT_TYPE "SAMPLES") -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/renderer/shaders/ulr.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) in vec3 in_vertex; 16 | layout(location = 2) in vec3 in_normal; 17 | 18 | out vec3 vertex_coord; 19 | 20 | void main(void) { 21 | gl_Position = vec4(in_vertex,1.0); 22 | vertex_coord = in_vertex; 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/renderer/shaders/ulr_intersect.frag: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | layout(location = 0) out vec4 out_color; 16 | 17 | in vec3 vertex_coord; 18 | 19 | void main(void) { 20 | out_color = vec4(vertex_coord, gl_FragCoord.z); 21 | } 22 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/renderer/shaders/ulr_intersect.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | uniform mat4 proj; 16 | 17 | layout(location = 0) in vec3 in_vertex; 18 | 19 | out vec3 vertex_coord; 20 | 21 | void main(void) { 22 | gl_Position = proj * vec4(in_vertex,1.0); 23 | vertex_coord = in_vertex; 24 | } 25 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/renderer/shaders/ulr_v2.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | 16 | layout(location = 0) in vec3 in_vertex; 17 | 18 | out vec2 vertex_coord; 19 | 20 | void main(void) { 21 | gl_Position = vec4(in_vertex,1.0); 22 | vertex_coord = in_vertex.xy * 0.5 + 0.5; 23 | } 24 | -------------------------------------------------------------------------------- /SIBR_viewers/src/projects/ulr/renderer/shaders/ulr_v3.vert: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Inria 3 | * GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | * All rights reserved. 5 | * 6 | * This software is free for non-commercial, research and evaluation use 7 | * under the terms of the LICENSE.md file. 8 | * 9 | * For inquiries contact sibr@inria.fr and/or George.Drettakis@inria.fr 10 | */ 11 | 12 | 13 | #version 420 14 | 15 | 16 | layout(location = 0) in vec3 in_vertex; 17 | 18 | out vec2 vertex_coord; 19 | 20 | void main(void) { 21 | gl_Position = vec4(in_vertex,1.0); 22 | vertex_coord = in_vertex.xy * 0.5 + 0.5; 23 | } 24 | -------------------------------------------------------------------------------- /assets/pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/assets/pipeline.png -------------------------------------------------------------------------------- /assets/teaser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/assets/teaser.png -------------------------------------------------------------------------------- /config/our_2d/large_scene/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenRobotLab/HorizonGS/d50221298567393b808738ec3b907cadf7880a2b/config/our_2d/large_scene/.DS_Store -------------------------------------------------------------------------------- /config/our_2d/large_scene/block_A/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "SH2", 8 | feat_dim: 32, 9 | view_dim: 0, 10 | appearance_dim: 0, 11 | n_offsets: 5, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/matrixcity/small_city/merge/pose/block_A", 17 | pp_opt_yaml_path: "config/base/large_scene", 18 | dataset_name: "matrix_city_2d", 19 | scene_name: "block_A", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | 29 | data_format: "blender", #blender 30 | add_mask: True, 31 | add_depth: False, 32 | add_aerial: True, 33 | add_street: True, 34 | scale: 0.25, 35 | center: [0,0,0], 36 | 37 | aerial_lod: "multi", 38 | street_lod: "multi", 39 | dist_ratio: 0.999, 40 | 41 | xyz_plane: [1, 1, 0], 42 | partition: True, 43 | n_width: 4, 44 | n_height: 2, 45 | partition_type: "num", # options: size / num 46 | overlap_area: 0.2, 47 | visible_rate: 0.25, 48 | } 49 | -------------------------------------------------------------------------------- /config/our_2d/matrix_city/block_A/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/matrixcity/small_city/merge/pose/block_A", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "matrix_city_2d", 19 | scene_name: "block_A", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "blender", #blender 29 | add_mask: True, 30 | add_depth: False, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/our_2d/matrix_city/block_small/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/matrixcity/small_city/merge/pose/block_small", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "matrix_city_2d", 19 | scene_name: "block_small", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "blender", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/our_2d/ucgs/nyc/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/uc-gs/NYC", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "ucgs_2d", 19 | scene_name: "nyc", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "ucgs", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/our_2d/ucgs/sf/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/uc-gs/SF", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "ucgs_2d", 19 | scene_name: "sf", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "ucgs", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/real/park/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/real/park", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "real/park", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "colmap", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | llffhold: 32, 38 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/real/road/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/real/road", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "real/road", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "colmap", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | llffhold: 32, 38 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/synthetic/citysample/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/citysample", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "synthetic/citysample", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/synthetic/colosseum/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/colosseum", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "synthetic/colosseum", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/synthetic/elvenruin/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/elvenruin", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "synthetic/elvenruin", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/synthetic/hillside_morning/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/hillside_morning", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "synthetic/hillside_morning", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/our_2d/urbangs/synthetic/hillside_summer/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "2D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/hillside_summer", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs_2d", 19 | scene_name: "synthetic/hillside_summer", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/ours/large_scene/block_A/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "SH2", 8 | feat_dim: 32, 9 | view_dim: 0, 10 | appearance_dim: 0, 11 | n_offsets: 5, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/matrixcity/small_city/merge/pose/block_A", 17 | pp_opt_yaml_path: "config/base/large_scene", 18 | dataset_name: "matrix_city", 19 | scene_name: "block_A", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | 29 | data_format: "blender", #blender 30 | add_mask: True, 31 | add_depth: True, 32 | add_aerial: True, 33 | add_street: True, 34 | scale: 0.25, 35 | center: [0,0,0], 36 | 37 | aerial_lod: "multi", 38 | street_lod: "multi", 39 | dist_ratio: 0.999, 40 | 41 | xyz_plane: [1, 1, 0], 42 | partition: True, 43 | n_width: 4, 44 | n_height: 2, 45 | partition_type: "num", # options: size / num 46 | overlap_area: 0.2, 47 | visible_rate: 0.25, 48 | } 49 | -------------------------------------------------------------------------------- /config/ours/matrix_city/block_A/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/matrixcity/small_city/merge/pose/block_A", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "matrix_city", 19 | scene_name: "block_A", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "blender", #blender 29 | add_mask: True, 30 | add_depth: False, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/ours/matrix_city/block_small/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/matrixcity/small_city/merge/pose/block_small", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "matrix_city", 19 | scene_name: "block_small", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "blender", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/ours/ucgs/nyc/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/uc-gs/NYC", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "ucgs", 19 | scene_name: "nyc", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "ucgs", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/ours/ucgs/sf/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/uc-gs/SF", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "ucgs", 19 | scene_name: "sf", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "ucgs", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0] 39 | } -------------------------------------------------------------------------------- /config/ours/urbangs/real/park/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/real/park", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "real/park", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "colmap", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | llffhold: 32, 38 | } -------------------------------------------------------------------------------- /config/ours/urbangs/real/road/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/real/road", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "real/road", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "colmap", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | llffhold: 32, 38 | } -------------------------------------------------------------------------------- /config/ours/urbangs/synthetic/citysample/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/citysample", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "synthetic/citysample", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/ours/urbangs/synthetic/colosseum/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/colosseum", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "synthetic/colosseum", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/ours/urbangs/synthetic/elvenruin/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/elvenruin", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "synthetic/elvenruin", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/ours/urbangs/synthetic/hillside_morning/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/hillside_morning", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "synthetic/hillside_morning", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /config/ours/urbangs/synthetic/hillside_summer/config.yaml: -------------------------------------------------------------------------------- 1 | data_params: { 2 | model_config: { 3 | name: "GaussianLoDModel", 4 | kwargs: { 5 | fork: 2, 6 | gs_attr: "3D", 7 | color_attr: "RGB", 8 | feat_dim: 32, 9 | view_dim: 3, 10 | appearance_dim: 0, 11 | n_offsets: 10, 12 | voxel_size: 0.001, 13 | render_mode: "RGB+ED", 14 | } 15 | }, 16 | source_path: "data/synthetic/hillside_summer", 17 | pp_opt_yaml_path: "config/base/small_scene", 18 | dataset_name: "horizongs", 19 | scene_name: "synthetic/hillside_summer", 20 | images: "images", 21 | resolution: -1, 22 | white_background: False, 23 | random_background: False, 24 | resolution_scales: [1.0], 25 | data_device: "cpu", 26 | eval: True, 27 | ratio: 1, 28 | data_format: "city", #blender 29 | add_mask: True, 30 | add_depth: True, 31 | add_aerial: True, 32 | add_street: True, 33 | aerial_lod: "multi", 34 | street_lod: "multi", 35 | dist_ratio: 0.999, 36 | partition: False, 37 | scale: 0.25, 38 | center: [0,0,0], 39 | llffhold: 32, 40 | } -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: horizon_gs 2 | channels: 3 | - pytorch 4 | - pyg 5 | - conda-forge 6 | - defaults 7 | dependencies: 8 | - cudatoolkit=11.8 9 | - python=3.8.19 10 | - pip=24.2 11 | - pytorch=2.1.2 12 | - torchaudio=2.1.2 13 | - torchvision=0.16.2 14 | - pytorch-scatter 15 | - pip: 16 | - plyfile 17 | - tensorboard 18 | - tqdm 19 | - einops 20 | - wandb 21 | - lpips 22 | - laspy 23 | - jaxtyping 24 | - colorama 25 | - opencv-python 26 | - scikit-learn 27 | - git+https://github.com/tongji-rkr/gsplat-2dgs.git 28 | -------------------------------------------------------------------------------- /gaussian_renderer/__init__.py: -------------------------------------------------------------------------------- 1 | from gaussian_renderer.render import render -------------------------------------------------------------------------------- /lpipsPyTorch/__init__.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from .modules.lpips import LPIPS 4 | 5 | 6 | def lpips(x: torch.Tensor, 7 | y: torch.Tensor, 8 | net_type: str = 'alex', 9 | version: str = '0.1'): 10 | r"""Function that measures 11 | Learned Perceptual Image Patch Similarity (LPIPS). 12 | 13 | Arguments: 14 | x, y (torch.Tensor): the input tensors to compare. 15 | net_type (str): the network type to compare the features: 16 | 'alex' | 'squeeze' | 'vgg'. Default: 'alex'. 17 | version (str): the version of LPIPS. Default: 0.1. 18 | """ 19 | device = x.device 20 | criterion = LPIPS(net_type, version).to(device) 21 | return criterion(x, y) 22 | -------------------------------------------------------------------------------- /lpipsPyTorch/modules/lpips.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | 4 | from .networks import get_network, LinLayers 5 | from .utils import get_state_dict 6 | 7 | 8 | class LPIPS(nn.Module): 9 | r"""Creates a criterion that measures 10 | Learned Perceptual Image Patch Similarity (LPIPS). 11 | 12 | Arguments: 13 | net_type (str): the network type to compare the features: 14 | 'alex' | 'squeeze' | 'vgg'. Default: 'alex'. 15 | version (str): the version of LPIPS. Default: 0.1. 16 | """ 17 | def __init__(self, net_type: str = 'alex', version: str = '0.1'): 18 | 19 | assert version in ['0.1'], 'v0.1 is only supported now' 20 | 21 | super(LPIPS, self).__init__() 22 | 23 | # pretrained network 24 | self.net = get_network(net_type) 25 | 26 | # linear layers 27 | self.lin = LinLayers(self.net.n_channels_list) 28 | self.lin.load_state_dict(get_state_dict(net_type, version)) 29 | 30 | def forward(self, x: torch.Tensor, y: torch.Tensor): 31 | feat_x, feat_y = self.net(x), self.net(y) 32 | 33 | diff = [(fx - fy) ** 2 for fx, fy in zip(feat_x, feat_y)] 34 | res = [l(d).mean((2, 3), True) for d, l in zip(diff, self.lin)] 35 | 36 | return torch.sum(torch.cat(res, 0), 0, True) 37 | -------------------------------------------------------------------------------- /lpipsPyTorch/modules/utils.py: -------------------------------------------------------------------------------- 1 | from collections import OrderedDict 2 | 3 | import torch 4 | 5 | 6 | def normalize_activation(x, eps=1e-10): 7 | norm_factor = torch.sqrt(torch.sum(x ** 2, dim=1, keepdim=True)) 8 | return x / (norm_factor + eps) 9 | 10 | 11 | def get_state_dict(net_type: str = 'alex', version: str = '0.1'): 12 | # build url 13 | url = 'https://raw.githubusercontent.com/richzhang/PerceptualSimilarity/' \ 14 | + f'master/lpips/weights/v{version}/{net_type}.pth' 15 | 16 | # download 17 | old_state_dict = torch.hub.load_state_dict_from_url( 18 | url, progress=True, 19 | map_location=None if torch.cuda.is_available() else torch.device('cpu') 20 | ) 21 | 22 | # rename keys 23 | new_state_dict = OrderedDict() 24 | for key, val in old_state_dict.items(): 25 | new_key = key 26 | new_key = new_key.replace('lin', '') 27 | new_key = new_key.replace('model.', '') 28 | new_state_dict[new_key] = val 29 | 30 | return new_state_dict 31 | -------------------------------------------------------------------------------- /utils/image_utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023, Inria 3 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | # All rights reserved. 5 | # 6 | # This software is free for non-commercial, research and evaluation use 7 | # under the terms of the LICENSE.md file. 8 | # 9 | # For inquiries contact george.drettakis@inria.fr 10 | # 11 | 12 | import torch 13 | from PIL import Image 14 | 15 | def mse(img1, img2): 16 | return (((img1 - img2)) ** 2).view(img1.shape[0], -1).mean(1, keepdim=True) 17 | 18 | def psnr(img1, img2): 19 | mse = (((img1 - img2)) ** 2).view(img1.shape[0], -1).mean(1, keepdim=True) 20 | return 20 * torch.log10(1.0 / torch.sqrt(mse)) 21 | 22 | def save_rgba(img, save_path): 23 | img = (img * 255).byte() 24 | img = img.permute(1, 2, 0).detach().cpu().numpy() 25 | img = Image.fromarray(img, 'RGBA') 26 | img.save(save_path) -------------------------------------------------------------------------------- /utils/system_utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023, Inria 3 | # GRAPHDECO research group, https://team.inria.fr/graphdeco 4 | # All rights reserved. 5 | # 6 | # This software is free for non-commercial, research and evaluation use 7 | # under the terms of the LICENSE.md file. 8 | # 9 | # For inquiries contact george.drettakis@inria.fr 10 | # 11 | 12 | from errno import EEXIST 13 | from os import makedirs, path 14 | import os 15 | 16 | def mkdir_p(folder_path): 17 | # Creates a directory. equivalent to using mkdir -p on the command line 18 | try: 19 | makedirs(folder_path) 20 | except OSError as exc: # Python >2.5 21 | if exc.errno == EEXIST and path.isdir(folder_path): 22 | pass 23 | else: 24 | raise 25 | 26 | def searchForMaxIteration(folder): 27 | saved_iters = [int(fname.split("_")[-1]) for fname in os.listdir(folder)] 28 | return max(saved_iters) 29 | --------------------------------------------------------------------------------