Skip to content

theCosmicCrafter/scope-cosmic-vfx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmic VFX Plugin for Daydream Scope

Real-time visual effects plugin for Daydream Scope with 30 GPU-accelerated shaders across 10 effect categories. Features MOSH Pro-style effect stacking, animated shaders, and full slider control. Runs as a postprocessor.


Quick Start

  1. Install the plugin (from the Scope directory):

    uv run daydream-scope install -e /path/to/vfx-suite
  2. Start Scope:

    uv run daydream-scope --host 127.0.0.1 --port 8053 -N
  3. Open http://localhost:8053, select Cosmic VFX as your preprocessor or postprocessor, toggle on the effects you want, and start streaming.


How Stacking Works

Cosmic VFX lets you run multiple effects at the same time, layered on top of each other — just like MOSH Pro.

Each of the 10 effect categories has two controls:

  • Enable Toggle — Turns the category ON or OFF
  • Shader Dropdown — Picks which variant of that effect to use

When multiple categories are enabled, they apply in a fixed order. Each effect processes the output of the previous one:

Glitch → Retro → Distortion → Color → Blend → Edge → Blur → Generative → Atmospheric → Utility

Only enabled categories run. Disabled ones are skipped entirely.

Example: Single Effect

Turn on Enable Retro, set Retro Shader → "crt".

Result: Rolling CRT scanlines over your video. Nothing else runs.

Example: Three Effects Stacked

Turn on Enable Glitch, set Glitch Shader → "rgb-split" Turn on Enable Retro, set Retro Shader → "crt" Turn on Enable Atmospheric, set Atmospheric Shader → "bloom"

Result: RGB channel split runs first, then CRT scanlines are applied on top of the glitched image, then bloom adds light bleed to the combined result.

Example: Color Grade + Edge Glow

Turn on Enable Color, set Color Shader → "grade" Turn on Enable Edge, set Edge Shader → "neon"

Result: Shadow/highlight color grading first, then neon-colored edge outlines on the graded image.

Tips

  • Order matters. Glitch always runs before Retro, Retro before Distortion, etc. You can't reorder them.
  • Start with one effect and add more. Stacking too many can get heavy.
  • Intensity affects everything. Turn it down if stacked effects are too strong.
  • Speed controls all animations. CRT roll speed, glitch flicker rate, wave scroll — all tied to the Speed slider.

Effect Categories

Glitch — Digital artifacts and data corruption

Variant What It Does
basic Random horizontal color bands that shift each frame, like corrupted video data
rgb-split Separates the red, green, and blue channels with an animated horizontal offset
scanline Displaces horizontal bands of pixels, creating a broken-signal look

All glitch effects are animated — they change every frame based on the Speed slider.

Retro — Vintage video and old-school displays

Variant What It Does
vhs VHS tape look with rolling noise bands, static grain, and a tracking bar that scrolls down
crt CRT monitor scanlines that roll vertically with slight horizontal wobble
pixelate Reduces the image to large mosaic blocks that pulse in size

Distortion — Warp and bend the image

Variant What It Does
wave Animated sine wave ripple that scrolls across the image. Scale controls wave size
pinch Squeezes the image toward the center, like looking through a convex lens
barrel Fisheye/barrel lens distortion that bows the image outward from center

Pinch and barrel pulse gently with time. Wave scrolls continuously.

Color — Hue, saturation, and tone adjustments

Variant What It Does
hueshift Rotates the entire color wheel. Use the Hue Shift slider to control the rotation amount
saturate Boosts or drains color. Use the Saturation slider (0 = grayscale, 2 = vivid)
grade Tints shadows cool (blue) and highlights warm (orange) for a cinematic color grade

Blend — Layer compositing modes

Variant What It Does
screen Lightens the image by screening it with itself. Good for a washed-out dreamy look
multiply Darkens the image by multiplying with itself. Deepens shadows and contrast
overlay Boosts contrast — darks get darker, lights get lighter

Edge — Detect and highlight outlines

Variant What It Does
sobel Classic Sobel edge detection showing gradient edges as bright lines on dark
outline Clean white outlines on a black background, like a sketch filter
neon Colored glowing edges — edges are tinted with the original image colors and brightened

Edge detection uses GPU-accelerated convolution (conv2d with Sobel kernels), not pixel loops.

Blur — Soften and smooth

Variant What It Does
gaussian Even soft blur in all directions. Scale controls blur radius
motion Horizontal directional blur, like fast camera movement
radial Zoom blur radiating from the center outward

Generative — Procedural patterns overlaid on video

Variant What It Does
noise Animated random static grain blended over the image
pattern Scrolling sine wave grid pattern that moves with time
fractal Layered organic fractal shapes that drift and evolve

All generative effects are animated and controlled by Speed and Scale.

Atmospheric — Ambient lighting and fog

Variant What It Does
fog Adds a haze/mist layer that drifts across the image over time
glow Pulsing shimmer on bright areas — highlights breathe in and out
bloom Light bleed from bright areas into surrounding pixels, like an overexposed camera

Utility — Basic image processing tools

Variant What It Does
invert Flips all colors — white becomes black, red becomes cyan, etc.
posterize Reduces the image to fewer color levels for a flat graphic look
threshold Converts to pure black and white based on a brightness cutoff

Controls Reference

Effect Toggles (10 toggles)

Each toggle activates one effect category. The dropdown next to it picks the variant.

Toggle What It Enables
Enable Glitch Digital artifacts and data corruption effects
Enable Retro Vintage video and old-school display looks
Enable Distortion Warp and bend the image geometry
Enable Color Hue, saturation, and tone adjustments
Enable Blend Layer compositing and mixing modes
Enable Edge Detect and highlight edges and outlines
Enable Blur Soften and smooth the image
Enable Generative Procedural patterns and textures overlaid on video
Enable Atmospheric Ambient lighting, fog, and glow effects
Enable Utility Basic image processing and color tools

Global Sliders (7 controls)

These affect all active effects simultaneously.

Control Range Default What It Does
Intensity 0.0 – 2.0 1.0 How strong the effect is. 0 = no visible effect, 1 = normal, 2 = maximum. Affects every shader
Speed 0.0 – 3.0 1.0 How fast animations move. Controls CRT scanline roll, glitch flicker, wave scroll, fog drift, glow pulse, etc. Set to 0 to freeze all animations
Scale 0.1 – 5.0 1.0 Size of the effect. Larger values = bigger distortion waves, wider blur, larger generative patterns
Hue Shift -1.0 – 1.0 0.0 Rotates the color wheel. Only active when Color category is enabled with "hueshift" variant. -1 and 1 = full rotation
Saturation 0.0 – 2.0 1.0 Color richness. Only active when Color category is enabled with "saturate" variant. 0 = grayscale, 2 = vivid
Brightness 0.0 – 2.0 1.0 Final output brightness multiplier. Always applies to the final result regardless of which effects are active
Blend Mode normal / screen / multiply / overlay normal How the final stacked result composites over the original frame. "normal" = direct replacement

Preprocessor vs. Postprocessor

Cosmic VFX registers as both. Where you place it changes how the AI interacts with your effects:

Mode What Happens Best For
Preprocessor Effects are applied to your camera/input before the AI processes it. The AI sees and reacts to your effects. Feeding glitched or distorted input to influence AI generation
Postprocessor Effects are applied to the AI's output after generation. The AI never sees the effects. Adding polish — bloom, color grading, edge glow on top of clean AI output

You can use both at once: one Cosmic VFX instance as preprocessor (e.g., distortion to warp the AI's input) and another as postprocessor (e.g., color grading on the output).


Installation

From GitHub (Recommended)

uv run daydream-scope install https://github.com/theCosmicCrafter/scope-cosmic-vfx

Or paste the URL into the Plugins → Install field in the Scope desktop app.

Editable Install (For Development)

uv run daydream-scope install -e /path/to/vfx-suite

Code changes take effect on server restart without reinstalling.

Verify

uv run daydream-scope plugins

You should see scope-cosmic-vfx in the list.


How Stacking Works (Technical)

Pipeline receives a video frame tensor (T, H, W, C) in [0, 255] range.
Normalizes to [0, 1] float32.

Iterates categories in fixed order:
  for cat in [glitch, retro, distortion, color, blend, edge, blur, generative, atmospheric, utility]:
      if enable_{cat} is True:
          variant = kwargs[f"{cat}_shader"]
          result = _apply_{cat}(result, variant, intensity, time, scale, ...)

Each _apply method:
  1. Computes the effect on the current result tensor
  2. Blends with intensity: result = original * (1 - intensity) + effect * intensity
  3. Returns the modified tensor for the next category

After all categories:
  - Applies global blend mode compositing (if not "normal")
  - Multiplies by brightness
  - Clamps to [0, 1]
  - Returns {"video": result}

Time is derived from an internal frame counter multiplied by the Speed slider. This drives all animations — CRT roll, glitch randomization, wave phase, fog drift, glow pulse, etc.


Development

Project Structure

vfx-suite/
├── pyproject.toml          # Package metadata and entry point
├── README.md
├── LICENSE
└── src/
    └── scope_cosmic_vfx/
        ├── __init__.py     # Plugin hook — registers pipeline with Scope
        ├── schema.py       # UI controls — toggles, dropdowns, sliders
        └── pipeline.py     # Shader implementations and frame processing

Adding a New Shader Variant

  1. Add the variant name to the category's Literal type in schema.py:

    GlitchShader = Literal["basic", "rgb-split", "scanline", "my-new-variant"]
  2. Add a branch in the category's _apply_* method in pipeline.py:

    elif variant == "my-new-variant":
        # Your effect code here
  3. Restart the server — the new option appears in the dropdown automatically.

Adding a New Category

  1. In schema.py: Create a Literal type, add enable_newcat toggle and newcat_shader dropdown
  2. In pipeline.py: Add "newcat" to _CATEGORY_ORDER, add elif cat == "newcat" branch, implement _apply_newcat

Troubleshooting

Issue Fix
Plugin not in dropdown Run uv run daydream-scope plugins to verify installation
No effect visible At least one enable_* toggle must be ON
Wrong shader running Make sure the category's enable toggle is ON — the dropdown alone does nothing
Output is black Check that __call__ returns {"video": tensor.clamp(0, 1)}
Output is blown out Turn down Brightness or Intensity
Port already in use Kill the old server process or use a different --port
Controls not showing in UI Fields must use ui_field_config() — plain dicts are invisible

License

MIT — See LICENSE file for details.

Resources

About

Real-time visual effects plugin for [Daydream Scope](https://github.com/daydreamlive/scope) with **30 GPU-accelerated shaders** across **10 effect categories**. Features **MOSH Pro-style effect stacking**, animated shaders, and full slider control. Works as both a **preprocessor** and **postprocessor**.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages