Hi, I have a component that generates generates 1D Cellular Automata. I want to save a movie with pixels having a sharp edge.
My “Movie file out”- Top has the Parameters ‘Input smoothness’ and ‘Viewer smoothness’ turned to ‘nearest Pixel’, but the saved video smoothes the edges of the pixels out.
I tried different codecs. Also Animation codec. It creates a .mov file, but QuickTime Player gave me an error “cannot be opened. not compatible with QuickTime Player”. I opened this file in davinci resolve and the edges are still smooth.
Seem to be working here. Note that the output movie in only 64x64 pixels, very tiny. Some players will scale it up during playback but if you open in VLC it will open it at native resolution and inspecting the pixels they all look sharp edged.
What resolution are you importing it as, is it getting scaled up when imported?
Here is the output directly from your .tox 06 1DCA.0.mov.zip (149.0 KB)
I opened your video in vlc. You are right, that it opens in the native resolution. But when I scale the vlc window up, the pixels are not sharp anymore.
I tried video codec: H.264(NVIDIA GPU). When hitting “record” the component preview of the moviefileout is displaying sharp edges, but shows an error that H.264(NVIDIA GPU) is not supported on this OS… so the file could not be created.
To answer the second comment first, macOS does not support H264 or H265 encoding in the Movie File Out TOP, those codecs currently require an Nvidia GPU to encode. You can read about a few macOS limitations here: MacOS - Derivative
To make sure we weren’t seeing any softness introduced by the encoding, my example vid was in Animation codec which is lossless.
When you scale the VLC window up, that is the expected result. It is the same as zooming into an image, the more you zoom in the softer everything gets because you need to interpolate data between the pixels that is not there.
If you want no interpolation you need to view the movie at native resolution with no scaling. So if you would like the movie larger, with sharp edges, you need to render it out at a higher resolution.
I will note that inside TouchDesigner you can zoom in and out on TOPs when they are set to Nearest Pixel and TouchDesigner will keep the view sharp, this is a specific TouchDesigner feature and not something other movie players have as a setting (that I know of). If you are simply using these movies loaded back into TouchDesigner, you can change the Movie File In TOP’s ‘Viewer Smoothness’ parameter to ‘Nearest’ and get a sharp view and different zoom levels.
Ben I appreciate your effort. Just one more question and I this thread should be marked as ‘solved’:
I think that I know the next step for me:
The 1DCA component generates a visual output with a resolution of 64x64 pixels. Recording this with a moviefileoutTOP(having an Output resolution of 1080x1080 pixels), won’t scale the video output up. The edges became smooth (At least in my case). I set the ‘Viewer Smoothness’ parameter to ‘Nearest’. The created .mov file is still smooth edged. VLC opens the video in a little window, which is fine and makes sense, but this file can not be uploaded as satisfying pixel art on instagram, YouTube etc.
On the inside of the 1DCA component is a GLSL TOP. This GLSL TOP generates the pattern.
In order to make it look nice and sharp for social media, I have to find a way, that makes the GLSL TOP scale all the pixels up. Is that right?
If you want it rendered larger size keeping nearest pixel, just use a Resolution TOP and set to Nearest Pixel, TouchDesigner can scale it up and keep it Nearest pixel for you. Then you don’t have to change the shader at all, simply export the movie.
It works in this attached file. 1DCA.2.toe (7.9 KB)