Non-Euclidean Worlds Engine [video]
Prey (2006) modified a version of the Doom 3 engine to add portals as well as shifting gravity for similar effects.  I don't recall if it did size changes as well.Demo/trailer
https://www.youtube.com/watch?v=zpQRePtEpRwhttps://en.wikipedia.org/wiki/Prey_(2006_video_game)https://en.wikipedia.org/wiki/Id_Tech_4This tech predates Valve's Portal, although I doubt it is the first attempt at this.