tommyettinger / spotvox

Renders MagicaVoxel .vox files to pixel art. Successor to IsoVoxel.
Apache License 2.0
41 stars 0 forks source link

[Feature Request] Command Line Option for adjusting smoothing #2

Closed 21ChenYe closed 2 years ago

21ChenYe commented 2 years ago

Description

Spotvox Version: 0.0.4 (Windows)

I enjoy using SpotVox to create sprites at 4x scale as it has the level of detail I require. However, I notice at 4x scale, the program tends to create smooth corners at unwanted areas. I've been using a semi-workaround by taking away a few voxels at the problematic areas but this only reduces the issue instead of fixing it, and can be somewhat prone to strange geometry.

Would it be possible to add a command line option to adjust smoothing at higher scales? This would allow users to create higher scale sprites while retaining the blockiness of scale 1x.

I am unsure if I have conveyed my issue accurately, so I have created a diagram to help illustrate the problem.

Screenshot

Untitled(2)

tommyettinger commented 2 years ago

Does using the command-line argument -m -4 do what you want? Negative values for multiples are treated as "blocky multiples" rather than "smooth multiples." This is documented, but it's quite easy to miss, especially since I didn't post a blocky-multiplied image as a preview in the README.md .

Here's a smiling bear at 8x size, produced with the extra option -m -4 (the negative number doesn't indicate negative scale): Bear_angle0

Here's the same bear using the default smoothing, using -m 4 (positive): Bear_angle0

Blocky multiples don't look as sharp-edged as they could, just because of how lighting is handled. I think changing the Material options in the .vox file can be used to make edges look less rounded off. Right now, when a voxel would receive light from a light source above (like the sky; a strong light source) and also from the left side (which is a weak light source), that voxel has its lightness become extra-bright based on the material's IOR and possibly Roughness values (lower values for both make the edges less bright; you may need to change the material to Blend type to access IOR).

As a preview of an upcoming feature, here's a turntable gif of the 8x blocky-scaled bear: Bear_Turntable

21ChenYe commented 2 years ago

rattata_angle0

Wow, I completely missed that you can do numbers larger than -1. This is perfect, thank you so much!