Nodes/kubakub nodes/kubakub scene preview
ComfyUI Node

kubakub scene preview

See the projection from the pavement, before you hire the projector

By kubakubkub·Created about a month ago·Updated 2 days ago· 10
kubakub scene preview
  • scene
  • matrix
  • background
  • clay_color
  • viewer
  • preview
  • shadow
  • views
  • report
  • scene
◄spots0, 20, 1.7 -15, 12, 1.7 12, 8, 1.7►
◄lens_mm20►
◄width1280►
◄height720►
◄ambient0.15►
◄gain1.00►
◄physical1.00►
◄shaderclay►

You've made content that looks fantastic in the preview window. Then you stand on the pavement, forty degrees off axis, and discover that the right third of the building is in shadow, the window reveals swallow their detail, and you can see the projector's own beam edge. kubakub scene preview is the node that shows you that before you rent anything.

It takes your matrix - a still or a batch of video frames - projects it from the file's camera onto the 3D model, and renders the result from wherever the audience is standing. Anything the projector can't reach stays at the ambient level, so projection shadow is visible as darkness rather than as a surprise.

Inputs

scene comes from kubakub scene render.

spots is the interesting one: one audience position per line, as x, distance, eye height in metres, where x is measured along the wall from the frame centre. The default has three - centred, left and right, at realistic viewing distances. Each spot is one Blender render, cached, so adding a fourth spot costs one render, not a re-render of the whole graph.

lens_mm (default 20) is the audience camera's focal length on a 36 mm sensor. 20 mm is wide - you're standing in the street; 35 mm is what a phone sees.

width / height (1280×720 default) is per audience view.

ambient (0.15) is how bright the unlit building stays. This is the honesty knob: set it to 1 and everything looks evenly lit and magnificent, entirely wrong. Leave it dark and the previz looks like the real thing at night.

gain scales the projected picture's brightness. physical (default 1) applies real projector falloff - surfaces far away or hit at a steep angle get darker. Set physical to 0 for a flat, "does the content read" check, and back to 1 when you want to know whether that cornice will actually show anything.

Optionally connect matrix (a still or frames), a background image or frames that sit behind the building, and a viewer from kubakub scene measure, kubakub audience viewpoint or project settings - a connected viewer replaces the typed spots with one view from that exact spot.

clay_color and shader are the cheap wins. clay draws the model in a flat light grey; wireframe draws the edges as lines in the clay colour on black; clay + wireframe overlays them. Because those lines come from passes the view already computed, switching shader or colour re-renders nothing. clay_color set near the stone's own colour is the difference between a previz that reads as your building and a generic grey box.

Outputs

preview is the money shot: per spot, all frames - a spot-major batch, so if you connect 25 frames and 3 spots, you get 75 images grouped by spot, not interleaved. Know that before you wire it into a video node with a per-spot grid in mind.

shadow is the useful one nobody thinks to connect. Per spot, it's a mask of 1 where the audience sees building and the projector doesn't reach it. On the pack's 3200×2160 test facade, viewing from 12–15 m off-axis puts roughly 10–16% of the visible building in projection shadow. That's a real chunk of wall, and knowing where it is changes the content - flat pattern there, or embrace it as a design element.

views gives you the clay views per spot with no projection at all - the control image, handy for compositing a still of the building into a client doc. report per spot: how much of the view is building, how much the projector misses. scene hands the scene forward with these viewpoints attached - connect it to kubakub scene relight with camera = previz and you get the same spot, same lens, same size, but lit in Cycles instead of shaded in the viewport.

Install

cd ComfyUI/custom_nodes && git clone https://github.com/kubakubkub/ComfyUI_KubaNodes
python -m pip install -r ComfyUI_KubaNodes/requirements.txt

This is Blender territory: Blender 4.x must be installed (the pack finds it in C:\Program Files\Blender Foundation, or you point at it via blender_path or blender = ... in kubakub.ini). The node runs it headless as a subprocess. One thing people don't realise: the per-spot projection lookup is computed once, so adding frames is cheap - a video matrix costs one remap per frame, not one render per frame.

Traps

If the projected picture looks washed out and you're using kubakub scene relight downstream rather than this node, the culprit is often tone mapping there - AgX bleaches bright projections toward white. In this node the equivalent lesson is ambient and physical: both have defaults that are deliberately unflattering, and people "fix" them, then get surprised on the night.

And the classic: a previz of a building alone, floating in the void. Add kubakub scene surroundings between scene render and this node and the neighbours appear - grey boxes, context only, but they change the read of the whole shot, and they catch the light that makes the building sit in a street instead of a vacuum.

Categorykubakub/3d/scene

Inputs (13)

NameTypeDefaultDescription
sceneKUBA_SCENEFrom kubakub scene render.
spotsSTRING0, 20, 1.7 -15, 12, 1.7 12, 8, 1.7Where the audience stands. Place the spots on the plan below: click = a new spot, drag = move it, wheel over it = eye height, double click = remove. The text is the same thing in numbers, one spot per line: metres along the wall from its middle, metres away from the wall, eye height.
lens_mmFLOAT206–300Audience camera lens (36 mm sensor); 20 = wide, 35 = natural.
widthINT128064–8192Width of each audience view, in pixels.
heightINT72064–8192Height of each audience view, in pixels.
ambientFLOAT0.150–1Brightness of the unlit building (clay) around the projection.
gainFLOAT1.000–4Brightness of the projected image; 1 = as it is, 2 = twice as bright.
physicalFLOAT1.000–11 = surfaces hit at a steep angle or far away get darker, as with a real projector; 0 = flat.
matrixoptIMAGEMatrix image or frames (resized to the projection view if needed). Nothing connected: the clay views alone, without a picture.
backgroundoptIMAGEBehind the building (still or frames, looping), scaled to cover the view.
clay_coloroptCOLOR#f2f2f2Colour of the clay: the building and its surroundings where no picture lands. Almost white by default; pick the stone's colour for a closer look.
shaderoptCOMBOclayHow the model is drawn where no picture lands: clay, wireframe (its edges as lines in the clay colour, not dimmed by ambient) or clay with the edges on it.
vieweroptKUBA_VIEWERThe audience spot of kubakub scene measure / project settings, one spot for all nodes. Connected: it replaces the typed 'spots' (one view from there).

Outputs (5)

NameTypeDescription
previewIMAGEPer spot all frames (spot-major batch).
shadowMASKPer spot: building the audience sees but the projector misses.
viewsIMAGEPer spot the clay view (no projection).
reportSTRINGPer spot: how much of the view is building and how much of it the projector misses.
sceneKUBA_SCENEThe scene with these viewpoints (spots, lens, size) -> kubakub scene relight with camera = previz: the lit picture from the same spot.