All Projects → all500234765 → Luna-Engine

all500234765 / Luna-Engine

Licence: MIT License
Luna Engine is DirectX 11 based engine that i am trying to make.

Programming Languages

C++
36643 projects - #6 most used programming language
HLSL
714 projects
assembly
5116 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Luna-Engine

CrossWindow-Demos
🥪 Examples of how to use CrossWindow for things like rendering graphics, listening to events, etc.
Stars: ✭ 48 (+37.14%)
Mutual labels:  directx, directx-11, directx11
ConvectionKernels
Fast, high-quality texture compression library for many formats
Stars: ✭ 40 (+14.29%)
Mutual labels:  directx, directx-11
Goesp
Cross-platform streamproof ESP hack for Counter-Strike: Global Offensive, written in modern C++. Rendering and GUI powered by Dear ImGui.
Stars: ✭ 210 (+500%)
Mutual labels:  directx, imgui
DoGUI
Hello DoGUI: (not yet completed) Bloat-free Graphical User interface for C++ with minimal dependencies and a sleek default design
Stars: ✭ 19 (-45.71%)
Mutual labels:  directx, imgui
Directxtk
The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++
Stars: ✭ 1,918 (+5380%)
Mutual labels:  directx, directx-11
Imguizmo.quat
ImGui GIZMO widget - 3D object manipulator / orientator
Stars: ✭ 187 (+434.29%)
Mutual labels:  directx, imgui
SplinesGPU
various spline algorithms computed on the GPU
Stars: ✭ 15 (-57.14%)
Mutual labels:  directx, hlsl
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+29191.43%)
Mutual labels:  directx, directx-11
Rootex
An advanced C++ 3D game engine powering an in-production game yet to be announced
Stars: ✭ 161 (+360%)
Mutual labels:  directx, directx-11
DLAA
(DLAA) Directionally Localized antiAliasing
Stars: ✭ 18 (-48.57%)
Mutual labels:  hlsl, directx-11
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+6020%)
Mutual labels:  directx, directx11
bgfx-python
Python 3.7+ wrapper for the BGFX library. 🐍
Stars: ✭ 99 (+182.86%)
Mutual labels:  directx, imgui
Xray 16
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
Stars: ✭ 1,806 (+5060%)
Mutual labels:  directx, directx11
Directx12gameengine
DirectX 12 .NET game engine
Stars: ✭ 194 (+454.29%)
Mutual labels:  directx, hlsl
Crossshader
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.
Stars: ✭ 113 (+222.86%)
Mutual labels:  directx, hlsl
Dxbc2Dxil
DEPRECATED. DXBC to DXIL (HLSL Bytecode to LLVM IR) using internal APIs.
Stars: ✭ 21 (-40%)
Mutual labels:  directx, hlsl
Computesharp
A .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, with the goal of making GPU computing easy to use for all .NET developers! 🚀
Stars: ✭ 982 (+2705.71%)
Mutual labels:  directx, hlsl
Qtdirect3d
QDirect3DWidget implementation similar to the built-in QOpenGLWidget
Stars: ✭ 60 (+71.43%)
Mutual labels:  directx, imgui
cef-mixer
High Performance off-screen rendering (OSR) demo using CEF
Stars: ✭ 183 (+422.86%)
Mutual labels:  directx, directx11
VoxelTerrain
This project's main goal is to generate and visualize terrain built using voxels. It was achieved using different approaches and computing technologies just for the sake of performance and implementation comparison.
Stars: ✭ 37 (+5.71%)
Mutual labels:  directx, hlsl

Luna-Engine

Luna Engine is DirectX 11 based engine that i develop. Main reason why is that i want to learn more and try it all by myself

I made trello panel, so you can see what i want to do, what i already done and what i am working on atm. https://trello.com/b/T8T6vkBN/directx-11-engine-2019

Update VS if you see: is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.

Version 0.1.209

  • Updated Main Example

  • Splash screen before launching main engine!

    • Some examples are @ Compiled/Windows_Build/Bin/Engine
    • Pretty simple to use!
    // Show splashscreen
    SplashScreen::Launch(L"Engine/SplashEditor.bmp", 5 * 1000);

    This line of code will create splash screen for 5 seconds from specifed image. Splash Example

  • Deferred Renderer is now WIP!

    • Rendering setup code is now easy!
void _DirectX::InitGameData() {
    gRenderer = new RendererDeferred();
    
    // ...
}

void _DirectX::CreateResources() {
    // Create renderer's resources
    gRenderer->Init();
    
    // ...
}

bool _DirectX::Render() {
    static uint gRenderFrame = 0;

    // Reset counters
    gDrawCallInstanceCount = 0;
    gDispatchCallCount = 0;
    gDrawCallCount = 0;

    // Resize event
    Resize();

    // Bind and clear RTV
    gRenderer->ClearMainRT();

    // Render world
    gRenderer->Render();

    // Render to screen
    gContext->OMSetRenderTargets(1, &gRTV, gDSV);
    gRenderer->FinalScreen();

    // Debug
    gRenderer->DebugHUD();
    gRenderer->ImGui();
    
    // Handle present event
    Present(1, 0);

    // End of frame
    gRenderFrame++;
    return false;
}

void _DirectX::Resize() {
    WindowConfig wcfg = gHighLevel.DefaultResize();
    if( !wcfg.Resized ) return;

    // Resize renderer
    gRenderer->Resize();
    
    // ...
}

void _DirectX::FreeResources() {
    // Cleanup
    gRenderer->Release();
    
    // ...
}

void _DirectX::Unload() {
    SAFE_RELEASE_RENDERER(RendererDeferred, gRenderer);
}
  • New 2D drawing functions

    • Triangle
    • CircleOuter
    • Texture
  • Entity Component System is now part of LunaEngine!

  • ECS based Scene system!

    • Load & add models with ease
    gScene->LoadModelStaticOpaque("../Models/LevelModelOBJ.obj");
    • New id based camera system You can now create multiple cameras per single scene!
    gScene->MakeCameraFOVH(0, .1f, 10000.f, 1366.f, 768.f, 70.f);
    • Create scene
    gMainScene = new Scene();
    gMainScene->SetAsActive(); // Bind current scene as active
    
  • New ECS based mesh system

    • Now all shaders that will be used for new Scene rendering system, must specify Layout Generator flag before loading shaders
    SetLayoutGenerator(LayoutGenerator::LgMesh);
    • New Scene's Mesh component separates all vertex buffers into several (Position, Texcoord, Normal, etc...)
    • All other shaders will remain unaffected by this change
  • Old camera system will be deprecated soon

  • New camera control system WIP

    • Component based
    • Example of adding first person controls:
    // Create input controller for player camera
    float fSpeed = 200.f;
    MovementControlComponent lMovementControlComp{};
    lMovementControlComp.mAssignedControls = {
        InputControl(VK_A, GamepadButtonState::_StickL).SetValue(0.f, 0.f, -fSpeed).OrientationDependent(),
        InputControl(VK_D, GamepadButtonState::_StickL).SetValue(0.f, 0.f, +fSpeed).OrientationDependent(),
        InputControl(VK_W, GamepadButtonState::_StickL).SetValue(+fSpeed).OrientationDependent(),
        InputControl(VK_S, GamepadButtonState::_StickL).SetValue(-fSpeed).OrientationDependent(),
        InputControl(MouseButton::AxisXY).SetValue(1.f, 1.f).OrientationUpdate()
    };
    
    // Create cameras
    gMainScene->MakeCameraFOVH(0, .2f, 10000.f, (float)(gRenderer->Width()), (float)(gRenderer->Height()), 70.f); // Player
    gMainScene->MakeCameraFOVH(1, .2f, 10000.f, 2048.f, 2048.f, 70.f); // Sun Light camera
    gMainScene->SetActiveCamera(0);
    gMainScene->UpdateMadeCameras();
    gMainScene->GetCamera(0)->cTransf->vPosition = float3(0.f, 10.f, 0.f);
    
    // Add controls to main camera
    gMainScene->AddComponent(gMainScene->GetActiveCameraHandle(), &lMovementControlComp);
  • New utils

    • File System (WIP)

      • File Mapping
      • R/W Access
      • (In future) Virtual file system
      • Config files
    • Singleton class

    • TopologyState

    • Scoped Resource Mapping

      ScopeMapConstantBuffer<Type> q(CB);

      Order of operations:

      • Map CB
      • Your code with q.data
      • Unmap CB
      {
          ScopeMapConstantBuffer<DataBuffer> q(cbDataBuffer);
          
          q.data->_InvViewProj  = params.mInvViewProj;
          q.data->_CameraPos    = Camera::Current()->GetPosition();
          q.data->_MinFadeDist2 = params.fMinFadeDist * params.fMinFadeDist;
          q.data->_MaxFadeDist2 = params.fMaxFadeDist * params.fMaxFadeDist;
      }
      ScopeMapConstantBufferCopy<Type> q(CB, DataPtr);

      Order of operations:

      • Map CB
      • Copy from DataPtr to q.data
      • Your code with q.data
      • Unmap CB
      {
          // Update CB
          ScopeMapConstantBufferCopy<TransformBuff> q(cb, (void*)&this->mWorld);
      }
      
      cb->Bind(types, slot);

      Same goes for ScopedMapResource

    • Fixed CountLines powershell script

    • Wrapper for ID3D11DeviceContext::Draw* & Dispatch* calls

      • Arguments same as for ID3D11DeviceContext::* versions
        DXDraw(UINT VertexCount, UINT StartVertexLocation);
        DXDrawAuto();
        DXDrawIndexed(UINT IndexCount, UINT StartIndexLocation, UINT BaseVertexLocation);
        DXDrawIndexedInstanced(UINT IndexCountPerInstance, UINT InstanceCount, UINT StartIndexLocation, UINT BaseVertexLocation, UINT StartInstanceLocation);
        DXDrawIndexedInstancedIndirect(ID3D11Buffer *pBufferForArgs, UINT AlignedByteOffsetForArgs);
        DXDrawInstanced(UINT VertexCountPerInstance, UINT InstanceCount, UINT StartVertexLocation, UINT StartInstanceLocation);
        DXDrawInstancedIndirect(ID3D11Buffer *pBufferForArgs, UINT AlignedByteOffsetForArgs);
        DXDispatch(UINT ThreadGroupCountX, UINT ThreadGroupCountY, UINT ThreadGroupCountZ);
        DXDispatchIndirect(ID3D11Buffer *pBufferForArgs, UINT AlignedByteOffsetForArgs);
    • Volumetric Lighting (WIP, Currently Works only for Sun Light)
    • (Screenshots were taken with MSAA 8x & full scale Volumetric Lighting)
    • HDR Luma view (WIP)

    Volumetric Lighting

    HDR Luma View

    • UI (WIP)
    • Several basic primitives UIRectangle, UIRoundrect.
    • Easy to use UIScrollbars(vertical only atm) & UIContainers!
    • Everything that is inside of the container - will be drawn relative to it's position
    • UIAtlas for UI texture atlas generation.
        // Container example
        UIContainer c0(8.f, 81.f, 188.f, 256.f);
        
        // Scrollbar example
        UIScrollbar vsb(UIScrollbarType::Vertical);

    UI Scrollbar Example GIF

    • Deferred Renderer is finally WIP!
    • Deferred PBR/IBL is WIP
    • D32S8 depth buffers are now supported by Render Targets.
      • (Doesn't support true-MSAA)
    • Basic RenderDoc integration is here!
        // Enable RenderDoc
        // Doing such - will disable DX Debug Layer messages
        const bool RenderDocEnable = true;
        gDirectX = gHighLevel.InitDirectX(dxCFG, RenderDocEnable);
        
        // 
        void HighLevel::RenderDocCaptureBegin();
        void HighLevel::RenderDocCaptureEnd();
        void HighLevel::RenderDocLaunchUI();
        bool HighLevel::RenderDocGetUI();
    • Updated up to Assimp 5.0. Now engine supports PBR materials from gltf. (r: Ambient Occlusion, g: Roughness, b: Metallic)
    • More engine states
    // Game tick function
    void Tick(float fDeltaTime);
    
    // Render frame
    bool Render();
    
    // Render UI; maybe soon deprecated
    void ComposeUI();
    
    // Handle resize event
    void Resize();
    
    // Game initialization
    void InitGameData(); // Allocate memory for resources
    void CreateResources(); // Will be runned 2nd time on device-lost event
                            // Desc: Create DX resources here
    void PostCreateResources(bool Recreated=false);
    
    // Game unloading
    void FreeResources(); // Will be runned on device-lost/game end event
                          // Desc: Release DX resources here
    void Unload(); // Game is already closing
    
    void Present(UINT SyncInterval, UINT Flags); // Wrapper for IDXGISwapChain::Present();
    • Added shadertoolsconfig.json for HLSL Tools Extension for Visual Studio
  • Fixed

    • Crash on physics destroy event
    • Some warnings
    • Working on resolving non-released objects at the end of the app

Version 0.1.120

  • Added Attribute Vertex Clouds example. Quick and dirty.
  • Some basic profiling tools for graphics debugging
    • ScopedRangeProfiler * Basically it calls RangeProfiler::Begin(ScopeName) and (when out of scope) RangeProfiler::End() for you.
    • RangeProfiler * RangeProfiler::Begin(Name); - Enters event scope * RangeProfiler::End(); - End of last event scope

When using RenderDoc you will see this:

RenderDoc

{
    ScopedRangeProfiler s1(L"Render depth buffer for directional light");
    rtDepth->Bind();
    rtDepth->Clear(0.f, 0, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL);
    //                                        Default is 1 ^^^

    //rsFrontCull->Bind();
    gContext->OMSetDepthStencilState(pDSS_Default, 1);

    RenderScene(cLight, RendererFlags::DepthPass | RendererFlags::OpaquePass);
}

Didn't mentioned it in any of the prev. updates. Engine now uses inverse depth buffer. So the logic for shaders and CPU side code must consider this.

For example, depth msaa resolve function was:

[unroll(16)] // 32 - is max; 8 - max for me
for( uint i = 0; i < _SampleCount; i++ )
    depth = min(depth, _In.Load(DTid.xy, i));

Now it is:

[unroll(16)] // 32 - is max; 8 - max for me
for( uint i = 0; i < _SampleCount; i++ )
    depth = max(depth, _In.Load(DTid.xy, i));

Depth sampling was:

float depth = _DepthTexture.Sample(_LinearSampler, In.Texcoord);

Now:

float depth = 1.f - _DepthTexture.Sample(_LinearSampler, In.Texcoord);

Clear for depth buffer was:

rtDepth->Clear(1.f, 0, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL);

Now:

rtDepth->Clear(0.f, 0, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL);

Version 0.1.111

  • MSAA support for RenderTargets

  • Deleted old RenderBuffer* classes

  • Created RenderTarget class

    • 1D/2D/3D RTV/DSV support
    • UAV for RTVs if needed
    • MSAA support
    • ArraySize support
    • Custom amount of RenderBuffers [0-8]
    • Depth buffer can present if needed
    • Cubemaps and Cubemap arrays will be added later
RenderTarget<
    size_t dim, 
    size_t BufferNum, 
    bool DepthBuffer=false, 
    size_t ArraySize=1, 
    bool WillHaveMSAA=false, 
    bool Cube=false
>

Version 0.1.101

  • Screen-Space Ambient Occlusion
  • Memory usage functions
    • GPU / CPU
      • Current Usage
      • Avaliable For Reservation
      • Budget
      • Current Reservation
  • Working on HDR/WCG Support
  • Bokeh (WIP; It's very unstanble atm)
  • Depth Of Field (WIP; Must remove linear interpolation and do it with rsqrt)
  • Graphs to see performance of various things
  • Timer class got an update. Now you can specify several more settings
    • Log values to the console?
    • Lambda or any other type of function that will operate on destruction of Timer
  • PlotData(Windows project) structure for easier work with ImGui::Plot
  • Switched to inverse depth buffer (This means that only Windows project is working properly atm) Screen-Space Ambient Occlusion

Version 0.1.080

  • Million particles test

1kk Particles

Requirements

  • MSVS 2017+
    • 2019+ might ask about upgrading to newer tools, it's should still work. I haven't checked it in a while
  • Platform Toolset v141+
  • x86 / x64-bit system
  • Windows SDK Version - 10.0.17763+
  • Videocard with DX 11 support
  • Target platform is Windows 10
    • It might not work on older versions
    • I plan on adding DX 12 with DXR support, so stay tuned!

Features

  • x86 / x64 builds

  • 3D Particles

  • 2D Particles

  • Semi-Automated generartion of

    • Structured Buffer with or without UAV
    • Constant Buffer
    • Vertex Buffer
    • Index Buffer
    • Shaders
    • IA/OM/... States
    • And more!
  • Render Buffers

  • Model loading (avaliable all formats from Assimp)

  • 2D Textures

  • Cube Maps

  • Physics Engine

    • Avaliable Colliders:
      • Plane
      • Sphere
      • AABB
  • Audio Engine

    • Loading of WAV files
    • Usage of XInput2 library
    • Separate volume for each sound
    • Master volume
  • Text Engine

    • Multiple Fonts
    • Real-Time text generation
    • Text alignment
    • SDF Rendering
  • Material system

    • Support for loading and using those texture types:
      • Diffuse
      • Normal
      • Opacity
      • Specular
  • Input system

    • Keyboard
    • Mouse
    • Multiple Gamepad support
  • 2D Drawing API (HighLevel/DirectX/Utilities.h)

    • Circles (Filled and Outlined)
    • Rectangles
    • Lines
    • Set/Get Draw Color
  • What do I plan to do in the future? / What am i working on?

    • You can check out my Trello.

3rd-party libs

  • Assimp - For loading
  • FreeType
  • ImGUI
  • STB
    • Image - For loading textures
    • Vorbis (not yet implemented) - For loading ogg files

Oldish Structure

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].