You would know, I suppose, with the same level of confidence that you "know" the actual leaf. That is part of the fun of virtual reality. What is the difference between the online and offline worlds? Science does not have a privileged claim or unique relation to the actual world. Science uses the same language that other language games use to both describe and create reality. There is no peering around the edges of language to gain an unmediated view. Rather, our descriptions of percepts become more plausible; our percepts are then open to alteration by experimentation and by the descriptions themselves. This is the Kuhnian position. Is this Idealism or Materialism? Wittgenstein avoided these categories. Elizabeth Anscombe has called him a "linguistic realist." I'm not sure how helpful this label is.
Christopher Robinson & Joseph Duemer read Wittgenstein's Philosophical Investigations