Disable Post Processing Texture Filtering
Moderators: GZDoom Developers, Raze Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
-
- Posts: 271
- Joined: Mon Jul 13, 2009 3:33 pm
Disable Post Processing Texture Filtering
Just like my titles says, I'm building a post processing shader that involves sampling a texture across the screen, however even with texture filtering in game set to nearest, my sampled texture is still being interpolated. Where abouts can I define GL_NEAREST for this particular texture? It's ruining the effect that I'm going for.
-
- Posts: 1556
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Disable Post Processing Texture Filtering
And what is the question? Did you know that texture filtering is an option?
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Disable Post Processing Texture Filtering
Pro-tip: don't answer if you don't fully understand what is being talked about here. =P OP is talking about post processing shaders and how apparently sampling from the screen texture is producing interpolated pixels.ramon.dexter wrote:And what is the question? Did you know that texture filtering is an option?
Indecom:
It seems to work for me. I am able to get crisp, clean NEAREST pixels with my post processing stuff. What's your shader like? Can you do a simple shader that simply outputs the frag colour as-is and see if you still get a blurry output?
EDIT: Also just to be sure, do you have settings like multisampling or FXAA, or lens distortion turned on? These 3 PP shaders do cause aliasing on the screen. And lastly, did you accidentally set the screen's scaling factor to something other than 1.0? (it's in the Video Options menu)
-
- Posts: 271
- Joined: Mon Jul 13, 2009 3:33 pm
Re: Disable Post Processing Texture Filtering
I've checked the three PP shaders you mentioned and none of them are the culprit. I've got my shader just outputting the frag colour as is and it's definitely blurred. What i've done was assigned a texture uniform in my gldefs like this:
https://i.gyazo.com/84274c9aa81d85c7626d799181b6c9f5
and the function in my shader looks like this:
https://gyazo.com/5ef0ff31befe6823d5f42b070989df18
Texture interpolation is set to: none (nearest mip)
https://i.gyazo.com/84274c9aa81d85c7626d799181b6c9f5
and the function in my shader looks like this:
https://gyazo.com/5ef0ff31befe6823d5f42b070989df18
Texture interpolation is set to: none (nearest mip)
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Disable Post Processing Texture Filtering
Hmmm... perhaps the external texture DITH is indeed being interpolated, regardless of user filter settings. I'm not sure and I'm not well-versed with the source, perhaps dpJudas can confirm if this was intentional or a bug.
-
-
- Posts: 3100
- Joined: Sat May 28, 2016 1:01 pm
Re: Disable Post Processing Texture Filtering
The user filter settings are meant for scene rendering, not post processing. They have no effect here and that's intentional.
To answer OP - at the moment the screen texture is always nearest sampled and any user texture is always linear sampled. There are currently no settings in the GLDEFS file to change this. You can still get nearest samples from your custom texture, but it requires calling texelFetch() instead of texture().
To answer OP - at the moment the screen texture is always nearest sampled and any user texture is always linear sampled. There are currently no settings in the GLDEFS file to change this. You can still get nearest samples from your custom texture, but it requires calling texelFetch() instead of texture().
-
- Posts: 271
- Joined: Mon Jul 13, 2009 3:33 pm
Re: Disable Post Processing Texture Filtering
Thanks all, I managed to figure out my issues and all is working fantastically!
https://i.gyazo.com/29dd307fcdec093d434 ... 42ab39.png
https://i.gyazo.com/29dd307fcdec093d434 ... 42ab39.png