camera
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
camera [2025/01/15 04:35] – external edit 127.0.0.1 | camera [2025/05/27 20:33] (current) – adjusted wording bottinogames | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Camera ====== | ====== Camera ====== | ||
- | ==== Camera.SetReplacementShader ==== | + | ===== Camera.SetReplacementShader |
SetReplacementShader will not render objects if their original materials don't contain any properties required by the replacement shader. For example, if your replacement shader uses _MainTex, and there is an object in the scene that doesn' | SetReplacementShader will not render objects if their original materials don't contain any properties required by the replacement shader. For example, if your replacement shader uses _MainTex, and there is an object in the scene that doesn' | ||
Line 9: | Line 9: | ||
Shaders can be replaced in the SceneView using '' | Shaders can be replaced in the SceneView using '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Camera.targetTexture ===== | ||
+ | |||
+ | According to the Unity Documentation: | ||
+ | "When rendering into a texture, the camera always renders into the whole texture; effectively rect and pixelRect are ignored." | ||
+ | |||
+ | This behavior is inconsistent across target platforms. On windows, the camera will use the rect and/or pixelRect. On OSX, Android, and iOS, the camera rect will be ignored. (tested on Built-in Render Pipeline, Unity 6000.0.34f1) | ||
+ | |||
+ | If you have need to render into a sub-rect on render texture on those platforms, there are workarounds: | ||
+ | * For BiRP, using Camera.SetTargetBuffers will render to the target buffers utilizing the rect/ | ||
+ | |||
+ | * For URP/HDRP, a similar effect can be achieved with CommandBuffer.SetViewport and CommandBuffer.EnableScissorRect. (untested) [[https:// |
camera.1736915747.txt.gz · Last modified: 2025/01/15 04:35 by 127.0.0.1