{"id":25943638,"url":"https://github.com/pecas-dev/dx3dcube","last_synced_at":"2025-08-11T06:10:05.805Z","repository":{"id":243916814,"uuid":"813747884","full_name":"Pecas-Dev/DX3DCube","owner":"Pecas-Dev","description":"Cube with fading shaders made with DirectX 11 from scratch in C++.","archived":false,"fork":false,"pushed_at":"2025-03-02T01:06:14.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T22:51:12.504Z","etag":null,"topics":["cpp","directx-11","graphics-programming"],"latest_commit_sha":null,"homepage":"https://juanfgutierrezc.wixsite.com/portfolio/cpp-projects","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-06-11T17:00:08.000Z","updated_at":"2025-03-18T13:39:07.000Z","dependencies_parsed_at":"2025-03-02T06:15:06.657Z","dependency_job_id":null,"html_url":"https://github.com/Pecas-Dev/DX3DCube","commit_stats":null,"previous_names":["pecas-dev/dx3dcube"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pecas-Dev/DX3DCube","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FDX3DCube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FDX3DCube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FDX3DCube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FDX3DCube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pecas-Dev","download_url":"https://codeload.github.com/Pecas-Dev/DX3DCube/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pecas-Dev%2FDX3DCube/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269838444,"owners_count":24483200,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","directx-11","graphics-programming"],"created_at":"2025-03-04T07:18:08.488Z","updated_at":"2025-08-11T06:10:05.070Z","avatar_url":"https://github.com/Pecas-Dev.png","language":"C++","readme":"# 3D Cube with Fading Shader using DirectX11 in C++\n\n## Project Description\n\n**Cube with fading shader made with DirectX 11 from scratch in C++.**\n\nThis project demonstrates the creation of a 3D cube rendered using DirectX 11. The project is built entirely from scratch, including window creation, the graphical rendering pipeline, and a simple input system to rotate the cube using the WASD or arrow keys.\n\n\u003cbr\u003e\n\n![Cube2](https://github.com/user-attachments/assets/1a0cda85-a981-4066-b1a5-05a4f655134f)\n\n\u003cbr\u003e\n\n---\n\n## Features\n\n- **Window Creation**: Set up from scratch to create a rendering window.\n- **Rendering Pipeline**: Implementation of the entire DirectX 11 rendering pipeline.\n- **Input System**: Custom input system for rotating the cube using WASD or arrow keys.\n- **Shaders**: Custom vertex and pixel shaders to create a fading color effect on the cube.\n\n## Shaders\n\n### - Vertex Shader\n\nThe vertex shader transforms the 3D coordinates of each vertex into 2D screen coordinates and passes color information to the pixel shader.\n\n```hlsl\nstruct VS_INPUT\n{\n    float4 position : POSITION;\n    float3 color : COLOR;\n    float3 color1 : COLOR1;\n};\n\nstruct VS_OUTPUT\n{\n    float4 position : SV_POSITION;\n    float3 color : COLOR;\n    float3 color1 : COLOR1;\n};\n\ncbuffer constant : register(b0)\n{\n    row_major float4x4 m_world;\n    row_major float4x4 m_view;\n    row_major float4x4 m_proj;\n    unsigned int m_time;\n};\n\nVS_OUTPUT vsmain(VS_INPUT input)\n{\n    VS_OUTPUT output = (VS_OUTPUT) 0;\n\n    output.position = mul(input.position, m_world);\n    output.position = mul(output.position, m_view);\n    output.position = mul(output.position, m_proj);\n\n    output.color = input.color;\n    output.color1 = input.color1;\n\n    return output;\n}\n```\n\n### - Pixel Shader\n\nThe pixel shader interpolates the colors between color and color1 based on a sine wave function to create a fading effect.\n\n```hlsl\nstruct PS_INPUT\n{\n    float4 position: SV_POSITION;\n    float3 color: COLOR;\n    float3 color1: COLOR1;\n};\n\ncbuffer constant: register(b0)\n{\n    row_major float4x4 m_world;\n    row_major float4x4 m_view;\n    row_major float4x4 m_proj;\n    unsigned int m_time;\n};\n\nfloat4 psmain(PS_INPUT input) : SV_TARGET\n{\n    return float4(lerp(input.color, input.color1, (float)((sin((float)(m_time / (float)500.0f)) + 1.0f) / 2.0f)),1.0f);\n}\n```\n\n## Directory Structure\n\n- Graphics: Contains all graphics-related source and include files such as constant buffer, device context, index buffer, pixel shader, swap chain, vertex buffer, vertex shader, and graphics engine.\n- Input: Contains input system and input listener scripts.\n- Window: Handles window creation.\n- App: Manages the execution of the graphics engine and other scripts.\n- main.cpp: Entry point of the application.\n\n## Installation \u0026 Running\n\n1. Clone the repository: `git clone https://github.com/Pecas-Dev/DX3DCube.git`\n\n2. Open `DX3DCube.sln` in **Visual Studio**.\n\n3. Choose your configuration (Debug/Release) and platform (x64/x86).\n\n4. Build the solution.\n\n5. Run the program.\n\n## Controls\n\n- W / Up Arrow: Rotate the cube up.\n- A / Left Arrow: Rotate the cube left.\n- S / Down Arrow: Rotate the cube down.\n- D / Right Arrow: Rotate the cube right.\n\n## Credits\n\nThis project was created by _**Pecas Dev**_.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecas-dev%2Fdx3dcube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpecas-dev%2Fdx3dcube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpecas-dev%2Fdx3dcube/lists"}