Comments (11)
Is it possible to do this without any modification of the Wicked Engine?
It used to be more convenient, it was possible to directly set the render dimensions, without being tied to the dimensions of a particular window.
Now the engine relies on the size of the window for its work, automatically tracking changes in its size, which reduced flexibility, in my opinion.
from wickedengine.
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.
You can change this logic and size your canvas however you want, and draw to the swapchain however you want.
from wickedengine.
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:
width = 1920
height = 1080
borderless = true
How do you want to set a custom resolution and what should happen with window resize? Stretch render resolution to window size?
from wickedengine.
Hello!
I'm trying to create a small editor. I need the render size to change dynamically when the window size changes.
In the "Scene" window I display render Path -> lastPostprocessRT.
Now the render size is set by the size of the window itself. Which leads to unnecessary waste of resources.
from wickedengine.
I also need to change the rendering proportions:
from wickedengine.
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.
from wickedengine.
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.
Directly calling wi::RenderPath3D.width = 300 or wi::RenderPath3D.height= 500 does not affect the size of the Canvas .
Previously, you could manually specify the Canvas size and it was much more flexible and convenient.
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();
}
from wickedengine.
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.
from wickedengine.
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.
So I need WickedEngine to track the window, but at the same time I can directly set the render resolution.
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.
from wickedengine.
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.
from wickedengine.
Thank you.
I'll try to come up with something.
from wickedengine.
Related Issues (20)
- [feature] SDL2 visual studio project for Windows OS with DX12 & Vulkan
- Incorrect assertion in video parser HOT 1
- Does the `config.ini` have some font-size setting? HOT 2
- scale and rotation drifting HOT 1
- [feature] USD importer HOT 4
- Issues using WickedEngine as submodule HOT 5
- Linux: segfault on window-close / quit HOT 1
- Crash with: DXGI_ERROR_INVALID_CALL
- FSR 2.2 HOT 1
- [Feature], Convert position of the 3d world to position to 2d pixel in the texture. HOT 3
- Vulkan Synchronization Error HOT 3
- Minor typo in ssaoCS.hlsl HOT 2
- Editor keeps freezing HOT 2
- Bug in CloudShadowFilter? HOT 1
- Incomprehensible work of wi::jobsystem. HOT 5
- UI/UX improvments HOT 5
- Double-clicking an object in Entities menu moves the to it HOT 2
- Terrain uv mapping performs correct? HOT 8
- Engine crashes after trying to upload a video HOT 1
- Export video HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wickedengine.