# Scoping

# Concept and Use Cases

<div class="header" id="bkmrk-"><div class="headertitle"></div></div>#### <a class="anchor" id="bkmrk--0"></a>Scoping: Concept

The scope concept supplies selects only specific parts of the scene graph for rendering, depending on the specific situation.

<div class="contents" id="bkmrk-scope-forms-conceptu"><div class="contents"><div class="textblock">- Scope forms conceptual groups independent of the scene graph.
- Node part of the scene tree can be assigned to several scopes.

</div></div></div>Scopes are logical entities defined as bit fields, whereby each scope corresponds to a bit field. The set of scopes associated to a node is called scope mask. By default, the scope mask of all nodes including cameras contains all of the 32 scopes.

#### <a class="anchor" id="bkmrk--1"></a>Scoping: Use Cases

The scope concept is used for:

<div class="contents" id="bkmrk-light-culling%3A-only-"><div class="contents"><div class="textblock">- Light culling: Only objects part of the scope of a given light will be illuminated
- Visibility culling: Only objects part of the scope of a given camera will be rendered

</div></div></div>#### <a class="anchor" id="bkmrk--2"></a>Scope Mask

This option "Show scope mask in hexadecimal format" is available in the Preferences dialog opened from "File" &gt; "Preferences" menu, section Editor.   
It ensures that the values for Scope property will be displayed in hex in the Properties panel.

# Manage Scopes in Scopes Panel

#### <a class="anchor" id="bkmrk--1"></a>Scopes Panel

The Scopes Panel (enable from menu "View" &gt; "Libraries" &gt; "Scopes") displays all 32 scopes with default scope names.

#### <a class="anchor" id="bkmrk--2"></a>Rename a Scope

Rename a scope by selecting the option Rename of the context menu in Scopes panel:

<div drawio-diagram="970"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-4-1676444598.png" alt=""/></div>

<div class="contents" id="bkmrk--0"><div class="contents"><div class="textblock">  
</div></div></div>#### <a class="anchor" id="bkmrk--4"></a>Assign Single Scope to a Node

Assign a single scope to the scope mask of a node by dragging the scope from the Scopes panel and dropping it over the desired node.   
The valid scope is highlighted.

# Edit Scope Mask of a Node

#### <a class="anchor" id="bkmrk--5"></a>Scope Mask of a Node in the Properties Panel

By default, the scope mask of a node contains all 32 scopes available. This can be inspected in:

<div class="contents" id="bkmrk-properties-panel%2C-on"><div class="contents"><div class="contents"><div class="textblock">- Properties Panel, on the item property "Scope Mask"
- Scopes Panel, since all scopes valid for the currently selected node are highlighted.

</div></div></div></div>#### <a class="anchor" id="bkmrk--6"></a>Select specific Scopes for a Node

Modify the scope mask of a node from the Properties panel by checking or unchecking the desired scopes from the Scope Mask combo box.

<div drawio-diagram="971"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-02/drawing-4-1676444667.png" alt=""/></div>

<div class="contents" id="bkmrk--0"><div class="contents"><div class="textblock">  
</div></div></div>#### <a class="anchor" id="bkmrk--8"></a>Select or Deselect all Scopes for a Node

Select all/Deselect all scopes from Properties panel.

<div drawio-diagram="3313"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-04/drawing-4-1682584802.png" alt=""/></div>

<div class="contents" id="bkmrk--2"><div class="contents"><div class="textblock">  
</div></div></div>#### <a class="anchor" id="bkmrk--10"></a>Invert a Scope Mask

Invert Scope option will perform a bitwise NOT operation on the bits of the selected scope mask.

#### <a class="anchor" id="bkmrk--11"></a>Apply Node Scope on Children

Apply a node scope mask on all children of the node by using the "Apply Node Scope on Children" option from the context menu.

<div drawio-diagram="3314"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-04/drawing-4-1682584825.png" alt=""/></div>

<div class="contents" id="bkmrk--4"><div class="textblock">  
</div></div>