Is there a way to modify render window size?

  • ksotar
  • Topic Author
More
6 years 4 months ago - 6 years 4 months ago #21 by ksotar Replied by ksotar on topic Is there a way to modify render window size?
Thank you all for your explanations, it is starting to get clearer. While some doc with Reshade workflow explanation would help immensely, this is much better then nothing.

Let me start with OpenVR.

crosire wrote: That's why this is hard to do and much simpler with OpenVR

Ok. Can I use OpenVR in my case? If I can, then how? Will Intel HD4400 be capable of handling this?


Then to the whole buffer thing.

crosire wrote: But keep in mind that most games nowadays don't render to the backbuffer directly, they first render to custom buffers

But does this matter in our case? I make window twice the size for Reshade\Depth3D to be able to fit SBS image without any distortions. A game may draw wherever it wants, it's not its image that I want, but the Depth3D result. The whole idea to try start game in resolution needed for SBS frame (8:9), that was from listening to you, and was for not trying to go the other way - run in 16:9 and then force the game to render 8:9. This way all of its intrinsic mechanics keeps working in 8:9, and we don't need to try fix it all.

kingeric1992 wrote: a common implementation for games that enables user to resize window

I thought so. But honestly, I can only remember some kind of chess or Solitaire games that uses resizable window. Seems to me we're speaking of some minority here, what'll you say? I guess we could try to catch resize events here or something, but I'll just leave this matter for now, we can comeback to it later, if there be need.

kingeric1992 wrote: which is how it only filled up half the size of the window in your case.

I see now, that explains a lot, yes. Well, I guess I got lucky here (got framebuffer resize for free, while keeping projection intact), but who knows, we could try other games.

kingeric1992 wrote: overall, window size is only a parameter, which may or may not be used by the engine.

Yes, I can totally see your point. But I can hope, for now, that mainly resolution is set on start/change in options and is stored in game, not obtained from window size or something. Because if you don't want resizable window, why would you go the other way?

kingeric1992 wrote: for your purpose, might as well just use a child window and put the sbs texture there.

Well, this could be a desirable option (to be able to see normal screen while streaming SBS). But how can I do that? Wouldn't there be some performance penalties, because I show images in two windows simultaneously?
Last edit: 6 years 4 months ago by ksotar.

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
6 years 4 months ago #22 by kingeric1992 Replied by kingeric1992 on topic Is there a way to modify render window size?
Minecraft. And for no reason, MEA also support that....
plenty of popular games have that. (while mostly are sprite based for they benefit from resizable windowed mode the most)
and don't forget a lot of user here is in the realm of retro gaming, and emulators could have resizable window also. (VR retro gaming...that would work)

create a child window from reshade binary, and setup swapchain and everything, then have a shader in reshdeFX to copy past the texture to child window backbuffer. the performance cost is minimum.

as for why some engine choose to do A instead of B? god knows.As long as the game works, there's no concern on that.
The following user(s) said Thank You: ksotar

Please Log in or Create an account to join the conversation.

  • ksotar
  • Topic Author
More
6 years 4 months ago - 6 years 4 months ago #23 by ksotar Replied by ksotar on topic Is there a way to modify render window size?

And for no reason, MEA also support that....

Ah! That must be the reason! :)


OK, I must admit I do not play often, so I can miss something here. But I myself for retrogaming! Freespace2 is from 1999, you know :) As crosire wrote:

Those running on OpenGL and that are using old rendering methods


kingeric1992 wrote: create a child window from reshade binary, and setup swapchain and everything, then have a shader in reshdeFX to copy past the texture to child window backbuffer. the performance cost is minimum.


So, finally we have an answer for the question, with which I have started the topic! :)

Does Reshade interact with rendering pipeline on a level that could make it possible? If not, can someone suggest a way to do it in principle?


Well, I've looked at how to "setup swapchain and everything" here: msdn.microsoft.com/en-us/library/windows...643747(v=vs.85).aspx
And I afraid it is much off scope of my abilities in programming. If only someone could help here.

I have also looked at Witcher3 calls (DX11). It uses CreateWindowExW instead of "A" and uses AjustWindowRect as a source for SetWindowPos. First, I had some success: on the second call window was resized and placed in the top-left-corner. It was half-white, and then filled with black, that shows that Framebuffer was adjusted, I think. But then something overrode my settings and picture appeared with set-in-game resolution, adjusting window size accordingly (though it has maintained its new place). I didn't find what could that be among Window/ID3D11 calls. Also there is not a single call to SwapChain, but it calls RSSetViewports all the time. That's just crazy :blink:

My expectations for DX were high, since I found information like this:

DXGI automatically handles resizing the 'front buffer', i.e. the swap chain part that is displayed to the user. However, the application is responsible for resizing the 'back buffer'. When you do this, you should also handle recreating all 'windows-size dependent' resources.

It sounded like a charm: just resize window+front buffer, leaving all other rendering intact. But...
Last edit: 6 years 4 months ago by ksotar.

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
6 years 4 months ago #24 by kingeric1992 Replied by kingeric1992 on topic Is there a way to modify render window size?
concept test (I'm using ENB as dll loader)

Tested on clearRTV with animated bg color , working as expected.
what's left is just setting up size and shaders.

api shouldn't be a problem as render to multiple window have been here since dx8

Please Log in or Create an account to join the conversation.

  • ksotar
  • Topic Author
More
6 years 4 months ago #25 by ksotar Replied by ksotar on topic Is there a way to modify render window size?
That's just great. I believe it is the right path to go.
What's your intention?

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
6 years 4 months ago - 6 years 4 months ago #26 by kingeric1992 Replied by kingeric1992 on topic Is there a way to modify render window size?
If your're asking code-wise, nothing.

for the additional window, I guess you can grab some streaming app to stream either the window, or desktop to your phone, and use google cardboard?
I think there are apps to map gyro sensor to mouse also.
Last edit: 6 years 4 months ago by kingeric1992.
The following user(s) said Thank You: ksotar

Please Log in or Create an account to join the conversation.

  • ksotar
  • Topic Author
More
6 years 4 months ago - 6 years 4 months ago #27 by ksotar Replied by ksotar on topic Is there a way to modify render window size?
Well, I suppose either someone kind will catch up here, either I'll finally install VS2017. The latter is highly complicated in near future. On the other hand, I need to compile this window injector to a human form anyway... So still somebody help, please! :)

And anyways, thank you very much again.

I guess you can grab some streaming app

Yeah, actually I'm doing this:


But for now I can stream with more or less decent performance only from the screen, not window. Especially when it was 1920x2160.

And some update from me: I poked a little to Depth3D and got a result:



It pretty much rests my case, I'll polish it more, and that's it.

But such a feature is in demand as I can see from various forums. So, we need to struggle on. And my next target will be Witcher 3 :)
Last edit: 6 years 4 months ago by ksotar.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.