# (Suggestion) FullScreen resolution trouble

**URL:** <https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888>\
**Category:** Uncategorized\
**Created:** [May 3, 2025, 7:35am UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888 "2025-05-03T07:35:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [May 3, 2025, 7:35am UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/1 "2025-05-03T07:35:31Z")

</div>

Last thing today, I promise (99%). I have spent some (too) long time trying to make fulscreen work at a desired resolution. Against any logic setting width & height didn’t wotk, and the application goes for native resolution.

Finally I found that changing app start params `--fullscreen-custom` does the trick, so I just copy-pasted form `ApplyFullScreenCustomParam(...)` into GameInitialize.pas

```auto
    Window.FullScreen := true;
    Application.VideoResizeWidth := 1920;
    Application.VideoResizeHeight := 1080;
    Application.VideoResize := true;
    Application.VideoChange(true);

```

I think it’d be simpler and more obvious if the TCastleWindow.Fullscreen property did that.

---

<div class="post-metadata">

**Author:** ![MBa](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@MBa](https://forum.castle-engine.io/u/MBa)\
**Post date:** [May 4, 2025, 6:58am UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/2 "2025-05-04T06:58:24Z")

</div>

I’ve tried this a few times already. I’m wondering how it works for you. Not even the ‘screen\_resolution\_change’ demo changes the resolution: ‘cannot change screen resolution’. (Linux Mint MATE, games on Steam are working).

---

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [May 4, 2025, 10:47am UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/3 "2025-05-04T10:47:19Z")

</div>

Full code in initialization:

```auto
  // auto generated
  Application.OnInitialize := @ApplicationInitialize;

  Window := TCastleWindow.Create(Application);
  Application.MainWindow := Window;

  // here starts my code
  Window.AntiAliasing := aa8SamplesFaster;//aa16SamplesNicer;

    Window.FullScreen := true;
    Application.VideoResizeWidth := 1920;//800;
    Application.VideoResizeHeight := 1080;//600;
    Application.VideoResize := true;
    Application.VideoChange(true);
  

  // auto generated
  Window.ParseParameters;
end.

```

It worked in new project based on FPS template as well, even with the crazy 800x600 on a 4k display. I didn’t bother about demos though. I’ve tried few different scenarios with Delphi and FPC but only on windows and a single monitor. The requested resolution **and** refresh rate both must be supported by the display, otherwise it will show an error msg similar to yours and try to run in default.

If other games play on the resolution that you try to apply, then try the refresh rate. It can be set by `Application.VideoFrequency := xxx`

As a side note.  
The menu ‘ **Run** ’ in the CGE editor only has `--fullscreen` command. Anyway, `--fullscreen-custom` doesn’t support notation like ‘1000x2000@60’ to indicate the desired refresh rate, and I still didn’t find a CGE method to list device caps, but I only started to look inside it yesterday afternoon.

---

<div class="post-metadata">

**Author:** ![MBa](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@MBa](https://forum.castle-engine.io/u/MBa)\
**Post date:** [May 4, 2025, 2:22pm UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/4 "2025-05-04T14:22:11Z")

</div>

Thank you for your help. It still doesn’t work this way. I already tried in the demo with 800x600 or 1024x768, which also threw an error. Linux, Lazarus, NVIDIA 3060 laptop. But it’s not so important at the moment. Thanks again.

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [May 4, 2025, 6:44pm UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/5 "2025-05-04T18:44:55Z")

</div>

Note: Some of the questions from thread are already answered in the [README of the examples/user\_interface/screen\_resolution\_change example](https://github.com/castle-engine/castle-engine/tree/master/examples/user_interface/screen_resolution_change) 🙂

In details:

1. Our `Window.FullScreen` property indeed only toggles between _“our window fills the whole screen”_ or not. It does not change the screen resolution. Fullscreen window, by default, has the same resolution as the screen.

2. We don’t really encourage to change the physical screen resolution.

3. I realize that many games expose the option to change screen resolution anyway. It works well enough for some configurations and for some systems.

4. The way I recommend is to adjust to use always the native resolution of your monitor. Don’t use `Application.VideoChange`. Instead, rely on our [UI scaling](https://castle-engine.io/manual_castle_settings.php), active by default in new projects to adjust size of everything to the user’s screen.

5. As for Linux: Simplifying, `Application.VideoChange` and friends are not available on Linux. ( This is also mentioned in the [README (examples/user\_interface/screen\_resolution\_change)](https://github.com/castle-engine/castle-engine/tree/master/examples/user_interface/screen_resolution_change). ).

6. The reason why we don’t have a function to list available resolutions is similar to above – it makes sense, but it’s not our focus. We don’t want to put work into it, though PRs would be welcome.

---

<div class="post-metadata">

**Author:** ![MBa](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@MBa](https://forum.castle-engine.io/u/MBa)\
**Post date:** [May 4, 2025, 7:00pm UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/6 "2025-05-04T19:00:50Z")

</div>

Sorry that I didn’t read the README info. I wouldn’t have thought it would be so complicated. And the demo had such nice resolution change buttons in it 😉 But thank you very much for the detailed information on this topic. I’ll try to read a bit more in the future. 😉

---

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [May 5, 2025, 9:21am UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/7 "2025-05-05T09:21:39Z")

</div>

For me, personally, the resolution change to lower values make sense mainly for testing purpose. I don’t assume that what works on my screen will work on others. Alpha and pre-Alpha testing is easier on just 1 machine, as it offers immediate insight with just a few clicks, but considering what you wrote I’ll just stick to windowed mode for that. Later stages of testing require separate hardware anyway.

Historically “physical” fullscreen with reduced resolution was an option to play games at a decent fps, and it motivated me to think that if it’s easy then it’s worth it. But I do completely agree with your points @michalis, your answer gave me some more insight and let me re-think some stuff.

What you described in AD 4, creating the buffer and UI scaling, is actually done for modern 3d games by use of NVidia’s DLSS and AMD’s FidelityFX. They render the image at a lower resolution and scale it up to fit the window size. The advantage is that it’s done by the hardware. Disadvantage - it’s supported only on more recent cards (I think somewhere about the year 2018). I have yet to find a way to utilize it in CGE (maybe you already have it somewhere).

I do love that CGE supports everything from a washing machine to quantum computers, but scaling an off-screen buffer (the issue #669) programmatically IMHO may offer less benefit than expected. My personal choice is to support desktop & laptops in my game, so it seems the best option will be to focus on a higher-end graphics rather than trying to make older specs owners happy at any price. And it seems that older machines can only be addressed by custom settings (4k textures, million-polygon cute faces, fx and fancy clouds are easier to control than trying to implement work-arounds everywhere).

Nevertheless, thanks for your detailed answer. Appreciated.

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [May 5, 2025, 1:24pm UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/8 "2025-05-05T13:24:22Z")

</div>

> [@DiggiDoggi](#):
>
> creating the buffer and UI scaling, is actually done for modern 3d games by use of NVidia’s DLSS and AMD’s FidelityFX. They render the image at a lower resolution and scale it up to fit the window size. The advantage is that it’s done by the hardware. Disadvantage - it’s supported only on more recent cards (I think somewhere about the year 2018). I have yet to find a way to utilize it in CGE (maybe you already have it somewhere).

I don’t yet have a way to do this, but I’d like to 🙂 From what I understand, the [AMD solution](https://www.amd.com/en/products/graphics/technologies/fidelityfx.html) is open-source and could be checked easier than NVidia DSSL.

If you or anyone else wants to experiment with this, can we connect these solutions with CGE and how, I would be very happy 🙂

> [@DiggiDoggi](#):
>
> but scaling an off-screen buffer (the issue #669) programmatically IMHO may offer less benefit than expected.

Indeed, it’s not a magic bullet. It only helps if

- your bottleneck is “GPU work in a pixel shader”. Which can easily happen for 3D games, with lots of lights and textures. Then rendering at lower resolutions will help.
- and if your users can tolerate lower resolution.

But if your performance problem is elsewhere, then naturally it will not help.

I saw it actually used by some games (one Diablo-like game, that I forgot the name now…) and Godot also offers this option, so it does seem like a reasonable option to offer 🙂

I thought that’s actually the reason why you ask for this, i.e. you want to offer users the option to change resolution → to increase performance 🙂 For debugging, I would recommend what you said, use windowed mode. It may be easier, you can then easily pick any window size and aspect ratio, independently of what your monitor supports as screen size.

---

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [May 5, 2025, 3:53pm UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/9 "2025-05-05T15:53:13Z")

</div>

Appears that my enthusiasm about NVidia and AMD solutions was a bit too fast. Both need vulkan or directx. I start missing the times when hercules graphic card made people happy 🤣 But it doesn’t mean nothing can be done.

I’ll look into the upscaling by CGE-native buffers. I’m worried about the need of blur / sharpen, issues with contrast and LOD, but it’s always better to offer customers some option than none.

Maybe if frames 1,3,5,9… were rendered at full resolution, and frames in between at half res upscaled 2x filled in by simple linear colour average, and then mixed with previous (full scale) frame? I’m thinking out a loud now, but for motion blur we need to mix frames anyway so it could be used together with scaling…

Anyway, I’ll look into it. Any performance gain is a good performance gain.

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [May 7, 2025, 6:14pm UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/10 "2025-05-07T18:14:26Z")

</div>

> [@DiggiDoggi](#):
>
> Appears that my enthusiasm about NVidia and AMD solutions was a bit too fast. Both need vulkan or directx.

Oh, that’s a pity.

Indeed, I could quickly confirm it for AMD FidelityFX, [https://gpuopen.com/amd-fidelityfx-sdk/](https://gpuopen.com/amd-fidelityfx-sdk/) says

> Supports:  
> DirectX®12  
> Vulkan®  
> Microsoft® GDK® (requires access to Microsoft®’s GDK® Developer Program)

Well, we should introduce the new renderer finally some day.

- [Roadmap about Vulkan](https://castle-engine.io/roadmap#vulkan),
- [roadmap about BGFX](https://castle-engine.io/roadmap#bgfx).
- My most desired approach now to this is through BGFX (not direct Vulkan access), and using BGFX to get Vulkan and others.
- Research in that area is welcome, we have an [example application (examples/research\_special\_rendering\_methods/new\_renderer\_skeleton)](https://github.com/castle-engine/castle-engine/tree/master/examples/research_special_rendering_methods/new_renderer_skeleton) where one could start experimenting with porting a new renderer. [News about it here](https://castle-engine.io/wp/2017/11/11/skeleton-code-to-start-a-new-renderer-metal-vulkan-direct3d-opengles-improvements/).

> [@DiggiDoggi](#):
>
> I’m worried about the need of blur / sharpen, issues with contrast and LOD, but it’s always better to offer customers some option than none.

The [GH issue 669](https://github.com/castle-engine/castle-engine/issues/669) is just regular image upscaling, with bilinear filtering (so yes, it can make things blurry if one tried to make the rendering area too small) or nearest (so it will look pixelated; which may actually be a feature in certain cases, if one wants a “retro” look).

> [@DiggiDoggi](#):
>
> Maybe if frames 1,3,5,9… were rendered at full resolution, and frames in between at half res upscaled 2x filled in by simple linear colour average, and then mixed with previous (full scale) frame? I’m thinking out a loud now, but for motion blur we need to mix frames anyway so it could be used together with scaling…
> 
> Anyway, I’ll look into it. Any performance gain is a good performance gain.

All kinds of research is welcome, though my suggestion would be to first make the “baseline” simplest approach, following idea of [GH issue 669](https://github.com/castle-engine/castle-engine/issues/669) 🙂 On top of that code, experiments you propose can be made 🙂

Combining this with [our screen effects](https://castle-engine.io/x3d_extensions_screen_effects.php) which could introduce a “sharpen” image operation could made sense. Though I fear that any attempt here could “backfire” – because in the end, this is a technique to conserve time (unless used for that retro pixelated effect), so any processing of the image must be _really fast_ or we risk negating the performance gains from rendering to a smaller resolution.

Admittedly I am a bit skeptical of using previous frames for this. Unless a specific game style wants a motion blur anyway. But then it’s motion blur, and frames “jump” in quality – which may be more distracting to human eye than naive “just downscale all the frames”. Anyhow, I know you were thinking out loud, and I shouldn’t jump into doubting too fast. Experiments are welcome and good 🙂

---

<div class="post-metadata">

**Author:** ![DiggiDoggi](https://forum.castle-engine.io/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@DiggiDoggi](https://forum.castle-engine.io/u/DiggiDoggi)\
**Post date:** [May 8, 2025, 10:14am UTC](https://forum.castle-engine.io/t/suggestion-fullscreen-resolution-trouble/1888/11 "2025-05-08T10:14:00Z")

</div>

Thanks for the insight @michalis.

As for the skeleton app, inside the new\_render\_skeleton.dproj on lines 240 & 260 should be Win64? Otherwise the settings for Win32 are duplicated (2x debug, 2x release). I maybe wrong, I only made a very quick look at it.

Anyway, supporting vulkan (and possibly directx) is worth consideration. It would be a side project for me though.

For the upscaling I’ve seen many algorithms in my past, some preserving the sharp lines basing on a 3x3 or 3x4 neighbours, and one based on a very simple neural network but I only used them on CPU so far. If any of them prove to be fast enough as a shader on GPU, and device-independent, and easy to maintain then I’ll post the code here.

I will start from what you propose, basing on the issue 669. First thing of all I want it to be fully compatible with CGE - I don’t want to have to worry with every CGE update if it’ll still work. I consider it worth experimenting, and fun 🙂 maybe even useful.
