Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Get low resolution in 3d

Author
Message
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 20th Aug 2021 21:01
Hi all,
I am trying to obtain in 3d the effect that simulates low resolution, as if it were a playstation one, with large pixels and saw teeth. For this I have tried to do SetVirtualResolution (320, 240) and SetWindowSize (960, 720, 1) to achieve full screen and large pixels ... but I can't get it... I get small pixels
As I said, I am looking for an effect as if it were a PS1. Do you know if it is possible to achieve it with AppGameKit classic or studio?
Thank you!
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 20th Aug 2021 21:50
You could use SetVirtualResolution (320, 240) and then instead of drawing to the screen use SetRenderToImage method ( https://www.appgamekit.com/documentation/Reference/Core/SetRenderToImage.htm )

I've used that method for old-skool graphics in 2D and it keeps the blocky effect when scaled up, even for movement and rotation.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 21st Aug 2021 04:57
Modern Graphics Architectures do not support Resolutions lower than 640x480., and the PlayStation uses a Native Resolution slightly lower than this (360p is the closest _modern_ equivalent)
Even still., almost every Display today is Widescreen (16:9 or 16:10).

Now while you could tinker and tweak with the Physics Resolution Functionality until you get a close approx. of "5th Gen" Graphics... I'd actually make a different suggestion.
Create a Full Scene (Post-Process) Shader.

It should handle 3 Factors.
1) Resolution Scaling, this is actually trivial to create as there are many Pixilation / Tile Shaders; and AMD even has an SDK (FidelityFX Downsampler) that specifically does this.
2) Colour Reduction, remember most old-school Consoles use 16bit Colour; this reduces the colour depth and helps to create the "illusion" of an old school output
3) Affine / Triangle Texture Filtering., these are the most complex elements to pull off; but are essentially to mimicking 5th Gen Hardware.

These three elements can and should be done via a Shader (essentially as a "Screen Filter") to produce the output look you desire., this also means you don't have to cater the Engine specifically to use "Old School" techniques for everything.
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 21st Aug 2021 11:25
Thank for yor answers!
I'm going to use the SetRenderToImage approach as I don't know ho to write shaders.
I've tryed and it works really well, adding setimageminfilter and setimagemagfilter I can get the chunky pixel aspect in the image with the rendered scene.
Thank four you help.
Best regards!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 21st Aug 2021 22:27
If you want sharp pixels use;
SetDefaultMinFilter(0)
SetDefaultMagFilter(0)
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 25th Aug 2021 15:45
Hi all,
yes blink0k, I'm already using SetDefaultMinFilter and SetDefaultMagFilter, the result is really good to get pixelated images
Thank you!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Aug 2021 17:11 Edited at: 25th Aug 2021 17:13
how do i fix this to work right when window is resized/maximized?


i know i can remove SetScissor() but the aspect ratio is jacked?
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 26th Aug 2021 16:10 Edited at: 26th Aug 2021 16:59
After some testing with my usual code for this type of thing it looks like 3D is treated differently than 2D when rendering to an image. 3D seems to use the aspect ratio of the window whereas 2D uses the virtual resolution (but only if you set the virtual resolution AFTER SetRenderToImage() for some reason). Check out this snippet. The Sprite's aspect ratio stays the same in windowed vs fullscreen, but not the cube's. I'm guessing it'll require some messing around with the 3D projection to compensate for the difference in the window's aspect ratio vs the render image's.



EDIT: Ah, looks like the answer is SetCameraAspect() ... just setting it to the render image width / height each frame seems to fix it. I've edited the code snippet.

Login to post a reply

Server time is: 2024-04-16 21:48:17
Your offset time is: 2024-04-16 21:48:17