mattkimber / gorender

Go implementation of Transrender sprite renderer
MIT License
9 stars 2 forks source link

Fix sample house manifest #1

Closed 2TallTyler closed 4 years ago

2TallTyler commented 4 years ago

Hello,

The house_manifest.json included with GoRender appears to be a placeholder, as the rotations aren't correct and tiled_normals isn't set properly to render the ground tiles. Also, the sprite is flipped horizontally -- I drew an L on the left side of the house in Magicavoxel but it appears reversed on the right side.

gorender_before

I am using GoRender on a new house set and have updated the manifest with the settings I am using. Besides the rotations, sprite flips, and tiled normals, I have changed the render_elevation to closely match the ground tile template from OpenGFX. It's not perfect, but it's as close as possible. (I will probably render voxel houses and hand-draw my ground tiles.)

gorender_after

I thought this might aid others who wish to use Magicavoxel and GoRender for houses and objects in the future.

Tyler

mattkimber commented 4 years ago

Ah yes, the building one was originally in there as a "look, you can do things which aren't the standard OpenTTD viewing angles too" example.

You might want to have a play around with the manifest I use in the station set I'm working on, which gives much better results (and output which maps pretty closely to the ground tiles). I don't have that in a public repo yet, but the manifest is here:

{
  "lighting_angle": 60,
  "lighting_elevation": 65,
  "depth_influence": 0,
  "tiled_normals": false,
  "soften_edges": 0.5,
  "fade_to_black": false,
  "sampler": "square",
  "accuracy": 5,
  "overlap": 0,
  "brightness": -0.05,
  "contrast": 0.05,
  "size": {
    "x": 128,
    "y": 128,
    "z": 128
  },
  "render_elevation": 30,
  "sprites": [
    {
      "angle": 45,
      "width": 64,
      "flip": true
    },
    {
      "angle": 135,
      "width": 64,
      "flip": true
    }
  ]
}

This is for buildings where 1 tile = 128x128x128. The important thing to notice is it uses the GoRender default for height, which saves an awful lot of playing around with render_elevation trying to get diagonals to align nicely.

2TallTyler commented 4 years ago

Thanks for this. When rendering 64x64 buildings in 1x zoom, it is indeed quite close to aligning with the base game tiles. Here's a comparison -- the rendered sprite is in red and lines up perfectly on the bottom diagonals. Odd that the different rotations have slightly different pixel layouts on the top diagonals.

sprite_alignment

2TallTyler commented 4 years ago

Hello,

I've updated the manifest again, merging your recommendations with the settings I'm using for Yankee Houses. The changes from your recommended settings are:

Here's the included voxel house rendered with these settings: house_8bpp

mattkimber commented 4 years ago

Approved and merged, thanks for the contribution :)