{"id":25943645,"url":"https://github.com/pecas-dev/m.i.c.r.o-graphics-engine","last_synced_at":"2025-06-18T23:40:11.569Z","repository":{"id":257379846,"uuid":"858111136","full_name":"Pecas-Dev/M.I.C.R.O-Graphics-Engine","owner":"Pecas-Dev","description":"Computer Graphics Project made with Modern OpenGL in C++ (#2). ","archived":false,"fork":false,"pushed_at":"2025-03-02T02:06:06.000Z","size":30346,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T03:19:21.283Z","etag":null,"topics":["cpp","graphics-engine","graphics-programming","opengl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pecas-Dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T10:27:40.000Z","updated_at":"2025-03-02T02:06:11.000Z","dependencies_parsed_at":"2025-01-21T20:31:51.731Z","dependency_job_id":null,"html_url":"https://github.com/Pecas-Dev/M.I.C.R.O-Graphics-Engine","commit_stats":null,"previous_names":["pecas-dev/opengl-project-2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FM.I.C.R.O-Graphics-Engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FM.I.C.R.O-Graphics-Engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FM.I.C.R.O-Graphics-Engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FM.I.C.R.O-Graphics-Engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pecas-Dev","download_url":"https://codeload.github.com/Pecas-Dev/M.I.C.R.O-Graphics-Engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801259,"owners_count":20022401,"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","graphics-engine","graphics-programming","opengl"],"created_at":"2025-03-04T07:18:09.523Z","updated_at":"2025-03-04T07:18:10.738Z","avatar_url":"https://github.com/Pecas-Dev.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# M.I.C.R.O Graphics Engine (OpenGL)\n\n \u003cbr\u003e\n \n![M I C R O Graphics Engine](https://github.com/user-attachments/assets/4d229ca2-4446-48bf-b933-e0b2bfa5a8da)\n\n \u003cbr\u003e\n\n---\n\n## Project Description\n\nThe **M.I.C.R.O Graphics Engine**, or \"My Input Controlled Real-Time Output Graphics Engine,\" is a custom-built graphics engine developed using OpenGL. It allows real-time manipulation of 3D models and their properties, such as position, rotation, scale, lighting, and textures. The project features a UI built with Dear ImGUI for controlling these parameters interactively, alongside real-time lighting effects. This engine serves as a foundational graphics framework for learning and experimentation, offering a hands-on introduction to core rendering techniques and real-time 3D graphics.\n\n---\n\n## Features\n\n- **Model Loading**: Loads 3D models (**.obj** format) and allows real-time manipulation of their properties.\n- **Lighting System**: Enables dynamic lighting, affecting object shading and appearance.\n- **Texture Control**: Activate or deactivate textures on the 3D models.\n- **UI Controls**: Dear ImGUI interface to modify object transformations (position, rotation, scale) and adjust lighting and texture properties.\n- **Model Loader**: A dedicated button in the UI allows users to load new models dynamically into the scene.\n\n---\n\n\u003cbr\u003e\n\n# Loading a New Model\n\nTo load a new model dynamically into the scene, follow these steps:\n\n1. From the Project's Root, browse to **`Release -\u003e Platforms -\u003e (x64 or x86) -\u003e OGL-P2 -\u003e Assets `**. Inside this folder you will find the following folders:\n\n   - Models\n   - Materials\n   - Textures\n\n2. Place the necessary files in the correct directories inside Assets:\n\n   - .**obj** files in **Assets/Models/**\n\n   - **.mtl** material files in **Assets/Materials/**\n\n   - **.jpg** or **.png** texture files in **Assets/Textures/**\n\n3. Once inside the program (Check [Installation \u0026 Running](https://github.com/Pecas-Dev/M.I.C.R.O-Graphics-Engine?tab=readme-ov-file#installation--running)), click on the **_Load New Model button._**\n\n4. Browse to **`Release -\u003e Platforms -\u003e (x64 or x86) -\u003e OGL-P2 -\u003e Assets-\u003e Models`** and select your **.obj** file.\n\n5. The engine will automatically attempt to load the associated material and textures.\n\n\u003cbr\u003e\n\n---\n\n## Shaders\n\n### Vertex Shader (Default)\n\nHandles the transformation of 3D coordinates and passes color data for rendering.\n\n```glsl\nin vec3 vertexIn;\nin vec4 colorIn;\nout vec4 colorOut;\n\nuniform mat4 model;\nuniform mat4 view;\nuniform mat4 proj;\n\nvoid main()\n{\n    colorOut = colorIn;\n    gl_Position = proj * view * model * vec4(vertexIn, 1.0);\n}\n```\n\n### Fragment Shader (Default)\n\nRenders color and lighting information onto the object.\n\n```glsl\nin vec4 colorOut;\nout vec4 fragColor;\n\nvoid main()\n{\n    fragColor = colorOut;\n}\n\n```\n\n### Vertex Shader (Light)\n\nHandles the transformation of 3D coordinates for the light shader and normal calculations.\n\n```glsl\n#version 460\n\nin vec3 vertexIn;\nin vec4 colorIn;\nin vec2 textureIn;\nin vec3 normalIn;\n\nout vec3 vertexOut;\nout vec4 colorOut;\nout vec2 textureOut;\nout vec3 normalOut;\n\nuniform mat4 model;\nuniform mat4 view;\nuniform mat4 proj;\nuniform mat3 normal;\n\nvoid main()\n{\n    colorOut = colorIn;\n    textureOut = textureIn;\n    normalOut = normalize(normal * normalIn);\n\n    vertexOut = (model * vec4(vertexIn, 1.0)).xyz;\n\n    gl_Position = proj * view * model * vec4(vertexIn, 1.0);\n}\n```\n\n### Fragment Shader (Light)\n\nHandles the dynamic lighting calculations and texture mapping.\n\n```glsl\nstruct Light\n{\n    vec3 position;\n    vec3 ambient;\n    vec3 diffuse;\n    vec3 specular;\n};\n\nstruct Material\n{\n    float shininess;\n    vec3 ambient;\n    vec3 diffuse;\n    vec3 specular;\n};\n\nin vec3 vertexOut;\nin vec2 textureOut;\nin vec3 normalOut;\n\nout vec4 fragColor;\n\nuniform Light light;\nuniform Material material;\nuniform sampler2D textureImage;\nuniform bool isTextured;\n\nvoid main()\n{\n    vec3 ambientColor = light.ambient * material.ambient;\n    vec3 lightDirection = normalize(light.position - vertexOut);\n    vec3 normal = normalize(normalOut);\n    float lightIntensity = max(dot(lightDirection, normal), 0.0);\n    vec3 diffuseColor = light.diffuse * material.diffuse * lightIntensity;\n\n    vec3 finalColor = ambientColor + diffuseColor;\n\n    if(isTextured)\n    {\n        fragColor = vec4(finalColor, 1.0) * texture(textureImage, textureOut);\n    }\n    else\n    {\n        fragColor = vec4(finalColor, 1.0);\n    }\n}\n```\n\n---\n\n## Directory Structure\n\n```\nProject Root\n├── OpenGL2.sln                      // Visual Studio solution file\n├── .gitattributes\n├── .gitignore\n├── bin                              // Binary files\n├── Dependencies                     // External dependencies\n│   ├── SDL\n│   └── GLM\n│\n├── Release                          // Pre-compiled executables\n│   ├── M.I.C.R.O x64.bat            // Run x64 M.I.C.R.O\n│   ├── M.I.C.R.O x86.bat            // Run x86 M.I.C.R.O\n│   └── Platforms\n│       ├── x64                      // 64-bit builds\n│       │   └── OGL-P2               // Contains the necessary files to run the executable.\n│       │       └── Assets\n│       │           ├── Models       // Store `.obj` model files HERE.\n│       │           ├── Materials    // Stores `.mtl` material files HERE.\n│       │           └── Textures     // Stores texture files (`.jpg` or `.png`) HERE.\n│       │\n│       │\n│       │\n│       └── Win32                    // 32-bit builds\n│           └── OGL-P2               // Contains the necessary files to run the executable.\n│               └── Assets\n│                   ├── Models       // Store `.obj` model files HERE.\n│                   ├── Materials    // Stores `.mtl` material files HERE.\n│                   └── Textures     // Stores texture files (`.jpg` or `.png`) HERE.\n│\n└── OpenGL2\n    ├── Assets                       // Stores shaders, models, textures, fonts, and materials.\n    │   ├── Models\n    │   ├── Materials\n    │   ├── Textures\n    │   └── Shaders\n    │\n    └── Project                      // Contains the source code for the M.I.C.R.O Graphics Engine.\n        ├── include\n        └── source\n```\n\n---\n\n\u003cbr\u003e\n\n## Installation \u0026 Running\n\n\u003cbr\u003e\n\n**Clone the repository:**\n\n```bash\ngit clone https://github.com/Pecas-Dev/M.I.C.R.O-Graphics-Engine.git\n```\n\n### Pre-compiled Executables\n\nThe easiest way to run the simulation is using the pre-compiled executables:\n\n1. Navigate to the `Release` folder.\n2. Choose the appropriate version for your system (`x64` or `86`).\n3. Run the `M.I.C.R.O x64.bat` or `M.I.C.R.O x86.bat`or file.\n\n### Building from Source\n\nTo build the project from source:\n\n1. Open `OpenGL2.sln` in Visual Studio.\n2. Choose your configuration (**Debug/Release**) and platform (**x64/x86**).\n3. Build the solution.\n4. Run the program.\n\n\u003cbr\u003e\n\n**Once the program is running:**\n\n- **You can manipulate 3D models and adjust properties like position, scale, rotation, lighting, and textures using the Dear ImGUI UI.**\n\n\u003cbr\u003e\n\n---\n\n## Controls\n\n- W/A/S/D: Move the light source across the scene.\n- Use Dear ImGUI to adjust model properties, lighting, and textures in real time.\n\n\u003cbr\u003e\n\n## Credits\n\nThis project was created by _**Pecas Dev**_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecas-dev%2Fm.i.c.r.o-graphics-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpecas-dev%2Fm.i.c.r.o-graphics-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecas-dev%2Fm.i.c.r.o-graphics-engine/lists"}