# Blender Lighting

> A Claude skill from MAX-786/claude-3d-harness.

- **Type:** Skill
- **Install:** `agentstack add skill-max-786-claude-3d-harness-blender-lighting`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [MAX-786](https://agentstack.voostack.com/s/max-786)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [MAX-786](https://github.com/MAX-786)
- **Source:** https://github.com/MAX-786/claude-3d-harness/tree/main/library/gaius/blender-lighting

## Install

```sh
agentstack add skill-max-786-claude-3d-harness-blender-lighting
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Skill: Blender Lighting & Camera

Sei un esperto di fotografia 3D e compositing in Blender. Il tuo ruolo è
configurare luci, camera, world e color management per ottenere render
professionali — con particolare attenzione a:
- oggetti chiari/bianchi che si sovraespongono facilmente
- contrasto soggetto/sfondo per product shots
- fedeltà cromatica per materiali organici, porcellana, metallo

---

## CONNESSIONE — MCP (predefinito)

```python
mcp__Blender__execute_blender_code(code="""
import bpy
# ... codice di setup luci/camera ...
result = {"ok": True}
""")
```

---

## DIAGNOSI RAPIDA — Problemi Comuni

| Sintomo | Causa | Fix |
|---------|-------|-----|
| Oggetto bianco "bruciato", nessun dettaglio | exposure troppo alto, look sbagliato | exposure -0.4/-0.8, look "AgX - High Contrast" |
| Sfondo troppo simile al soggetto | world troppo chiaro | world strength 0.05-0.15, color (0.02,0.02,0.03) |
| Ombre troppo dure/nere | fill troppo debole | fill 12-25% dell'energia key, size grande (0.8-1.5m) |
| Ombre troppo morbide/flat | fill troppo forte o size troppo grande | fill  **AgX ha sostituito Filmic come default da Blender 4.0.** Filmic è deprecato.
> Differenze chiave:
> - AgX: highlights → bianco naturale (come una camera reale)
> - Filmic: colori saturi collassano in 6 tonalità ("Notorious Six") — artefatto visibile
> - AgX: migliore shadow detail su oggetti scuri
> - AgX: supporta Display P3 e BT.1886 oltre sRGB
>
> **Per file esistenti che usano Filmic:** `scene.view_settings.view_transform = "AgX"`

```python
def setup_color_management(scene,
                            exposure=0.0,
                            look="AgX - Punchy",
                            view_transform="AgX"):
    """
    Configura AgX color management (standard da Blender 4.0+).

    exposure:
      0.0   → neutro (default per oggetti a toni medi)
     -0.4   → oggetti bianchi/chiari (porcellana, carta)
     +0.1   → oggetti molto scuri (plastica nera, pelle scura)
     +0.3   → scena sottoesposta da schiarire

    look AgX:
      "None"                 → flat/raw, solo per compositing esterno
      "AgX - Base"           → neutro, fedele ai colori, uso tecnico
      "AgX - Punchy"         → contrasto naturale, product shot standard  ← PREFERITO
      "AgX - High Contrast"  → drammatico, nero profondo, electronics/tech
      "AgX - Very High Contrast" → pubblicità, estremo

    look Filmic (legacy — evitare):
      "Medium High Contrast", "High Contrast" — per file vecchi pre-4.0

    REGOLA AgX:
      oggetti bianchi/chiari → exposure -0.4 + "AgX - Punchy"
      oggetti medi           → exposure 0.0  + "AgX - Punchy"
      oggetti scuri (TV, metallo) → exposure +0.1 + "AgX - High Contrast"
      organico/pelle         → exposure 0.0  + "AgX - Punchy"
    """
    scene.view_settings.view_transform = view_transform
    scene.view_settings.look           = look
    scene.view_settings.exposure       = exposure
    scene.view_settings.gamma          = 1.0

# Preset rapidi AgX:
def cm_product_white(scene):
    """Porcellana bianca, carta, tessuti chiari."""
    setup_color_management(scene, exposure=-0.4, look="AgX - Punchy")

def cm_product_neutral(scene):
    """Oggetti a colori medi, legno, plastica colorata."""
    setup_color_management(scene, exposure=0.0, look="AgX - Punchy")

def cm_product_dark(scene):
    """Metallo scuro, plastica nera, electronics (TV, smartphone)."""
    setup_color_management(scene, exposure=0.1, look="AgX - High Contrast")

def cm_organic(scene):
    """Frutta, pelle, materiali organici (SSS richiede Cycles)."""
    setup_color_management(scene, exposure=0.0, look="AgX - Punchy")

def cm_architectural(scene):
    """Interni/esterni, luce naturale."""
    setup_color_management(scene, exposure=0.0, look="AgX - Punchy")
```

---

## WORLD / BACKGROUND

```python
def setup_world(scene,
                color=(0.03, 0.03, 0.04),
                strength=0.15,
                hdri_path=None):
    """
    Configura il world background.

    PRODUCT SHOT (piccoli oggetti, sfondo scuro):
      color=(0.02,0.02,0.03), strength=0.10-0.20
      → quasi nero, soggetto risalta, ombre non troppo lunghe

    STUDIO NEUTRO:
      color=(0.05,0.05,0.06), strength=0.20
      → grigio scuro neutro, non distrae

    AMBIENTE CALDO:
      color=(0.04,0.03,0.02), strength=0.15
      → leggero tono ambra, buono per legno e pelle

    HDRI (Cycles only — environment realistico):
      hdri_path = "/path/to/hdri.hdr"
      strength = 0.5-2.0

    ATTENZIONE: world strength alto + oggetto bianco = overexposure
    Regola: se exposure  Queste tecniche vengono da fotografia, cinema e animazione professionale.
> Ogni tecnica ha un **posizionamento preciso**, un **ratio key:fill** e
> un **effetto emotivo** definito. Scegliere in base al contenuto narrativo,
> non solo all'estetica.

### Mappa ratio emotivi (Key:Fill)

| Ratio | Tipo scena | Effetto emotivo | Esempi |
|-------|-----------|-----------------|--------|
| 1:1   | High-key | Allegro, commedia, pubblicità fresca | Spot yogurt, cartoon |
| 2:1   | Lifestyle | Naturale, documentaristico | Food editorial, moda casual |
| 3:1   | Drammatico | Carattere, tensione lieve | Ritratto, product premium |
| 4:1   | Dark-dramatic | Misterioso, intrigante | Thriller, parfum, automotive |
| 8:1+  | Low-key / Noir | Angoscia, suspense, potere | Villain, horror, dark art |

**Regola pratica**: il ratio segue l'arco emotivo — scene di gioia salgono verso 1:1,
scene di conflitto scendono verso 8:1+.

### Temperatura colore (standard professionale)

| Luce | Temperatura | Uso |
|------|------------|-----|
| Key  | 3200–4000 K (warm amber) | Sorgente principale — dona calore naturale |
| Fill | 5500–6500 K (daylight) | Riempimento neutro — non contrasta col key |
| Rim  | 6500–8000 K (cool blue)  | Separazione dal fondo — effetto "halo" |

```python
# Conversione K → RGB lineare (approssimazione pratica)
TEMP_COLORS = {
    "tungsten":  (1.00, 0.70, 0.42),   # 3200K — very warm
    "warm":      (1.00, 0.82, 0.63),   # 4000K — warm
    "daylight":  (1.00, 0.97, 0.90),   # 5500K — neutral warm
    "neutral":   (1.00, 1.00, 1.00),   # 6500K — D65 neutral
    "cool":      (0.90, 0.95, 1.00),   # 7000K — slightly cool (fill)
    "sky":       (0.75, 0.87, 1.00),   # 9000K — cool blue (rim/sky)
}
# Uso professionale:
#   key_color  = TEMP_COLORS["warm"]     # (1.00, 0.82, 0.63)
#   fill_color = TEMP_COLORS["cool"]     # (0.90, 0.95, 1.00)
#   rim_color  = TEMP_COLORS["sky"]      # (0.75, 0.87, 1.00)
```

### Tecniche Named — Posizionamento e Setup

```python
def light_rig_loop(obj_center=(0,0,0.04), subject_height=0.08):
    """
    LOOP LIGHTING — tecnica standard ritratto/product.
    Key: 45° orizzontale dal soggetto, 30-45° in alto.
    Fill: lato opposto, 60-90° orizzontale, basso.
    Rim: 120-135° dal key, altezza media.

    Ratio key:fill = 2:1 → naturale, bilanciato.
    Loop = piccola ombra a forma di loop sotto il naso (ritratto),
           o ombra morbida laterale (oggetti).

    Usa per: product shot standard, ritratto lifestyle, cibo casual.
    """
    cx, cy, cz = obj_center
    h = subject_height
    t = (cx, cy, cz + h * 0.5)  # target = centro soggetto

    key  = add_area("Loop_Key",  energy=120, size=0.35,
                    location=(cx - h*3.5, cy - h*3.5, cz + h*3.5),  # 45° hor, 45° vert
                    target=t, color=(1.00, 0.82, 0.63))  # warm 4000K

    fill = add_area("Loop_Fill", energy=60,  size=1.00,
                    location=(cx + h*4.0, cy - h*1.0, cz + h*1.5),  # lato opposto
                    target=t, color=(0.90, 0.95, 1.00))  # cool fill

    rim  = add_area("Loop_Rim",  energy=65,  size=0.15,
                    location=(cx + h*1.0, cy + h*4.5, cz + h*2.5),  # dietro
                    target=t, color=(0.75, 0.87, 1.00))  # sky cool

    return key, fill, rim

def light_rig_rembrandt(obj_center=(0,0,0.04), subject_height=0.08):
    """
    REMBRANDT LIGHTING — drammatico, carattere forte.
    Key: 45° laterale, 45° in alto (come loop ma più laterale).
    Fill: molto debole o assente (ratio 3:1 → 4:1).
    Rim: stesso lato del fill, evidenzia profilo.

    Effetto: triangolo di luce illuminato sulla guancia in ombra (ritratto).
    Ratio key:fill = 3:1-4:1 → drammatico.

    Usa per: ritratto carattere, villain, product premium, noir leggero.
    """
    cx, cy, cz = obj_center
    h = subject_height
    t = (cx, cy, cz + h * 0.5)

    key  = add_area("Remb_Key",  energy=150, size=0.30,
                    location=(cx - h*4.5, cy - h*2.0, cz + h*4.0),  # più laterale
                    target=t, color=(1.00, 0.80, 0.58))  # tungsten warm

    fill = add_area("Remb_Fill", energy=40,  size=1.20,
                    location=(cx + h*3.0, cy - h*0.5, cz + h*0.8),  # molto debole
                    target=t, color=(0.90, 0.95, 1.00))

    rim  = add_area("Remb_Rim",  energy=80,  size=0.15,
                    location=(cx + h*2.0, cy + h*4.0, cz + h*2.0),
                    target=t, color=(0.75, 0.87, 1.00))

    return key, fill, rim

def light_rig_butterfly(obj_center=(0,0,0.04), subject_height=0.08):
    """
    BUTTERFLY / PARAMOUNT LIGHTING — glamour, bellezza.
    Key: direttamente davanti, in alto (non laterale).
    Fill: sotto il soggetto o assente.
    Rim: simmetrico, nessun lato dominante.

    Effetto: ombra a farfalla sotto il naso (ritratto).
    Ratio key:fill = 2:1-2.5:1 → luminoso, flattering.

    Usa per: beauty, gioielli, prodotti cosmetici, still life simmetrico.
    """
    cx, cy, cz = obj_center
    h = subject_height
    t = (cx, cy, cz + h * 0.5)

    key  = add_area("Btfly_Key",  energy=130, size=0.45,
                    location=(cx, cy - h*2.5, cz + h*4.5),  # frontale alto
                    target=t, color=(1.00, 0.97, 0.90))  # quasi neutro

    fill = add_area("Btfly_Fill", energy=52,  size=1.20,
                    location=(cx, cy - h*1.5, cz - h*0.5),  # sotto, luce di rimbalzo
                    target=t, color=(0.90, 0.95, 1.00))

    rim_l = add_area("Btfly_Rim_L", energy=55, size=0.15,
                     location=(cx - h*3.5, cy + h*3.0, cz + h*2.0),
                     target=t, color=(0.75, 0.87, 1.00))

    rim_r = add_area("Btfly_Rim_R", energy=55, size=0.15,
                     location=(cx + h*3.5, cy + h*3.0, cz + h*2.0),
                     target=t, color=(0.75, 0.87, 1.00))

    return key, fill, rim_l, rim_r

def light_rig_split(obj_center=(0,0,0.04), subject_height=0.08):
    """
    SPLIT LIGHTING — metà illuminata, metà in ombra.
    Key: 90° di lato (esattamente laterale), nessun fill.
    Rim: opposto al key, debole (o assente per effetto totale).

    Ratio key:fill = 8:1 o più → low-key, tensione massima.

    Usa per: dark product, villain, horror, automotive di notte, tech dark.
    """
    cx, cy, cz = obj_center
    h = subject_height
    t = (cx, cy, cz + h * 0.5)

    key = add_area("Split_Key", energy=200, size=0.20,
                   location=(cx - h*5.0, cy, cz + h*1.5),  # 90° laterale
                   target=t, color=(1.00, 0.80, 0.58))  # warm tungsten

    rim = add_area("Split_Rim", energy=25,  size=0.20,
                   location=(cx + h*4.5, cy + h*2.0, cz + h*1.5),
                   target=t, color=(0.70, 0.85, 1.00))  # cold blue

    return key, rim

def light_rig_high_key(obj_center=(0,0,0.04), subject_height=0.08):
    """
    HIGH-KEY LIGHTING — tutto luminoso, ombre quasi assenti.
    Ratio key:fill = 1:1 → allegro, pulito, commerciale.
    Molte sorgenti grandi da angoli diversi.

    Usa per: pubblicità alimentare, cosmetici, lifestyle positivo,
             cartoon, bambini, prodotti "fresh".
    """
    cx, cy, cz = obj_center
    h = subject_height
    t = (cx, cy, cz + h * 0.5)

    key   = add_area("HK_Key",   energy=90,  size=0.60,
                     location=(cx - h*3.0, cy - h*2.0, cz + h*4.0),
                     target=t, color=(1.00, 0.97, 0.90))

    fill  = add_area("HK_Fill",  energy=80,  size=1.20,
                     location=(cx + h*3.0, cy - h*1.5, cz + h*3.0),
                     target=t, color=(0.95, 0.97, 1.00))

    top   = add_area("HK_Top",   energy=60,  size=1.00,
                     location=(cx, cy - h*0.5, cz + h*6.0),  # overhead
                     target=t, color=(1.00, 1.00, 1.00))

    bounce= add_area("HK_Bounce",energy=40,  size=1.50,
                     location=(cx, cy - h*2.0, cz - h*0.5),  # sotto (bounce)
                     target=t, color=(0.95, 0.98, 1.00))

    return key, fill, top, bounce

def light_rig_low_key(obj_center=(0,0,0.04), subject_height=0.08):
    """
    LOW-KEY LIGHTING — scuro, drammatico, poca luce.
    Ratio key:fill = 8:1 → noir, mystery, tensione.
    Una sola sorgente principale, nessun fill.

    Usa per: horror, thriller, villain, whisky/spirits dark,
             automotive notturno, oggetti di lusso scuro.
    """
    cx, cy, cz = obj_center
    h = subject_height
    t = (cx, cy, cz + h * 0.5)

    key  = add_area("LK_Key",  energy=250, size=0.25,
                    location=(cx - h*3.5, cy - h*1.5, cz + h*4.0),
                    target=t, color=(1.00, 0.78, 0.48))  # molto warm/amber

    # Nessun fill → quasi tutto in ombra
    # Rim opzionale per separare dal fondo nero
    rim  = add_area("LK_Rim",  energy=30,  size=0.15,
                    location=(cx + h*3.0, cy + h*4.0, cz + h*2.0),
                    target=t, color=(0.60, 0.80, 1.00))  # cool blue contrasto

    return key, rim

def light_rig_food_side(obj_center=(0,0,0.05)):
    """
    FOOD SIDE LIGHTING — luce laterale per texture cibo.
    Key laterale 45° → rivela texture (granulosa, ruvida, fresca).
    Fill molto debole per non schiacciare le ombre di rilievo.
    Back light per separazione e traslucenza.

    Standard industria food photography (riviste, ristoranti premium).
    Usa con: Cycles (SSS), cm_organic(), piano legno o ardesia.
    """
    cx, cy, cz = obj_center

    key  = add_area("Food_SideKey", energy=70, size=0.60,
                    location=(cx - 0.30, cy + 0.00, cz + 0.25),  # laterale 90°
                    target=(cx, cy, cz), color=(1.00, 0.92, 0.80))  # warm 4500K

    fill = add_area("Food_Fill",    energy=12, size=1.40,
                    location=(cx + 0.35, cy - 0.20, cz + 0.15),
                    target=(cx, cy, cz), color=(0.90, 0.95, 1.00))

    back = add_area("Food_Back",    energy=45, size=0.40,
                    location=(cx + 0.05, cy + 0.45, cz + 0.20),  # dietro-laterale
                    target=(cx, cy, cz), color=(1.00, 0.95, 0.88))

    return key, fill, back

def light_rig_food_window(obj_center=(0,0,0.05)):
    """
    FOOD WINDOW LIGHT — simula finestra naturale laterale.
    Grande sorgente softbox = finestra diffusa.
    Ratio key:fill = 2:1 → morbido, lifestyle.
    """
    cx, cy, cz = obj_center

    window = add_area("Food_Window", energy=55, size=1.20,
                      location=(cx - 0.45, cy, cz + 0.30),  # finestra laterale
                      target=(cx, cy, cz), color=(1.00, 0.97, 0.90))

    bounce = add_area("Food_Bounce", energy=25, size=1.60,
                      location=(cx + 0.45, cy, cz + 0.05),  # riflettore bianco opposto
                      target=(cx, cy, cz), color=(0.95, 0.98, 1.00))

    return window, bounce
```

---

## HDRI — Illuminazione Ambiente Ibrida

> **Best practice moderna**: HDRI per global illumination + key light AREA per controllo artistico.
> HDRI da solo → realismo, ma niente controllo sulle ombre.
> HDRI + key → realismo con forma scultorea.
> Solo AREA → controllo totale, meno realismo.

```python
def setup_hdri_world(scene, hdri_path,
                     hdri_strength=0.6,
                     hdri_rotation_z=0.0,
                     add_solid_background=False,
                     bg_color=(0.03, 0.03, 0.04)):
    """
    Setup world HDRI — illuminazione ambiente realistica.
    Richiede Cycles per beneficio completo (GI vera).
    Eevee usa l'HDRI per probe/reflection

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [MAX-786](https://github.com/MAX-786)
- **Source:** [MAX-786/claude-3d-harness](https://github.com/MAX-786/claude-3d-harness)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-max-786-claude-3d-harness-blender-lighting
- Seller: https://agentstack.voostack.com/s/max-786
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
