Camera Obscura

Camera Obscura 是一个服务端软件光栅化器,它直接在服务器上渲染任何实体(玩家、生物等)所看到的景象,并将其生成为 Minecraft 地图形式的照片或视频。
它深度集成了自定义物品支持(Nexo、ItemsAdder)以及自定义预设系统。
功能特性
- 拍摄照片:生成显示目标实体所见景象的地图物品。
- 录制视频:以视频形式捕捉你的世界,并在物品展示框中播放。
- 完全可配置:分辨率、颜色模式、抖动效果、渲染距离等均可调整。
- 自定义物品支持:通过 Nexo 或 ItemsAdder 创建具有任意外观的相机/摄像机。
- 异步渲染:绝不会阻塞主服务器线程。
- 无需客户端模组:所有操作均在服务端完成;地图和录制的视频在原版客户端上即可使用。

安装
Fabric Server
- 安装 Fabric API 和 Polymer(用于虚拟物品)。
- 将
camera-obscura-fabric.jar 放入 mods/ 文件夹。
- 启动时会自动生成配置文件。
配置
配置文件位于 config/cameraobscura/config.json。
{
"renderDistance": 32,
"showSystemMessages": false,
"renderEntities": true,
"fullbright": false,
"fov": 70,
"biomeBlend": 1,
"ssaa": 2,
"maxChunkRebuildsPerTick": 5,
"debug": false,
"cameraConsumesItem": true,
"cameraConsumeItem": "map",
"commandPermissionLevel": 2
}
| 选项 |
描述 |
renderDistance |
视距(方块数),数值越高渲染时间越长。 |
showSystemMessages |
在聊天栏显示“正在拍照…” / “完成!”等系统消息。 |
renderEntities |
是否在照片中渲染实体(玩家、生物、物品展示框等)。 |
fullbright |
忽略光照效果(所有内容均以全亮度显示)。 |
fov |
视野角度(默认值为 70)。 |
biomeBlend |
混合方块颜色(生物群系色调)的半径。0 表示不混合。 |
ssaa |
超级采样抗锯齿因子(1 = 关闭,2 = 2倍超级采样,3 = 3倍)。 |
maxChunkRebuildsPerTick |
每帧针对视频录制和实时地图重建的最大区块数(用于限制 CPU 峰值占用)。 |
debug |
打印帧耗时并在输出图像上显示 FPS 覆盖层。 |
cameraConsumesItem |
拍照是否会消耗物品(例如一张地图)。 |
cameraConsumeItem |
所需的物品材质(例如 map、paper)。 |
commandPermissionLevel |
命令的基础权限等级。 |
命令与权限
基础权限 cameraobscura.command。
所有命令均使用根命令 /camera-obscura
1. 从你的视角拍摄地图
/camera-obscura [scale]
scale: 乘以地图分辨率(1 = 128×128,2 = 256×256,最高为 3)。
- 给你一张已填充的地图,显示你当时所见的景象。
2. 从其他实体的视角拍摄地图
/camera-obscura <entity> <player> [scale]
<entity>: 任何活体实体(玩家、生物等)。
<player>: 接收地图物品的玩家。
3. 保存为 PNG 图片
/camera-obscura save [entity] [scale]
- 将渲染后的图像保存为
.png 格式至 config/cameraobscura/renders/ 目录。
4. 重新加载配置
/camera-obscura reload
重新加载配置文件。
5. 清除资源/模型缓存
/camera-obscura clear-cache
6. 给予相机物品
/camera-obscura give <preset> [player]
<preset>: presets.json 中定义的预设名称(例如 camera、camcorder、instant、polaroid、pro_camera、handycam、cctv)。
[player]: 可选的玩家名称;如果省略,则将物品给予命令执行者。
示例:
/camera-obscura give camera -> 给自己默认的相机。
/camera-obscura give camcorder Pinnit -> 给玩家 Pinnit 一台摄像机。
/camera-obscura give my-preset -> 给自己一个来自预设的物品。
? 使用相机物品
基本相机
- 将相机握在主手。
- 右键点击 -> 倒计时结束后,照片地图物品会出现在你的物品栏中(如果物品栏已满则掉落在地上)。
- 地图显示的是那一刻你自己视角的世界景象。
摄像机
- 控制方式相同,但开始录制而非拍摄单张照片。
- 动作栏文本会指示录制状态。
- 松开按键停止录制,视频将保存为可在物品展示框中播放的地图物品。
- 录制期间,相机周围会出现粒子效果(帧特效)。
- 视频以 APNG 格式存储在
config/cameraobscura/camera_videos/<id>.apng
组件
该模组使用数据组件来存储物品栈上的相机设置。
这允许你使用标准命令、配方或战利品表创建具有不同分辨率、颜色模式和视频参数的相机。
可用组件
| 组件 ID |
类型 |
描述 |
camera-obscura:color |
string (ColorMode) |
"COLOR", "MONOCHROME", "GRAYSCALE", "SEPIA" |
camera-obscura:resolution |
{width:int, height:int} |
以像素为单位的分辨率(例如 {width:256, height:256}) |
camera-obscura:dither |
string (DitherMode) |
"NONE", "BAYER_2X2", "FLOYD_STEINBERG" 等(见下方完整列表) |
camera-obscura:video |
{frame_rate:int, max_frames:int, loop_playback:bool} |
视频录制参数 |
camera-obscura:map |
unit |
将物品标记为实时地图(内部使用) |
camera-obscura:camera_entity |
entity_reference |
存储拍摄照片的实体(内部使用) |
camera-obscura:data |
{id:uuid, video_params:...} |
内部视频数据 |
DitherMode 取值:
NONE, BAYER_2X2, BAYER_4X4, BAYER_8X8, FLOYD_STEINBERG, ATKINSON, JARVIS_JUDICE_NINKE, STUCKI, SIERRA, BURKES
在命令中使用组件
/give
/give @p camera-obscura:camera[camera-obscura:color="SEPIA",camera-obscura:resolution={width:512,height:512},camera-obscura:dither="FLOYD_STEINBERG"]
/item modify
创建一个包含物品修改器的数据包:
{
"function": "set_components",
"components": {
"camera-obscura:color": "GRAYSCALE",
"camera-obscura:resolution": { "width": 192, "height": 192 },
"camera-obscura:dither": "BAYER_8X8"
}
}
然后运行:/item modify entity @s weapon.mainhand my_pack:camera_settings
在配方中使用组件
在合成配方中:
{
"type": "minecraft:crafting_shaped",
"pattern": ["###", "#P#", "###"],
"key": {
"#": "minecraft:iron_ingot",
"P": "minecraft:ender_pearl"
},
"result": {
"id": "camera-obscura:camera",
"components": {
"camera-obscura:color": "SEPIA",
"camera-obscura:resolution": { "width": 128, "height": 128 },
"camera-obscura:dither": "NONE"
}
}
}
对于摄像机(视频模式),需包含 video:
"components": {
"camera-obscura:color": "COLOR",
"camera-obscura:resolution": { "width": 256, "height": 256 },
"camera-obscura:video": { "frame_rate": 15, "max_frames": 300 }
}
授予带有默认视频设置的摄像机
基础摄像机物品(不带组件)使用全局配置中的默认值。若要显式设置视频参数:
/give @s camera-obscura:camcorder[camera-obscura:video={frame_rate:10,max_frames:200,loop_playback:true}]
内置物品
在 Fabric 加载器下,Camera Obscura 添加了几个内置的相机和摄像机物品,这些物品已预配置了设置(色彩模式、分辨率、视频参数)。
相机物品(照片模式)
| 物品 ID |
色彩模式 |
分辨率 |
抖动方式 |
camera-obscura:camera |
COLOR |
128×128 |
NONE |
camera-obscura:grayscale_camera |
GRAYSCALE |
128×128 |
NONE |
camera-obscura:primitive_camera |
MONOCHROME |
128×128 |
NONE |
camera-obscura:retro_camera |
SEPIA |
128×128 |
NONE |
摄像机物品(视频模式)
录制具有预设帧率和最大帧数的视频。
| 物品 ID |
色彩模式 |
分辨率 |
抖动方式 |
视频(FPS / 最大帧数) |
camera-obscura:camcorder |
COLOR |
128×128 |
NONE |
10 FPS / 400 帧 |
camera-obscura:grayscale_camcorder |
GRAYSCALE |
128×128 |
NONE |
20 FPS / 400 帧 |
camera-obscura:primitive_camcorder |
MONOCHROME |
128×128 |
NONE |
20 FPS / 400 帧 |
camera-obscura:retro_camcorder |
SEPIA |
128×128 |
NONE |
20 FPS / 400 帧 |
使用示例:
/give @s camera-obscura:grayscale_camera
视频播放
要回放视频地图:
- 将地图放置在物品展示框中。
- 右键点击物品展示框,视频将在地图上开始播放。
- 再次右键点击以停止播放。
预设
你可以添加自己的预设,即带有自定义材质、显示名称和相机设置(分辨率、色彩模式、抖动模式、视频参数)的预配置相机物品。
预设存储在 presets.json 文件中,可以通过 /camera-obscura give <preset> <player> 命令给予玩家。
预设配置格式
presets.json 文件包含一个 JSON 对象,其中每个键是预设名称,值是一个包含以下字段的对象:
| 字段 |
描述 |
material |
物品 ID(例如 "paper", "clock") |
camera |
相机特定选项(见下文) |
components |
可选的原版数据组件,应用于物品堆栈(1.20.5+) |
相机选项
所有字段均为可选
| 字段 |
类型 |
描述 |
resolution |
{ width, height } |
输出分辨率(像素)(例如:{ "width": 256, "height": 256 }) |
color_mode |
string |
"COLOR"、"MONOCHROME"、"GRAYSCALE"、"SEPIA" |
dither_mode |
string |
"NONE"、"BAYER_2X2"、"FLOYD_STEINBERG" 等 |
video_params |
{ frame_rate, max_frames } |
视频录制参数 |
默认预设
模组自带多个开箱即用的预设。你可以随意修改或删除它们。
{
"camera": {
"material": "paper",
"camera": {
"resolution": { "width": 128, "height": 128 },
"color_mode": "COLOR",
"dither_mode": "NONE",
"video": { "frame_rate": 0, "max_frames": 1 }
},
"components": {
"minecraft:item_name": { "text": "Camera", "color": "gold" },
"minecraft:max_stack_size": 1
}
},
"camcorder": {
"material": "paper",
"camera": {
"resolution": { "width": 128, "height": 128 },
"color_mode": "COLOR",
"dither_mode": "NONE",
"video": { "frame_rate": 20, "max_frames": 200 }
}
},
"instant": {
"material": "paper",
"camera": {
"resolution": { "width": 256, "height": 256 },
"color_mode": "SEPIA",
"dither_mode": "BAYER_4X4"
},
"components": {
"minecraft:item_name": { "text": "Instant Camera", "italic": false }
}
},
"polaroid": {
"material": "paper",
"camera": {
"resolution": { "width": 512, "height": 512 },
"color_mode": "GRAYSCALE",
"dither_mode": "FLOYD_STEINBERG"
},
"components": {
"minecraft:item_name": { "text": "Polaroid", "color": "white" },
"minecraft:custom_model_data": 1
}
},
"pro_camera": {
"material": "ender_eye",
"camera": {
"resolution": { "width": 128, "height": 128 },
"color_mode": "COLOR",
"dither_mode": "NONE",
"video": { "frame_rate": 30, "max_frames": 600 }
},
"components": {
"minecraft:item_name": { "text": "Pro Camera", "color": "light_purple", "bold": true },
"minecraft:max_stack_size": 1,
"minecraft:custom_model_data": 2
}
},
"handycam": {
"material": "clock",
"camera": {
"resolution": { "width": 256, "height": 256 },
"color_mode": "COLOR",
"dither_mode": "BAYER_2X2",
"video": { "frame_rate": 15, "max_frames": 450 }
},
"components": {
"minecraft:item_name": { "text": "Handycam", "color": "aqua" },
"minecraft:max_stack_size": 1
}
},
"cctv": {
"material": "observer",
"camera": {
"resolution": { "width": 192, "height": 192 },
"color_mode": "MONOCHROME",
"dither_mode": "SIERRA",
"video": { "frame_rate": 5, "max_frames": 30000 }
},
"components": {
"minecraft:item_name": { "text": "CCTV Camera", "color": "dark_gray" },
"minecraft:max_stack_size": 1
}
}
}
在命令中使用预设
/camera-obscura give camera
/camera-obscura give camcorder
/camera-obscura give instant
/camera-obscura give handycam Notch
Tab 补全会提示可用的预设名称。
重新加载预设
在服务器运行时编辑 presets.json 后,运行以下命令:
/camera-obscura reload
这将重新加载主配置文件和所有预设,而无需重启服务器。
工作原理(技术概览)
Camera Obscura 完全在服务器端运行,并使用软件光栅化器逐像素绘制场景。
- 渲染器请求目标周围的区块和实体。
- 方块模型被转换为三角形并存储在缓存中(按区块划分)。
- 光照、环境遮蔽和雾效均根据实际世界状态计算得出。
- 渲染在独立的线程池上异步进行,不会影响主游戏线程。
- 渲染完成后,图像会被转换为(一个或多个)Minecraft 地图(或保存为 PNG 文件)。
- 视频录制以配置的帧率捕获帧。
性能注意事项
- 更高的分辨率和 SSAA(超级采样抗锯齿)会显著增加 CPU 占用。
- 如果区块未加载,渲染距离超过 128 可能会导致问题。
- 视频录制非常消耗 CPU 资源。如需高质量录制,请考虑降低帧率!
故障排除
| 问题 |
检查项 |
| 照片未出现在物品栏 |
检查 cameraConsumesItem 是否为 false,或者你拥有所需的物品(例如一张地图)。 |
| 出现“缺少所需物品”提示 |
你的物品栏中需要包含配置文件中指定的 cameraConsumeItem 材料。 |
| 渲染时间过长(> 5 秒) |
减小 renderDistance、ssaa 或 resolution。启用 debug 可查看每帧耗时。 |
| 服务器因 OOM(内存溢出)崩溃 |
增加服务器内存(-Xmx2G 或更多)。降低 renderDistance 和 ssaa。 |
| 自定义 Nexo/ItemsAdder 物品被忽略 |
确保 camera 部分的缩进正确,且机制名称拼写完全为 camera。 |
Camera Obscura

Camera Obscura is a server‑side software rasterizer that renders the world as seen by any entity (player, mob, etc.) directly on the server, producing Photos or Videos as Minecraft maps.
It has deep integrations for custom items (Nexo, ItemsAdder) and a custom preset system.
Features
- Take photos: Generate a map item showing what the target entity sees.
- Record videos: Capture your world on video and play it back on item frames.
- Fully configurable: Resolution, color mode, dithering, render distance, and more.
- Custom item support: Create cameras/camcorders with any appearance via Nexo or ItemsAdder.
- Asynchronous rendering: Never blocks the main server thread.
- No client mods required: Everything is server‑side; maps/recordings work on vanilla clients.

Installation
Fabric Server
- Install Fabric API and Polymer (for virtual items).
- Place
camera-obscura-fabric.jar into your mods/ folder.
- The configuration file will be created on start.
Configuration
The configuration file is config/cameraobscura/config.json.
{
"renderDistance": 32,
"showSystemMessages": false,
"renderEntities": true,
"fullbright": false,
"fov": 70,
"biomeBlend": 1,
"ssaa": 2,
"maxChunkRebuildsPerTick": 5,
"debug": false,
"cameraConsumesItem": true,
"cameraConsumeItem": "map",
"commandPermissionLevel": 2
}
| Option |
Description |
renderDistance |
View distance in blocks (higher = longer render time). |
showSystemMessages |
Show “Taking photo…” / “Done!” messages in chat. |
renderEntities |
Whether to render entities (players, mobs, item frames) in the picture. |
fullbright |
Ignore lighting (everything appears at full brightness). |
fov |
Field of view in degrees (default is 70). |
biomeBlend |
Radius for blending block colors (biome tint). 0 = no blending. |
ssaa |
Supersampling anti‑aliasing factor (1 = off, 2 = 2x supersampling, 3 = 3x). |
maxChunkRebuildsPerTick |
Maximum chunks rebuilt per frame per video recording and live-map (to limit CPU spikes). |
debug |
Print frame timings and show FPS overlay on the output image. |
cameraConsumesItem |
Whether taking a photo consumes an item (e.g. a map). |
cameraConsumeItem |
Required item material (e.g. map, paper). |
commandPermissionLevel |
Base permission level for commands. |
Commands & Permissions
Base permission cameraobscura.command.
All commands use the root /camera-obscura
1. Take a map from your perspective
/camera-obscura [scale]
scale: multiply the map resolution (1 = 128×128, 2 = 256×256, up to 3).
- Gives you a filled map showing what you see.
2. Take a map of another entities perspective
/camera-obscura <entity> <player> [scale]
<entity>: any living entity (player, mob, etc.)
<player>: who receives the map item.
3. Save as PNG image
/camera-obscura save [entity] [scale]
- Saves the rendered image as a
.png in config/cameraobscura/renders/.
4. Reload configuration
/camera-obscura reload
Reloads the config file.
5. Clear resource/model cache
/camera-obscura clear-cache
6. Give a camera item
/camera-obscura give <preset> [player]
<preset>: The name of a preset defined in presets.json (e.g. camera, camcorder, instant, polaroid, pro_camera, handycam, cctv).
[player]: Optional player name; if omitted, gives the item to the command sender.
Examples:
/camera-obscura give camera -> gives yourself the default camera.
/camera-obscura give camcorder Pinnit -> gives the player Pinnit a camcorder.
/camera-obscura give my-preset -> gives yourself an item from a preset.
📷 Using the Camera Item
Basic Camera
- Hold the camera in your main hand.
- Right‑click -> after a countdown, the photo map item appears in your inventory (or drops on the ground if full).
- The map shows the world from your viewpoint at that moment.
Camcorder
- Same controls, but starts recording instead of taking a single photo.
- The action-bar text indicates recording.
- Release to stop recording, the video will be saved as a map item that can be played back on item-frames.
- While recording, particles appear around the camera (frame effect).
- Videos are stored as APNG in
config/cameraobscura/camera_videos/<id>.apng
Components
The mod uses data components to store camera settings on the item stack.
This allows you to create cameras with different resolutions, color modes, and video parameters using standard commands, recipes, or loot tables.
Available Components
| Component ID |
Type |
Description |
camera-obscura:color |
string (ColorMode) |
"COLOR", "MONOCHROME", "GRAYSCALE", "SEPIA" |
camera-obscura:resolution |
{width:int, height:int} |
Resolution in pixels (e.g. {width:256, height:256}) |
camera-obscura:dither |
string (DitherMode) |
"NONE", "BAYER_2X2", "FLOYD_STEINBERG", etc. (see full list below) |
camera-obscura:video |
{frame_rate:int, max_frames:int, loop_playback:bool} |
Video recording parameters |
camera-obscura:map |
unit |
Marks the item as a live map (internal) |
camera-obscura:camera_entity |
entity_reference |
Stores the entity that took the photo (internal) |
camera-obscura:data |
{id:uuid, video_params:...} |
Internal video data |
DitherMode values:
NONE, BAYER_2X2, BAYER_4X4, BAYER_8X8, FLOYD_STEINBERG, ATKINSON, JARVIS_JUDICE_NINKE, STUCKI, SIERRA, BURKES
Using Components in Commands
/give
/give @p camera-obscura:camera[camera-obscura:color="SEPIA",camera-obscura:resolution={width:512,height:512},camera-obscura:dither="FLOYD_STEINBERG"]
/item modify
Create a data pack with an item modifier:
{
"function": "set_components",
"components": {
"camera-obscura:color": "GRAYSCALE",
"camera-obscura:resolution": { "width": 192, "height": 192 },
"camera-obscura:dither": "BAYER_8X8"
}
}
Then run: /item modify entity @s weapon.mainhand my_pack:camera_settings
Using Components in Recipes
In a crafting recipes:
{
"type": "minecraft:crafting_shaped",
"pattern": ["###", "#P#", "###"],
"key": {
"#": "minecraft:iron_ingot",
"P": "minecraft:ender_pearl"
},
"result": {
"id": "camera-obscura:camera",
"components": {
"camera-obscura:color": "SEPIA",
"camera-obscura:resolution": { "width": 128, "height": 128 },
"camera-obscura:dither": "NONE"
}
}
}
For a camcorder (video mode), include video:
"components": {
"camera-obscura:color": "COLOR",
"camera-obscura:resolution": { "width": 256, "height": 256 },
"camera-obscura:video": { "frame_rate": 15, "max_frames": 300 }
}
Giving a Camcorder with Default Video Settings
The basic camcorder item (without components) uses global config defaults. To explicitly set video parameters:
/give @s camera-obscura:camcorder[camera-obscura:video={frame_rate:10,max_frames:200,loop_playback:true}]
Built-in Items
On Fabric, Camera Obscura adds a few built‑in camera and camcorder items with pre‑configured settings (color mode, resolution, video parameters).
Camera Items (Photo Mode)
| Item ID |
color Mode |
Resolution |
Dithering |
camera-obscura:camera |
COLOR |
128×128 |
NONE |
camera-obscura:grayscale_camera |
GRAYSCALE |
128×128 |
NONE |
camera-obscura:primitive_camera |
MONOCHROME |
128×128 |
NONE |
camera-obscura:retro_camera |
SEPIA |
128×128 |
NONE |
Camcorder Items (Video Mode)
Record videos with pre‑set framerate and max frame count.
| Item ID |
color Mode |
Resolution |
Dithering |
Video (FPS / Max Frames) |
camera-obscura:camcorder |
COLOR |
128×128 |
NONE |
10 FPS / 400 frames |
camera-obscura:grayscale_camcorder |
GRAYSCALE |
128×128 |
NONE |
20 FPS / 400 frames |
camera-obscura:primitive_camcorder |
MONOCHROME |
128×128 |
NONE |
20 FPS / 400 frames |
camera-obscura:retro_camcorder |
SEPIA |
128×128 |
NONE |
20 FPS / 400 frames |
Usage example:
/give @s camera-obscura:grayscale_camera
Video Playback
To play back a video maps:
- Place the map in an item frame.
- Right‑click the item frame and the video will start playing on the map.
- Right‑click again to stop playback.
Presets
You can add your own presets, pre‑configured camera items with custom materials, display names, and camera settings (resolution, color mode, dither mode, video parameters).
Presets are stored in presets.json and can be given to players using the /camera-obscura give <preset> <player> command.
Preset Configuration Format
The presets.json file contains a JSON object where each key is a preset name and the value is an object with the following fields:
| Field |
Description |
material |
Item ID (e.g. "paper", "clock") |
camera |
Camera‑specific options (see below) |
components |
Optional vanilla data components to apply to the item stack (1.20.5+) |
Camera Options
All fields are optional
| Field |
Type |
Description |
resolution |
{ width, height } |
Output resolution in pixels (e.g. { "width": 256, "height": 256 }) |
color_mode |
string |
"COLOR", "MONOCHROME", "GRAYSCALE", "SEPIA" |
dither_mode |
string |
"NONE", "BAYER_2X2", "FLOYD_STEINBERG", etc. |
video_params |
{ frame_rate, max_frames } |
Video recording parameters |
Default Presets
The mod ships with several ready‑to‑use presets. You can modify or delete them as you like.
{
"camera": {
"material": "paper",
"camera": {
"resolution": { "width": 128, "height": 128 },
"color_mode": "COLOR",
"dither_mode": "NONE",
"video": { "frame_rate": 0, "max_frames": 1 }
},
"components": {
"minecraft:item_name": { "text": "Camera", "color": "gold" },
"minecraft:max_stack_size": 1
}
},
"camcorder": {
"material": "paper",
"camera": {
"resolution": { "width": 128, "height": 128 },
"color_mode": "COLOR",
"dither_mode": "NONE",
"video": { "frame_rate": 20, "max_frames": 200 }
}
},
"instant": {
"material": "paper",
"camera": {
"resolution": { "width": 256, "height": 256 },
"color_mode": "SEPIA",
"dither_mode": "BAYER_4X4"
},
"components": {
"minecraft:item_name": { "text": "Instant Camera", "italic": false }
}
},
"polaroid": {
"material": "paper",
"camera": {
"resolution": { "width": 512, "height": 512 },
"color_mode": "GRAYSCALE",
"dither_mode": "FLOYD_STEINBERG"
},
"components": {
"minecraft:item_name": { "text": "Polaroid", "color": "white" },
"minecraft:custom_model_data": 1
}
},
"pro_camera": {
"material": "ender_eye",
"camera": {
"resolution": { "width": 128, "height": 128 },
"color_mode": "COLOR",
"dither_mode": "NONE",
"video": { "frame_rate": 30, "max_frames": 600 }
},
"components": {
"minecraft:item_name": { "text": "Pro Camera", "color": "light_purple", "bold": true },
"minecraft:max_stack_size": 1,
"minecraft:custom_model_data": 2
}
},
"handycam": {
"material": "clock",
"camera": {
"resolution": { "width": 256, "height": 256 },
"color_mode": "COLOR",
"dither_mode": "BAYER_2X2",
"video": { "frame_rate": 15, "max_frames": 450 }
},
"components": {
"minecraft:item_name": { "text": "Handycam", "color": "aqua" },
"minecraft:max_stack_size": 1
}
},
"cctv": {
"material": "observer",
"camera": {
"resolution": { "width": 192, "height": 192 },
"color_mode": "MONOCHROME",
"dither_mode": "SIERRA",
"video": { "frame_rate": 5, "max_frames": 30000 }
},
"components": {
"minecraft:item_name": { "text": "CCTV Camera", "color": "dark_gray" },
"minecraft:max_stack_size": 1
}
}
}
Using Presets in Commands
/camera-obscura give camera
/camera-obscura give camcorder
/camera-obscura give instant
/camera-obscura give handycam Notch
Tab completion suggests available preset names.
Reloading Presets
After editing presets.json while the server is running, run:
/camera-obscura reload
This reloads both the main configuration and all presets without restarting the server.
How It Works (Technical Overview)
Camera Obscura runs completely on the server and uses a software rasterizer to draw the scene pixel by pixel.
- The renderer requests chunks and entities around the target.
- Block models are converted into triangles and stored in a cache (per chunk).
- Lighting, ambient occlusion, and fog are computed from the actual world state.
- Rendering happens asynchronously on a separate thread pool, no lag for the main game.
- After rendering, the image is converted to (a) Minecraft map(s) (or saved as PNG).
- Video recording captures frames at the configured framerate.
Performance considerations
- Higher resolution & SSAA increase CPU usage drastically.
- Render distances above 128 may cause issues if chunks are not loaded.
- Video recording is CPU‑intensive. For high‑quality recordings, consider lowering the framerate!
Troubleshooting
| Problem |
Check |
| Photo doesn't appear in inventory |
Check that cameraConsumesItem is false or you have the required item (e.g. a map). |
| “Missing required item” message |
You need the configured cameraConsumeItem material in your inventory. |
| Very long render times (> 5 seconds) |
Reduce renderDistance, ssaa, or resolution. Enable debug to see per‑frame timings. |
| Server crashes with OOM error |
Increase server memory (-Xmx2G or more). Lower renderDistance and ssaa. |
| Custom Nexo/ItemsAdder item ignored |
Ensure the camera section is correctly indented and the mechanic is spelled exactly camera. |
评论 0
登录后参与评分
还没有评论,来抢沙发吧