Activity › Forums › Maxon Cinema 4D › How can I render exactly 1 pixel per C4D unit?
-
How can I render exactly 1 pixel per C4D unit?
Posted by Eric Carl on January 13, 2017 at 8:28 pmHello! I’m trying to create a 2D pixel art image, rendering from a 2D camera in C4D. I’d like to set it up so that each inch unit in my scene equals 1 pixel in my render. For example, if I have a 30 inch by 240 inch object in my scene, that should be 30 pixels by 240 pixels in my render. Likewise, a 1 inch by 1 inch object would be only 1 pixel by 1 pixel in my render. Is there a simple way to set this up? I’d assume it just requires finding a magic zoom amount for the camera. Thanks!
Jim Scott replied 9 years, 7 months ago 2 Members · 5 Replies -
5 Replies
-
Jim Scott
January 13, 2017 at 10:37 pmThat’s an interesting project. Having never tried something like this before this is what I came up with.
If you haven’t already done so, make sure in your Project Settings that Project Scale is set to 1, and “Inches.” In C4D Preferences>Units, Unit Display is also set to “Inches.”
Set your Render Settings to the Width and Height of your desired final image. Set Resolution to 1 – Pixels/Inch, Pixel Aspect – Square.
Create a Camera, set its Projection to “Front” and enable it.
To set up the scene create a cube object whose X,Y dimensions matches your render settings and then adjust the zoom to fill the final render area in the View window with that cube. As is normally the case, if the aspect ratio of the View window does not match that of your render settings (grey bars are visible on sides or top and bottom) zoom so that the cube fills the view to the grey bars. You can then hide this cube and add whatever objects you want to create your final 2D image, making sure that their Z positions are all zero (0). In your initial set up with the cube and camera make sure that their coordinates, and the camera’s H,P,B settings, are all zero (0) so that the camera is centered and looking directly at the center of the cube.
Hope this helps.
-
Eric Carl
January 14, 2017 at 7:43 pmThanks Jim. I’m able to get incredibly close just following the steps as you’ve described. Unfortunately I still run into issues where some pixels just don’t match (an object that is 8×16 inches renders as 8×17 pixels). I’m not sure why it happens, but at least I’ve gotten close.
-
Jim Scott
January 14, 2017 at 8:46 pmSince you are looking to create a 2D image, have you thought of using Photoshop or After Effects instead (assuming you have those available)?
I would be interested in seeing a sample project just to get a better idea of what you’re trying to accomplish. If you could post the project that you’ve been working on, perhaps I, or someone else, could make some more suggestions.
-
Eric Carl
January 15, 2017 at 1:40 pmI’m using C4D here for the Mograph tools. I might be able to achieve the same effect in AE, I’m just less familiar with it. Here’s an example of my end goal (though with a different size, scale, and undesired AA):
https://dl.dropboxusercontent.com/u/9144872/pixel-render.mp4
Here’s a zip with two example scene files:
https://dl.dropboxusercontent.com/u/9144872/pixel-dos-test.zip
In pixel-dos_no-tex.c4d, I’ve set up a 640×480 render. I’m cloning a grid of 8×16 blocks with random colors. The render looks close, though some rows render at 17 pixels tall, rather than 16. You can spot the difference if compared against the included pixel-grid-refence.png. If you hide the cloner and render pixel-grid-refence.png on one 640×480 object in the scene, it renders fine and the pixels exactly match that reference.
In pixel-dos_tex.c4d I take it a step further and put textures on all of the clones. In this example any of the 16-rendering-as-17 pixel tall rows appear to have their textures stretched to fit, resulting in random horizontal 2 pixel repetitions. (It looks like Creative Cow resizes my embedded images here, so you’ll want to view them full-size for the correct scale.)
My assumption is that if I could get the 16 inch tall objects to all render at 16 pixels tall, I’d have what I want. The interesting part for me is that one 640×480 object with a texture renders correctly, but a group of 8×16 clones that add up to 640×480 don’t. *shrug*
-
Jim Scott
January 15, 2017 at 4:44 pmThanks for taking the time and effort to share your project Eric, I really appreciate it.
In looking over your scene I noticed that the camera is not square to the plane (it’s skewed on H and P) which is probably inducing the stretching that you are experiencing. If you disable your camera and return to the default one, and switch to a perspective view, you can pivot the default camera and see that your front projection camera is looking at your plane at a rather pronounced angle, which would result in stretched tiles in the final image.

I’ll leave the testing to you, but I think if you redo your renders with the camera zeroed out on H, P, and B you should get the result you’re looking for.

Reply to this Discussion! Login or Sign Up