Make the eyedropper a hybrid material/screen pick
On a foreign object the pipette now reads the data channels (metallic/smoothness/occlusion/emission) texel-exact from the material while taking albedo from the rendered, fully-lit on-screen pixel - so the picked colour honours baked lightmaps/ambient/SSAO while keeping the material's PBR fidelity. Falls back to a pure screen pick when no readable UV is available. Pull the render+readback out of PickFromScreen into a shared TrySampleScreenColor. The pipette now also arms on Ctrl (in addition to Shift), and Ctrl+wheel resizes the brush; the orbit camera ignores the wheel while either modifier is held so it does not zoom and resize at once. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
db10eef525
commit
188f16a4e8
3 files changed
+110
-49
No files matched your search
@@ -191,9 +191,9 @@ public class ThirdPersonOrbitInput : MonoBehaviour
|
||||
|
||||
float scale = CurrentScale();
|
||||
|
||||
// Shift+wheel is reserved for the paint brush resize (MeshPainter), so the orbit camera
|
||||
// ignores the wheel while Shift is held - otherwise it would zoom and resize at once.
|
||||
float scroll = ShiftHeld() ? 0f : ReadScroll();
|
||||
// Shift/Ctrl+wheel is reserved for the paint brush resize (MeshPainter), so the orbit camera
|
||||
// ignores the wheel while either is held - otherwise it would zoom and resize at once.
|
||||
float scroll = (ShiftHeld() || CtrlHeld()) ? 0f : ReadScroll();
|
||||
if (!Mathf.Approximately(scroll, 0f))
|
||||
{
|
||||
// One wheel notch = one zoom step (sign only), independent of the platform's raw wheel
|
||||
@@ -280,6 +280,19 @@ public class ThirdPersonOrbitInput : MonoBehaviour
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool CtrlHeld()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
var kb = Keyboard.current;
|
||||
if (kb != null) return kb.leftCtrlKey.isPressed || kb.rightCtrlKey.isPressed;
|
||||
#endif
|
||||
#if ENABLE_LEGACY_INPUT_MANAGER
|
||||
return Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
Vector2 ReadMouseDelta()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
|
||||
Reference in new issue
Block a user