about
Installation
Unzip the contents of the zip into your vvvv\packs folder (e.g aside DX11).
Usage
Check 'Example 0 - Simple DX9' for example on usage
If it doesn't work. let me know asap :)
Notes
Depth testing threshold
Depending on the scale of your scene, you may need to tweak the 'threshold' pin of the TestShadows node inside PreviewCoverage. A value of 0.01 seems to work well for scenes of about 1 to 10 units in size. E.g. if you measure your scene in mm's, or you're projecting onto a 100m wide building, you may need to increase this value to get useful results.
16 Projector limit
The shader code supports up to 16 projectors. If you need more, please look inside the PreviewCoverage module for notes.
What actually is it doing?
- We define a spread of projectors as ViewProjection transforms (i.e. if you were to attach this transform to a renderer, it would give you a 1:1 rendering from the projector's perspective, hint: don't use AspectRatio node)
- We use these transforms to render a depth map of the scene from the perspective of each projector
- We then render the scene from an interactive inspection camera (the final renderer). In this render, we apply a shader to every object which the projectors should be seen to act upon. This shader performs calculations of:
- Projector coverage (accounting for shadows, projector frustum shape)
- Brightness per surface area (accounting for 1/r^2 falloff, normal of surface with respect to projector, user selected projector amplitude constant)
- If we set the depth testing threshold very low (see note 'Depth testing threshold' above, we can also see the tearing of individual pixels
Changelog
v2 27-08-2012
- Fixed bug with Transform being reversed
- Included Table example (which won't work until Table is in the addonpack)
its so just in time. thanks :D
obviously a dx11 version would make sense nowadays :)
thnx elliot, this is really great. i looked into the depth render subpatch and blended the depth texture with some of my own visuals.
I know i am doing it the faky way because i know you are using the depthrender in order to factor in the distance to brightness relationship. but I couldnt see any other way to actually project dx9 textures, like the old projected texture contribution. hence everything is in blau.
the 3d model is something made with rhion + grasshopper, as a side note.
any hints at how i can modify it so that i can also bring in dx9 textures ? only because I want to actually redesign some elements you see in this facade applciation to work better with projections...
@youngjae you need to use the output from the transform at the top of the patch as an input to your projected texture shader try projector-(ex9.effect)
Think that will work with it...
Would be great if the brightness of each projector's projected depth map scaled with the throw of it's lens - how concentrated the light is
@mrboni - yes this is currently glitchy (changing the throw ratio scales the brightness incorrectly)
also ideally we should be able to apply a logarithmic brightness addition (to make it closer to perceptual).
one of the reasons to go vvvv is little cool helppatches like this!!! thx for sharing