RectLight: textured light under a non-uniform scale samples and looks up the texture with the unscaled size
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 57/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cpp
调研方向
Read lib/rendering/pbr/light/RectLight.cc and Light.cc, especially RectLight::update(), updateParamAndTransforms(), and updateTransforms(). Reproduce the mismatch with a textured RectLight scaled by (2, 1, 1) and compare light-only with BSDF-only sampling. Done means both sampling paths agree for the scaled textured light, as they do for the unscaled equivalent.
由索引模型根据 Issue 内容生成。
描述
Summary. A textured RectLight whose node_xform scales it non-uniformly samples and looks up its texture with the unscaled size: light sampling and BSDF sampling disagree. Without the texture, or without the scale, both agree. Version 2026.29.1, scalar mode.
Reproduce. Diffuse floor, RectLight with width 1, height 1, a texture, scale(2, 1, 1) in node_xform, max_depth 1:
| light | light_samples only |
bsdf_samples only |
|---|---|---|
| width 1, scale(2, 1, 1), textured | 0.0907 | 0.0715 |
| width 2, no scale, textured | 0.0892 | 0.0891 |
Cause. RectLight::update() (lib/rendering/pbr/light/RectLight.cc) sets mHalfWidth/mHalfHeight from the attributes and passes them by value to updateParamAndTransforms() (Light.cc). That function first calls updateTransforms(), which for a non-uniform scale multiplies mWidth/mHeight (and mHalfWidth/mHalfHeight) by the scale, and then builds the texture uv mapping (getScaleOffset) from the stale, unscaled values it was given. So sample() maps uv in [0, 1] to the middle part of the light only, while reporting the density of the whole area, and intersect() gives uv outside [0, 1] on the outer parts.
Fix (untested). Compute the uv mapping after updateTransforms(), e.g. pass the scaled half sizes, or set the uv scale and offset from the members after the call.
- 主要语言
- CMake
- 星标
- 4.7k
- 派生
- 321
- 平均合并
- 13 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenMoonRay/openmoonray 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
OpenMoonRay/openmoonray#332 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
OpenMoonRay/openmoonray#320 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
OpenMoonRay/openmoonray#233 ·
-
难度 3/5 1-2 天 新手友好度 68/100
OpenMoonRay/openmoonray#330 ·
-
难度 4/5 3-5 天 新手友好度 52/100
OpenMoonRay/openmoonray#329 ·
查看 OpenMoonRay/openmoonray 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
godotengine/godot#125211 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 83/100
rive-app/rive-runtime#143 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
bug: get_image_info returns true after copying an uninitialised buffer into the caller's output when every UDIM tile is unreadable可能已有人在做 @lgritz 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
AcademySoftwareFoundation/OpenImageIO#5662 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
JiaFeiMiao-K-Cat/DiscImageStudio#132 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复