code_snippets:psx_scaling
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
code_snippets:psx_scaling [2024/10/21 18:59] – created mrvalentine | code_snippets:psx_scaling [2024/10/21 20:12] (current) – [Draw()] woops mrvalentine | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
The code below should help you set up PlayStation 1 era visuals and should be commented enough. | The code below should help you set up PlayStation 1 era visuals and should be commented enough. | ||
+ | ===== The Goal ===== | ||
+ | |||
+ | To implement the technique of rendering at a lower resolution and then scaling up to 720x480 in MonoGame, you can use the RenderTarget2D class. | ||
+ | |||
+ | Here's a step-by-step guide: | ||
+ | |||
+ | * **Create a Render Target:** Define a render target with your desired lower resolution (e.g., 640x480). | ||
+ | |||
+ | * **Render Your Scene:** Draw your game scene to the render target. | ||
+ | |||
+ | * **Scale and Draw to Back Buffer:** Draw the render target to the back buffer with scaling to fit the 720x480 resolution. | ||
===== Fields ===== | ===== Fields ===== | ||
Line 57: | Line 68: | ||
// Set up the viewport and scaling matrix | // Set up the viewport and scaling matrix | ||
- | var viewport = new Viewport(0, 0, 720, 480); // ! | ||
var scaleMatrix = Matrix.CreateScale(scaleX, | var scaleMatrix = Matrix.CreateScale(scaleX, | ||
Line 69: | Line 79: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | ===== Closing Remarks ===== | ||
+ | |||
+ | To perform full screen switches I came across an issue which I had resolved just about, let me know on the community discord if I should add that here. | ||
+ |
code_snippets/psx_scaling.1729537163.txt.gz · Last modified: 2024/10/21 18:59 by mrvalentine