> For the complete documentation index, see [llms.txt](https://hamsterbaron.gitbook.io/hamsterbaron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hamsterbaron.gitbook.io/hamsterbaron/augment-guide/render.md).

# 镜内渲染 / Render

## 镜内渲染模块介绍

在类似 BattleField 6 或是 Squad 战术小队 这一类游戏中，玩家可能发现使用枪械瞄准时，仅有瞄准镜内的部分会被放大。相较于其他通过整体缩放视野的瞄准镜放大效果，它们提供了更拟真，更具沉浸感的视觉表现。Arcana 为 TacZ 枪械模组带来了这一功能，允许玩家在 Minecraft 中体验更为硬核的枪械射击。

此外，诸如夜视镜，热成像瞄准镜及最新的各类具有特殊指示标记的智能火控瞄准镜，单兵制导武器的镜内跟踪标识等一系列在瞄准镜区域内被渲染的特殊标志也需要拥有一个特别的镜片上渲染层以方便程序上的实现。依赖于镜内渲染模块，Arcana 同样提供了此类功能的制作接口，以便于广大制作者们实现更为丰富与多样化的武器功能。

***

## 使用镜内渲染功能

由于二次渲染所带来的不可避免的性能问题，尽管已做了优化处理，但在与特定光影或渲染模组共同使用时镜内渲染模块仍存在掉帧或崩溃问题。<mark style="color:$warning;">因此该功能默认关闭</mark>。

在 Minecraft 根目录中 config 模组配置文件夹下，打开`taczexpands-client.toml`文件，找到如下字段：

```toml
["Visual Settings"]
	enableRenderFunc = false #将此项改为 true 即可启用镜内渲染功能
```

启用功能后，打开游戏并进入世界，拿出 TacZ 模组枪械物品时，程序将自动进行镜内额外渲染，并启用镜内放大功能。仅安装瞄准具配件的枪械在瞄准时才会启用镜内放大，无安装瞄准具配件时默认不启用。

***

## 为指定配件关闭镜内放大功能

由于部分机械瞄准具和特殊瞄准具样式在使用镜内放大功能时会出现非预期的表现，因此在配件数据配置文件中可单独设置是否为特定的配件关闭镜内放大功能。

在 TacZ 资源包文件夹`data\attachments`路径下，打开特定的瞄准具配置文件，插入如下字段：

```json
// Other Configs..
  "extras":{
    "advanced_rendering": false
  }
// Other Configs..
```

重新加载资源包，此时对应的配件即使作为瞄准具槽位配件被安装，持枪瞄准时也不会启用镜内放大。

***

## 为指定配件启用特殊效果

将特定瞄准具配件变为具有夜视或热成像功能的瞄准具时，需要在配件数据配置文件中进行单独的设置以启用相关渲染层效果。

在 TacZ 资源包文件夹`data\attachments`路径下，打开特定的瞄准具配置文件，插入如下字段：

```json
// Other Configs..
  "extras":{
    "night_vision": false, //夜视效果
    "thermal_imagine": true, //热成像效果
    "monochrome": true, //单色黑白滤镜效果
  }
// Other Configs..
```

启用夜视效果的瞄准具将会在镜片内出现淡绿色的夜视渲染层，在黑夜时提供明亮视野。此功能兼容真实黑暗模组。启用热成像效果的瞄准具将会在镜片内出现热融合热成像的效果，生物实体将被红色高亮渲染。如果同时启用了单色黑白滤镜，生物实体则将被白色高亮渲染，而环境色会变为灰黑色系。注意：启用热成像效果的瞄准镜配件无法再额外启用夜视效果。

## 实时控制镜片特殊效果

当需要制作可控的特殊效果机制，如一个可开关的夜视功能的瞄准镜时，可以通过机制开发器中的`Modify` 属性编辑器组件来实时修改这些特殊镜片效果是否启用。相关变量如下：

<table><thead><tr><th width="176.39996337890625">变量名</th><th>说明</th></tr></thead><tbody><tr><td><code>GunMonochrome</code></td><td>控制瞄准镜是否启用单色黑白滤镜效果</td></tr><tr><td><code>GunThermalImaging</code></td><td>控制瞄准镜是否启用热成像效果</td></tr><tr><td><code>GunNightVision</code></td><td>控制瞄准镜是否启用夜视效果</td></tr></tbody></table>

通过直接使用布尔类型值即可控制相应功能的开关。对于属性编辑器表达式解析，数字1即为`true`，数字0即为`false`。有关于属性编辑器的详细用法，请参阅机制开发导引-动作块相应章节。

{% hint style="warning" %}
**使用须知** : 夜视效果与热成像效果均需要在模组配置文件启用镜内渲染功能，未启用时将无效。热成像渲染效果与部分光影不兼容，需手动进行兼容，详情参照[故障排查](/hamsterbaron/help-guide/troubleshooting.md)章节。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hamsterbaron.gitbook.io/hamsterbaron/augment-guide/render.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
