{"id":23988816,"url":"https://github.com/mgthetrain/cpp-opengl-renderer","last_synced_at":"2025-02-25T03:13:08.560Z","repository":{"id":221582668,"uuid":"754797198","full_name":"MGTheTrain/cpp-opengl-renderer","owner":"MGTheTrain","description":"A cross-platform C++ OpenGL renderer","archived":false,"fork":false,"pushed_at":"2025-02-08T21:35:13.000Z","size":12238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-02-08T22:19:08.935Z","etag":null,"topics":["cpp","glsl","gltf","opengl","pbr","usd"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MGTheTrain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-08T19:32:51.000Z","updated_at":"2025-02-08T21:28:04.000Z","dependencies_parsed_at":"2024-02-08T20:51:15.739Z","dependency_job_id":"59505df5-fc88-4132-a3d0-9cee33737092","html_url":"https://github.com/MGTheTrain/cpp-opengl-renderer","commit_stats":null,"previous_names":["mgthetrain/cpp-opengl-renderer"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGTheTrain%2Fcpp-opengl-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGTheTrain%2Fcpp-opengl-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGTheTrain%2Fcpp-opengl-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGTheTrain%2Fcpp-opengl-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MGTheTrain","download_url":"https://codeload.github.com/MGTheTrain/cpp-opengl-renderer/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240593178,"owners_count":19825939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","glsl","gltf","opengl","pbr","usd"],"created_at":"2025-01-07T16:16:23.844Z","updated_at":"2025-02-25T03:13:08.444Z","avatar_url":"https://github.com/MGTheTrain.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpp-opengl-renderer\r\n\r\n## Table of Contents\r\n\r\n+ [Summary](#summary)\r\n+ [Features](#features)\r\n+ [Getting started](#getting-started)\r\n\r\n## Summary\r\n\r\nA cross-platform C++ OpenGL renderer\r\n\r\n## Features\r\n\r\n- [x] Compilation on MacOS, Linux Ubuntu 20.04/22.04, Linux debian 11 and Windows 10/11 OS\r\n- [x] Support for glTF scene loading\r\n- [x] PBR shader pipeline considering primarily the metal roughness workflow\r\n- [x] High code coverage with GoogleTest for methods in module structs and classes \r\n- [x] Create `CMakeLists.txt` files for cross-platform build environment generation\r\n- [x] CI workflows ensuring cross-platform compilation primarily for Desktop operating systems \r\n- [x] CI workflows ensuring continuous testing of the modules \r\n- [x] Cross-platform CPack packaging for Linux, MacOS and Windows OSes\r\n- [x] Integrated simple menu (e.g. with sliders and other widgets)\r\n- [x] Native file dialog support for loading new glTF scenes\r\n- [ ] ~~PBR fragment shader with switchable `fragmentColor` for inspecting intermediate outcomes (**OPTIONAL**)~~\r\n- [ ] ~~Support for USD scene loading (**OPTIONAL**)~~\r\n- [ ] ~~Skeletal animation support (**OPTIONAL**)~~\r\n- [x] Port Desktop application to the web trough emscripten SDK (**OPTIONAL**)\r\n- [ ] ~~Consider compiled library for mobile support trough Java native interface (JNI) with kotlin and Swift native interface (SNI) with Swift (**OPTIONAL**)~~\r\n\r\n## Getting started\r\n\r\n### Preconditions\r\n\r\n- Download and install [Visual Studio with components for building C and C++ apps](https://visualstudio.microsoft.com/vs/features/cplusplus/) on your target platform \r\n- Download and install [CMake from the official website](https://cmake.org/download/)  or trough a package manager\r\n- To obtain multiple glTF samples, ensure that you update the Git submodules: `git submodule update --init` \r\n- For web builds the `emscripten SDK` needs to be installed. [Click here](https://github.com/emscripten-core/emsdk)\r\n\r\n#### Mac OS\r\n\r\nEnsure on MacOS you have installed [brew](https://brew.sh) with `/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"`\r\n\r\nAdd brew to the `PATH` variable and substitute `\u003cyour user\u003e` for:\r\n```sh\r\n`(echo; echo 'eval \"$(/opt/homebrew/bin/brew shellenv)\"') \u003e\u003e /Users/\u003cyour user\u003e/.zprofile\r\n    eval \"$(/opt/homebrew/bin/brew shellenv)\"\r\n```\r\n\r\nThereafter install the required brew packages/formulas with `brew install pkg-config cmake` \r\n\r\n### Debugging\r\n\r\nOpen the `cpp-opengl-renderer.sln`. Modify `include  pathes, library pathes and library names` in the `cpp-opengl-renderer.vcxproj`. Confirm the presence of only one entry point `int main()`. Set breakpoints as needed. Initiate the debugging process. \r\nIf you encounter DLL-related errors, make sure to copy the necessary dynamic libraries to the directory where the built executable is located and then rebuild.\r\n\r\n### Google Test build configurations\r\n\r\nMake sure to configure the project settings appropriately for the `Debug|x64` build configuration by setting the correct static library path and copying the required shared libraries:\r\n\r\n- **Library path:** `\u003cvcpkg installation path\u003e/vcpkg/packages/gtest_x64-windows/debug/lib`\r\n- **Binary path:** `\u003cvcpkg installation path\u003e/vcpkg/packages/gtest_x64-windows/debug/bin`\r\n\r\nSimilair for `Release|x64` build configurations:\r\n\r\n- **Library path:** `\u003cvcpkg installation path\u003e/vcpkg/packages/gtest_x64-windows/lib`\r\n- **Binary path:** `\u003cvcpkg installation path\u003e/vcpkg/packages/gtest_x64-windows/bin`\r\n\r\n### CMake\r\n\r\n#### Unix\r\n\r\nIn order to compile the source code and link the binaries run in a Unix terminal:\r\n\r\n```sh\r\ncd devops/scripts/bash/\r\n./compile_source_code.sh -CMakeToolchainFile third-party/vcpkg/scripts/buildsystems/vcpkg.cmake\r\n```\r\n\r\nFor web builds ensure the `emscripten SDK` is installed and then run:\r\n\r\n```sh\r\ncd devops/scripts/bash/\r\nsource \u003cPath to emsdk folder\u003e/emsdk_env.sh\r\n./compile_source_code.sh -WebBuild \r\n# Copy build artifacts (.js, .wasm, .data) over to assets\\web\\html-js-wasm\r\n# Start the dev container within the `.devcontainer/nginx` directory. Once inside the container, copy the contents of the assets/web/html-js-wasm directory to /usr/share/nginx/html\r\n# Visit in a browser of choice `localhost:8090/rotating_texture_cube.html` or `localhost:8090/opengl_viewer.html`\r\n```\r\n\r\nIn order to additionaly start the test executables in a Unix terminal: \r\n\r\n```sh\r\ncd devops/scripts/bash/\r\n./compile_source_code.sh -CMakeToolchainFile third-party/vcpkg/scripts/buildsystems/vcpkg.cmake -RunTests\r\n```\r\n\r\nIn order to create compressed files or packages:\r\n\r\n```sh\r\ncd build/\r\ncpack -G \u003cDEB, ZIP, TGZ, TXZ\u003e # DEB only for Linux systems. Check further generators for the specific Unix OS and CPU arch via `cpack -G --help` \r\ncd ../packages\r\n# install package or unzip compressed file\r\n```\r\n\r\n#### Windows\r\n\r\nIn order to compile the source code and link the binaries run in a PowerShell terminal:\r\n\r\n```sh\r\ncd devops\\scripts\\ps1\r\n.\\compile_source_code.ps1 -CMakeToolchainFile third-party/vcpkg/scripts/buildsystems/vcpkg.cmake\r\n```\r\n\r\nFor web builds ensure the `emscripten SDK` is installed, `ninja` or `mingw32-make` are available and then run:\r\n\r\n```sh\r\ncd devops\\scripts\\ps1\r\nsource \u003cPath to emsdk folder\u003e\\emsdk_env.bat\r\n.\\compile_source_code.ps1 -WebBuild\r\n# Copy build artifacts (.js, .wasm, .data) over to assets/web/html-js-wasm\r\n# Start the dev container within the `.devcontainer/nginx` directory. Once inside the container, copy the contents of the assets/web/html-js-wasm directory to /usr/share/nginx/html\r\n# Visit in a browser of choice `localhost:8090/rotating_texture_cube.html` or `localhost:8090/opengl_viewer.html`\r\n```\r\n\r\nIn order to additionaly start the test executables in a PowerShell terminal: \r\n\r\n```sh\r\ncd devops\\scripts\\ps1\r\n.\\compile_source_code.ps1 -CMakeToolchainFile third-party/vcpkg/scripts/buildsystems/vcpkg.cmake -RunTests\r\n```\r\n\r\nIn order to create compressed files or installers:\r\n\r\n```sh\r\ncd build/\r\ncpack -G \u003cZIP, NSIS, NSIS64\u003e # Check further generators for later Windows OSes and CPU arch via `cpack -G --help` \r\ncd ../packages\r\n# run installer or unzip compressed file\r\n```\r\n\r\n## Apps\r\n\r\nImages of the rendered scenes can be viewed here:\r\n\r\n- [opengl-viewer README.md](./apps/opengl-viewer/README.md)\r\n- [rotating-textured-cube README.md](./apps/rotating-textured-cube/README.md)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgthetrain%2Fcpp-opengl-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgthetrain%2Fcpp-opengl-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgthetrain%2Fcpp-opengl-renderer/lists"}