I've updated this as an imaging utility tool as I've worked on projects, this will eventually be updated imagine but for now we have two main tools
- Stereographic Normalization Technique which remaps an image to a sphere UV coordinates
- A Unity Mask tool which combines multiple PBR images into a single PNG Metallic (R), Ambient Occlusion (G), Detail Map (B), Smoothness Value (A) for a single RGBA image Thanks for visiting, this is a golang utility for working with recti-linear textures and images that we would like to project stereographically with a conformal mapping.
- A tool that stitches images in a directory into a texture2Darray
The tool works with a process in unwrapping in blender where we would take the following steps:
- Add a UV Sphere
- Enter Edit Mode
- Alt + Left Click to Select Edge Loop Around the Equator
- Edges -> Mark Seam
- Enter UV Editor
- Ctrl + A Select all Sphere Points
- U Unwrap Vertices (Should give us a hemisphere)
By apply default mode conformal projection (linear) to a rectilinear texture we can map it to this sphere without any distortion. Note that on a disk:
go install github.com/andewx/unity-image
Installs ./unity-image
, typically your /usr/local/bin
or wherever your $GOBIN
path is assigned.
This tool has some useful options for dealing with textures as assets and formatting them for use in projects. Our tool mapped rectilinear textures to hemisphere projections. But also includes the unity-mask
pbr tool for combining multiple image channels effortlessly and a tex2darray
feature which will combine all images in a directory and produce a texture grid which can be passed to different projects.
Unstable Release
- Linear Magnitude projection - where the equatorial distorition is linear [default]
- Quadratic -
$x^2$ projection [-q]. This will stretch the texture by a factor along its mapped radial - Cubic -
$x^3$ projection [-c] - Log - natural log projection [-ln]
- Exp - Exponential projection. [-x]
- h - Shows help
- hemi <hemi_options> hyperbolic projection
- s <float_scale> - scales hyperbolic projection
- l - logs projection coordinates
- c - cubic projection
- q - quadratic projection
- ln - log mode
- x - exponential mode
- tex2darray <output_file> produces flipbook for images of same width height
- umask <r_file> <g_file> <b_file> <a_file> <output_file> Creates a mask from multiple grayscale images as channels for an RGBA png image
This project likely will just be issued as is but if there are any suggestions or issues I will gladly handle them.
unity-image inputfile.png example.png -ln