← Back

ofxSurfingDepthMap

github.com/moebiussurfing/ofxSurfingDepthMap · @moebiussurfing
OF 0.12 Releases Shaders 3D / Point Cloud Graphics

Real-time depth map generation addon for openFrameworks, optimized for ControlNet depth processing and AI image generation workflows.

5 0 Last commit 6mo ago Created 1y ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

dev 5 commits ahead · last commit 8mo ago

README

ofxSurfingDepthMap



Depth-map shader based add-on. Developed for seamless OF scenes integration with AI workflows and real-time 3D applications.



Features



Quick Start



// ofApp.h

include "ofxSurfingDepthMap.h"

ofxSurfingDepthMap depthMap; ofEasyCam camera; //-- // ofApp.cpp // setup() depthMap.setup(&camera); // draw() depthMap.begin(); { camera.begin(); { // Draw your 3D scene here drawScene(); } camera.end(); } depthMap.end(); depthMap.draw(0, 0);


Depth Modes



1. Linear Mode

Direct linear mapping from near to far planes. Best for simple scenes with uniform depth distribution.

2. Logarithmic Mode

Applies logarithmic curve for better perspective handling. Use Log Power parameter to control curve aggressiveness (0.05 = subtle, 10.0 = extreme).

3. Focus Range Mode

Concentrates contrast in a specific depth range, compressing everything else. Perfect for emphasizing specific subjects while de-emphasizing background/foreground.

Key Parameters



Camera Clips

Focus Range

Depth Tone

Example Controls



Workflow Tips



1. Start with Linear mode for quick setup 2. Enable Manual Clips for precise depth control (camera clips are often suboptimal) 3. Use Logarithmic mode when linear produces flat gray areas 4. Try Focus Range + Auto Focus for complex scenes with specific subjects 5. Adjust Contrast and Gamma after selecting the right mode

Technical Notes



Installation



1. Clone to openFrameworks/addons/ 2. Add the addon to your project when using Project Generator 3. Copy depth.vert and depth.frag to bin/data/shadersGL3/ 4. Include ofxSurfingDepthMap.h in your project

Dependencies



Tested Systems

Use Cases



ComfyUI Flux. DepthMap to render

<img width="512" height="512" alt="depthmap_2026-02-20-15-59-14-645" src="https://github.com/user-attachments/assets/20f1f9d5-148b-4972-b45f-f965b873f98b" /> <img width="512" height="512" alt="ComfyUI_00010_" src="https://github.com/user-attachments/assets/0f00207f-8d56-4fcf-837d-fcb1d467bde8" /> <img width="512" height="925.957" alt="Flux2-Klein_00021_" src="https://github.com/user-attachments/assets/c6a2fa7d-6964-4b3a-99b2-12044310677d" />

TODO

Get this addon

HTTPS
SSH

Latest release

0.1 published 1y ago