» Spatial Edge Blend shader
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

Spatial Edge Blend shader

effect
Credits: elliotwoods, colorsound, catweasel

about

This shader enables you to edge blend in 3D, which is especially useful for projection mapping. This is a bit of a 'kitchen sink' shader which includes some other useful bits for mapping as well.

Edge blending (aka Soft Edge) features

  • Blend region size / position
  • Blend direction unit vector input
  • RGB gamma adjustment

Other features

  • Bicubic filtering
  • Texture projection (for viewpoint matching)

Requirements:

  • Bicubic.fxh (needs to be in same dir as effect)
  • BicubicFilterKernel.hdr

To use

You need to edit the shader dependin on how many projectors you have.

Edit line #7 in the shader:

#define nRegions 3

and set nRegions to your number of projectors

Inputs

Set your blend vector to be the unit vector in the direction you want to blend in, e.g. if you're blending across the width of your sculpture, then chances are that you want the blend vector to be (1,0,0). This means that blends are cast across the x dimension.

Then set 'yBlends' (called 'Edge Blend Line' in the help patch) to the places where you want to blend.

Your renderer will need to have seperate viewports for each projector.
Check the help patch!

Also, if you want to project a texture onto the object using a projection matrix, then input your projection matrix into 'tProjection' as set 'useProjection' to 1.

download

_SpatialEdgeBlendPolar_ViewPort_TArray.zip
23.03.16 [11:54 UTC] by colorsound | 1031 downloads
Manual Slicing by T,B,L,R,Polar Version,Independent blend width per side,new help patches,Spanmode&DualMode versions
Show 4 older revisions

Older Revisions

SpatialEdgeBlend (DX11).zip
04.04.13 [12:06 UTC] by colorsound | 976 downloads
DX11 Version
SpatialEdgeBlend (EX9.Effect).zip
08.08.12 [12:54 UTC] by colorsound | 849 downloads
some bugfixes, tidying up code , updated help patch
SpatialEdgeBlend.zip
15.01.12 [23:19 UTC] by u7angel | 719 downloads
fixed for beta27
SpatialEdgeBlend.zip
25.09.10 [12:45 UTC] by elliotwoods | 1113 downloads
Shader file and help patch

sugokuGENKI 25/09/2010 - 12:57

P.S. for calibration,
it's good to input a grid texture, set useProjection to 1, and not use anyting on tProjector.
That way, your grid will be projected directly in x,y onto your object, so you can calibrate.

P.S. This shader generally presumes that all your projectors are in a line facing towards your target.
It doesn't deal with multiple projectors that inwards / outwards onto a scene.

sunep 15/01/2012 - 17:30

I get the error "failed to open 'Bucubic.fxh'"

woei 15/01/2012 - 20:03

correcting line 57 from

#include "Bicubic.fxh"

to

#include <effects\Bicubic.fxh>

will reference the vvvv included .fxh file and thus throw no error

io 29/10/2012 - 21:20

ATI HD6970 the Gamma settings don t seem to have any effect. Didn t have the time to look into the shader for the usual suspects, any take on this?
Simone

io 31/10/2012 - 13:12

yay! There a commented out line which works for ATI :

//return factorbottom * factortop;
 
    return pow(factortop * factorbottom, gammaRGB);
io 02/11/2012 - 00:19

Now, the next step would be a dynamic gamma correction.
Not sure but you should be able to input 4 RGB parameters, for RGB and probably for full white, that would be a projector/lamp color footprint. Based on this footprint a gamma correction should be calculated for every pixel that is shared among more than one viewport.
S.

isdzaurov 24/03/2016 - 16:05

eeeeh cool!

anonymous user login

Shoutbox

~8h ago

joreg: Webinar on October 2nd: Rhino meets Realtime with vvvv https://visualprogramming.net/blog/2024/webinar-rhino-meets-realtime-with-vvvv/

~11h ago

joreg: 12-session online vvvv beginner course starting October 7th: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-class/

~6d ago

joreg: Introducing: Support for latest Ultraleap hand-tracking devices: https://visualprogramming.net/blog/2024/introducing-support-for-new-ultraleap-devices/

~9d ago

joreg: 2 day vvvv/fuse workshop in Vienna as part of NOISE festival on Sept. 13 and 14: https://www.noise.ist/vienna

~20d ago

joreg: New beginner video tutorial: World Cities https://youtu.be/ymzrK7tZLBI

~20d ago

catweasel: https://colour-burst.com/2023/01/26/macroscopic/ yeah, ' is there anyone who cares about slides anymore...' Well me for a start! :D

~29d ago

ventolinmono: The ELMO TRV-35 slides into your video feed > https://youtu.be/pcIM9mh1c9k?si=iB4FOfI2D6y0iETy

~1mth ago

joreg: The summer season of vvvv workshops is now complete, but you can still get access to all the recordings: https://thenodeinstitute.org/ss24-vvvv-intermediates/

~2mth ago

~2mth ago

joreg: Workshop on 01 08: Augmented Reality using OpenCV, signup here: https://thenodeinstitute.org/courses/ss24-vvvv-augmented-reality-using-opencv-in-vvvv/