GPU Texture Baking Tool

Overview

fornos

GPU Texture Baking Tool

A fast and simple tool to bake your high-poly mesh details to textures.

Bakers

Mesh formats

  • Wavefront OBJ

Image formats

  • PNG
  • TGA
  • EXR

Usage

Common steps

1. Select a low poly mesh file to bake to

This is the "destination" mesh. It must have UV coordinates and normal data.

The UV coordinates will be used to generate the baked meshes.

The normal data is used to map points from the low-poly mesh to the high-poly mesh. It is better to use "smooth" or per-vertex normals as per-face normals can produce mappings with gaps depending on the topology.

Normals can be computed by fornos if "compute per face" or "compute per vertex" is selected.

2. Select a high poly mesh file to bake from

This is te "target" mesh. Your high resolution mesh where the details will be extracted from.

UV coordinates are not required but normals are necessary by some of the bakers (normals, ambient occlusion, bent normals and thickness)

3. Select a target texture size

This is the size of all textures baked

4. Enable any bakers

Check the box on the right of any of the bakers to enable them for the baking process.

It is also necessary to select a destination file for the result of the baker. Expand the baker options by clicking on the bar and select your file. Remember to enable the baker before.

5. Configure the bakers options

Each baker is explained in detail below

6. Bake!

Click the bake button.

This will go through different steps, from generating a map of your low-poly mesh to process each baker. After that you will have your shinning new textures.

Height baker

Creates a height map with the differences between your low-poly and hi-poly meshes.

Supports 8-bit (PNG and TGA) and EXR file formats as outputs.

Position baker

Creates an image with the mapped positions in the high-poly mesh.

This is useful for some processing tools like Unity3d's Delighting Tool.

Only EXR file format is supported as output.

Normals baker

Creates a normal map.

If 8-bit format for the output is used the values will be stored as (value * 0.5 + 0.5). This is the format most engines will expect. If an EXR file is used the values will not be transformed.

Tangent space: If checked the normals will be transformed to tangent space. The output will be ino bject space otherwise.

Ambient Occlusion baker

Computes the ratio of occluders in a number of samples for a cosine weighted hemisphere. A.k.a. your usual ambient occlusion map.

Supports 8-bit (PNG and TGA) and EXR file formats as outputs.

Sample count: Number of samples used for each pixel. The greater the number, the better and the slower.

Min distance: Minimum distance to consider an occluder. In mesh units.

Max distance: Maximum distance to consider an occluder. In mesh units.

Bent Normals baker

Bent normals are the average direction of the ambient light.

This is computed as an average of the direction of the non occluded rays, very similar as how ambient occlusion is computed.

For correct visualization engines usually requires matching parameters between ambient occlusion and bent normals.

More information about bent normals in the Unreal Engine documentation.

If 8-bit format for the output is used the values will be stored as (value * 0.5 + 0.5). This is the format most engines will expect. If an EXR file is used the values will not be transformed.

Sample count: Number of samples used for each pixel.

Min distance: Minimum distance to consider an occluder. In mesh units.

Max distance: Maximum distance to consider an occluder. In mesh units.

Thickness baker

Generates a map of how thick is in average the mesh for a point in the surface.

This map is useful for translucency and sub-surface scattering effects.

Supports 8-bit (PNG and TGA) and EXR file formats as outputs.

Sample count: Number of samples used for each pixel.

Min distance: Distance for the thickness value to be zero. In mesh units.

Max distance: Distance for the thickness value to be one. In mesh units.

Known issues

The current project is at an usable state but as a very early preview. Crashes can be expected, memory consumption can be high for large textures or big meshes, and there is barely any error reporting to the user.

Ackownledgements

This project is possible thanks to the following libraries:

Most of the intersection algorithms comes from Game Physics Cookbook

You might also like...
Driver layer GPU libraries and tests for PSP2

PVR_PSP2 Driver layer GPU libraries and tests for PSP2 Currently this project include: Common and PSP2-specific GPU driver headers. Extension library

A easy-to-use image processing library accelerated with CUDA on GPU.

gpucv Have you used OpenCV on your CPU, and wanted to run it on GPU. Did you try installing OpenCV and get frustrated with its installation. Fret not

GPU ray tracing framework using NVIDIA OptiX 7
GPU ray tracing framework using NVIDIA OptiX 7

GPU ray tracing framework using NVIDIA OptiX 7

a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.
a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.

a fast and user-friendly runtime for transformer inference (Bert, Albert, GPT2, Decoders, etc) on CPU and GPU.

GPU miner for TON

"Soft" Pull Request rules Thou shall not merge your own PRs, at least one person should review the PR and merge it (4-eyes rule) Thou shall make sure

Hardware-accelerated DNN model inference ROS2 packages using NVIDIA Triton/TensorRT for both Jetson and x86_64 with CUDA-capable GPU.
Hardware-accelerated DNN model inference ROS2 packages using NVIDIA Triton/TensorRT for both Jetson and x86_64 with CUDA-capable GPU.

Isaac ROS DNN Inference Overview This repository provides two NVIDIA GPU-accelerated ROS2 nodes that perform deep learning inference using custom mode

An efficient C++17 GPU numerical computing library with Python-like syntax
An efficient C++17 GPU numerical computing library with Python-like syntax

MatX - Matrix Primitives Library MatX is a modern C++ library for numerical computing on NVIDIA GPUs. Near-native performance can be achieved while us

Code generation for automatic differentiation with GPU support.

Code generation for automatic differentiation with GPU support.

Docker files and scripts to setup and run VINS-FUSION-gpu on NVIDIA jetson boards inside a docker container.

jetson_vins_fusion_docker This repository provides Docker files and scripts to easily setup and run VINS-FUSION-gpu on NVIDIA jetson boards inside a d

Comments
  • Software fail with Bake button pressed

    Software fail with Bake button pressed

    The application closes when I press the Bake button, without any message. I have Windows 8.1 and AMD Radeon graphics card in Intel Core 7. On Intel 4000 graphics card also does not run.

    sem titulo-2

    opened by kybio 0
  • Vertex Colors with Wavefront OBJ

    Vertex Colors with Wavefront OBJ

    One idea would be to include vertex color to capture meshes with colors, Meshlab saves .obj files with colors.

    Link:https://gamedev.stackexchange.com/questions/21303/how-can-i-include-vertex-color-information-in-obj-files

    There does exist a flavour of Wavefront's *.obj that facilitates Vertex Coloring.. I know of two applications that can export these namely "MeshLab" (free) and "MeshMixer" (also free from Autodesk).. The vertex colours is actually found just after each vertex definition as shown below..

    (Piece of *.obj)

    ///////////////////////////////////////////////////////////////////////////////////// OBJ File Generated by Meshlab

    Object VERTEXPAINT_004_OBJ.obj

    Vertices: 284 Faces: 281

    mtllib ./VERTEXPAINT_004_OBJ.obj.mtl

    vn 0.029683 0.730087 -0.682709 v 1220.094482 -572.500000 177.713943 0.984314 0.764706 1.000000

    "3 vals for Vert and 3 vals for Col"

    vn 0.000000 0.858139 -0.513418 v 1291.571533 -609.439636 -28.628490 0.921569 0.219608 1.000000 vn 0.303129 0.896367 -0.323480

    opened by kybio 0
  • Is work count being calculated correctly?

    Is work count being calculated correctly?

    Hello, maybe i'm confusing something, but i was reading Fornos code and i think i have found a little problem:

    This line of code: https://github.com/caosdoar/Fornos/blob/75e8ec52d7a2e834e9eb193de18c5d5397e32f00/Src/meshmapping.cpp#L165 calculates the total work that the shader must do, but isn't it going to force an index out of range(which is silently suppresed in the shader)?

    Here for example:

    uint gid = gl_GlobalInvocationID.x + workOffset;
    if (gid >= workCount) return;
    Pix pix = pixels[gid];
    

    But the size of pixels is less than workCount:

    workCount = ((map->positions.size() + k_groupSize - 1) / k_groupSize) * k_groupSize;
    sixeOfPixels = map->positions.size();
    

    So if map->positions.size() is not a multiple of k_groupSize, then in some point there will be an index out of range because this: if (gid >= workCount) return; will not be evaluated while gid >= sizeOfPixels is true.

    opened by shoxsz 0
Releases(v0.1.1)
Owner
Oscar Sebio Cajaraville
Oscar Sebio Cajaraville
4eisa40 GPU computing : exploiting the GPU to execute advanced simulations

GPU-computing 4eisa40 GPU computing : exploiting the GPU to execute advanced simulations Activities Parallel programming Algorithms Image processing O

Ecam 4MIN repositories 2 Jan 10, 2022
NVIDIA Texture Tools samples for compression, image processing, and decompression.

NVTT 3 Samples This repository contains a number of samples showing how to use NVTT 3, a GPU-accelerated texture compression and image processing libr

NVIDIA DesignWorks Samples 33 Dec 20, 2022
A GPU (CUDA) based Artificial Neural Network library

Updates - 05/10/2017: Added a new example The program "image_generator" is located in the "/src/examples" subdirectory and was submitted by Ben Bogart

Daniel Frenzel 93 Dec 10, 2022
Tensors and Dynamic neural networks in Python with strong GPU acceleration

PyTorch is a Python package that provides two high-level features: Tensor computation (like NumPy) with strong GPU acceleration Deep neural networks b

null 61.4k Jan 4, 2023
GPU Cloth TOP in TouchDesigner using CUDA-enabled NVIDIA Flex

This project demonstrates how to use NVIDIA FleX for GPU cloth simulation in a TouchDesigner Custom Operator. It also shows how to render dynamic meshes from the texture data using custom PBR GLSL material shaders inside TouchDesigner.

Vinícius Ginja 37 Jul 27, 2022
GPU PyTorch TOP in TouchDesigner with CUDA-enabled OpenCV

PyTorchTOP This project demonstrates how to use OpenCV with CUDA modules and PyTorch/LibTorch in a TouchDesigner Custom Operator. Building this projec

David 65 Jun 15, 2022
🐸 Coqui STT is an open source Speech-to-Text toolkit which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers

Coqui STT ( ?? STT) is an open-source deep-learning toolkit for training and deploying speech-to-text models. ?? STT is battle tested in both producti

Coqui.ai 1.7k Jan 2, 2023
A fast, scalable, high performance Gradient Boosting on Decision Trees library, used for ranking, classification, regression and other machine learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU.

Website | Documentation | Tutorials | Installation | Release Notes CatBoost is a machine learning method based on gradient boosting over decision tree

CatBoost 6.9k Dec 31, 2022
CTranslate2 is a fast inference engine for OpenNMT-py and OpenNMT-tf models supporting both CPU and GPU executio

CTranslate2 is a fast inference engine for OpenNMT-py and OpenNMT-tf models supporting both CPU and GPU execution. The goal is to provide comprehensive inference features and be the most efficient and cost-effective solution to deploy standard neural machine translation systems such as Transformer models.

OpenNMT 395 Jan 2, 2023