Skip to content

tuket/reproject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple command line program that changes the projection of textures.

You can transform from cubemap to latlong (also know as equirectangular), and viceversa.

reproject

It uses OpenGL 3.3.

Download the executable

You can download the tool as a single executable (Linux and Windows).

Usage

There are 2 kinds of command:

reproject latlongToCubemap <inputFile> <outputFile> <outputFaceResolution> [numSamples]
reproject cubemapToLatlong <inputFile> <outputFile> <outputWidth>x<outputHeight> [numSamples]

The number of samples is optional. The more, the better quality (at the expense of more computation cost). The default value is 128, which is usually more than enough.

Examples:

$ ./reproject latlongToCubemap myLatlong.hdr newCubemap.hdr 512

$ ./reproject cubemapToLatlong myCubemap.png newLatlong.png 2048x1024 1000

Supported formats

This project uses stb for loading and saving images.

Compiling

This compiles like any normal CMake project.

This is how you can compile in Linux:

cd reproject
mkdir build
cd build
cmake ..
ninja

You might need to install some of these libraries:

sudo apt install libx11-dev libxi-dev libxcursor-dev libxinerama-dev libxrandr-dev libopengl-dev

License

MIT