-
-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render in the background #742
Comments
Yes, you can modify the logic in the wiApplication.cpp. The default behaviour is that in SetWindow(), we set the canvas size to the size of the window, and also create a swapchain of the same size. The swapchain is the final texture that will be presented to the window. All the other rendering by RenderPath3D and RenderPath2D will use other internal textures that will be sized relative to the size of the canvas. |
Is it possible to do this without any modification of the Wicked Engine? |
In the Editor it is currently possible to set a fixed resolution in the config.ini, and if you set it to borderless, then the window cannot be resized:
How do you want to set a custom resolution and what should happen with window resize? Stretch render resolution to window size? |
You can change the size of the canvas (RenderPath3D is a canvas) and the render resources will be resized to match. This is how the editor works, but the canvas size is set from the window size (from the WM_RESIZE OS message if I remember correctly), instead you can set it to your desired size. |
Hello! Not certainly in that way. In the editor example, the WM_SIZE handler calls the editor.SetWindow(hWnd) method, and from it the canvas.init(window) method is called, which adjusts the size of the Canvas each time the window is resized. If you call the canvas.init(width, height) method each time, if necessary, change the render size, then the final render size does not change, but remains equal to the window size, since further in the RenderPath2D::Update(float dt) method the sizes are again redefined equal the size of the main window. DirectXRenderPath -> wi::RenderPath3D DirectXRenderPath* renderPath;
if (imageRectMax.x != renderPath->width || imageRectMax.y != renderPath->height)
{
renderPath->setSize(Vector2(imageRectMax.x, imageRectMax.y));
} void DirectXRenderPath::setSize(const Vector2& size)
{
this->width = size.x; <--- not work
this->height = size.y;
this->init(size.x, size.y); <--- not work
ResizeLayout();
} void RenderPath2D::Update(float dt)
{
XMUINT2 internalResolution = GetInternalResolution();
if (current_buffersize.x != internalResolution.x || current_buffersize.y != internalResolution.y)
{
ResizeBuffers();
}
if (current_layoutscale != GetDPIScaling())
{
ResizeLayout();
} |
You can manage your own renderpath and then the application will not resize it for you and not interfere. This renderpath you don't activate on the application, but you call its Update,Render etc. functions yourself. Then you can draw the render result of your render path on the screen wherever you want using the image renderer. For example you can get the last post process render texture from RenderPath3D with GetLastPostprocessRT function. |
There is one problem. The fact is that I want to display the ImGUI interface also using WickedEngine, as is done in the ImGUI Example. Until 04/22/21, I could set the render resolution separately using the GraphicsDevice_DX12::SetResolution(int width, int height) method, which was later removed, breaking backward compatibility. The solution that I see is to create a window with ImGUI yourself, without using WickedEngine, and take only render results from WickedEngine using GetLastPostprocessRT. But then you won’t be able to use WickedEngine methods for selecting objects in a window, etc. Or somehow decouple the render resolution from the window resolution. But I can't find a suitable method in GraphicsDevice_DX12. In all the examples that I was able to find, the render resolution coincides with the window resolution. |
The SetResolution was removed because now multiple windows (swapchains) can be created. But the base simple Application class only handles one. It should be possible to modify only the Application class to do what you want. You can override the Application class for example, or not use it, as it is just some high level logic tying engine functions together at the top level. |
Thank you. |
Can I make the engine run in the background without putting the render in the window?
But it also needs me to be able to resize the render area.
Now the render sizes are directly tied to the window sizes.
The text was updated successfully, but these errors were encountered: