itch.io is community of indie game creators and players

Scaleable Render Texture Resolution at Runtime(AKA making your game look pixelated)

Pixelated game screens for your retro-esque games are cool! The future is now to make your games look worse! It would be even cooler if the player could choose the resolution while they play, or it changes during gameplay! 


Getting this to work at runtime was a bit of an issue, and I couldn't find any one straight answer online. Hopefully it'll help someone else out. This was done in Unity 2022.3.4f1 (and also working in the 2022.3.62.f2 security patch version). It also assumes you are already using a render texture output from your camera.

The usual disclaimer: I am not a programmer, I am what I optimistically call a ‘functionality coder’.

Step 1: Have the camera output set to your render texture


Step 3: In the render texture, make sure Dynamic Scaling is set to true. Any render texture flagged with this setting will be affected by ScalableBufferManager.ResizeBuffers.



--- This was the point where things weren't working as expected. There were no changes to the resolution of the render texture at runtime. Below is what allowed it to work for me ---

Step 4:  Go to Edit -> Project Settings -> Player. Uncheck 'Auto Graphics API for Windows' (or whatever platforms are being used). Add 'Direct3D12' from the dropdown. Drag it so it is the first item in the list.


That's all. 

Leave a comment