Jump to content

Offscreen Rendering


klepto2
 Share

Recommended Posts

You requested a feature for my IBl Generator, while i have managed to get it to work as a cli, i still need a Hidden window to get all the work done. 

As far as I know vulkan is allowing headless rendering for this, where you don't need an actual surface.

https://github.com/SaschaWillems/Vulkan/blob/master/examples/renderheadless/renderheadless.cpp

It would be nice to have the ability to create a Framebuffer without having a window.

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

I know that i can render to a texture, but i want to run the Vulkan Pipeline without using a window like this:

#include "UltraEngine.h"

using namespace UltraEngine;

void RenderHook(const UltraEngine::Render::VkRenderer& renderer, shared_ptr<Object> extra)
{
    Print("RENDER_HOOK called...");
}

void TransferHook(const UltraEngine::Render::VkRenderer& renderer, shared_ptr<Object> extra)
{
    Print("TRANSFER_HOOK called...");
}

int main(int argc, const char* argv[])
{
    auto cl = ParseCommandLine(argc, argv);

    EngineSettings settings{};
    settings.asyncrender = false;

    //Create a world
    auto world = CreateWorld();

    //Create a framebuffer
    auto framebuffer = CreateTextureBuffer(512,512);
    auto camera = CreateCamera(world);

    world->AddHook(HOOKID_TRANSFER, TransferHook, world, true);
    world->AddHook(HOOKID_RENDER, RenderHook, world, true);

    //Main loop
    for (int frame = 0; frame < 100; frame++)
    {
        world->Update();
        world->Render(framebuffer);
        //camera->Render();
    }
    return 0;
}

but this leads to an assert error at world->Render(), one solution is to create a hidden window, but it would be nicer if it would work even without the need of a window and a correct framebuffer.

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

Yeah, currently the first call to CreateFramebuffer() triggers the Vulkan initialization, but since Vulkan is headless it would probably be possible to change this without much trouble...

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...