- Home /
Are there options for more realistic down-sampling of textures?
I am currently working on an application that involves simulating barcodes in 3D space. I am taking full resolution camera captures and sending the images to a program that can decode the barcodes. One issue I am having is that when I move the camera to far away from the barcode texture, the barcode texture starts to morph in an unrealistic way. Instead of blurring more (kind of like how a real camera would capture a far away barcode), the texture becomes distorted in a way that makes the code unreadable. I am trying to figure out how to make a more "true to life" visual simulation of a far away barcode that would more accurately portray what a camera would really see. Performance is NOT a concern, and I know a lot of Unity's work on antialiasing and downsampling might avoid realism for the sake of performance. What are my options here?
Answer by Bunny83 · Jun 19, 2019 at 06:32 PM
Sorry but I have no idea what you mean by "morphing in unrealistic ways". The sampling is done by your GPU. How good the result is depends on if you use mipmapping or not and on your anisotropic filtering level. Do you have an example of the "morphing" you're talking about? So the actual source texture and a screenshot of the "morphed" view would help.
Sorry, I'm having trouble uploading images to this forum for some reason.
Since I've posted this I have tried a new strategy, and it might help you understand what I mean. I found that running the game on 4x the resolution that the target image needs to be and then 4x down-sampling the screen cap (using openCV) yields much more realistic results than the anti-aliasing options that unity has in its post processing stack. In other words, the faster AA options available in Unity (and however unity decides to blur distant textures), while good-looking, were not realistic enough for my purposes. I guess "true" down-sampling was kind of the answer I was looking for. Does unity have any support for this kind of thing?
Your answer
![](https://koobas.hobune.stream/wayback/20220612203455im_/https://answers.unity.com/themes/thub/images/avi.jpg)