portals?

I’m wondering if there’s any way to make portals such as the ones in Portal or Prey (dynamically updated portals you can see through). I assume it would use some sort of render to texture, but I was wondering if there was some way to do this in Blender (I have absolutely no GLSL knowlege). (The teleporting part is easy, with a get/set pos script, it’s the seeing through part I’m wondering about). And yes, I did a search first.

Ehh…I think the only way to make it look as good as Prey GLSL would be nice to know, but there are other ways of making it, like using some alpha and modelling the shape of the portal. But Im new to Blender GE so yeah. Hope I couldb e of some help.

Its not currently possible. Not even with the current GLSL implementation. It will, however, be possible when the ogre integration is finished. By that time, the blender ge will have full access to opengl.

I think there is one way to currently pull it off in the BGE, but it would be one ugly hack:

I had this idea some time ago about making a “duplicate room” on the other side of the wall where the portal is shot. That way, you could seamlessly cross to the other side just like in the Valve game, and you wouldn’t need any GLSL, or render to texture to pull it off. Although given that it would be quite expensive (geometry wise), because you would need two copies of the room for both portal entries.

If my theory on this is correct, all that would be required to make the “portal” illusion would be a somewhat elaborate script to determine which duplicate room side lines up with which original room side (according to where the portals were initially shot).

I was actually going to give this a try on my own, but I realized that it would be more complex than I initially thought (with finding a way on how to replicate the exact same physics actions in the duplicate room as they were in the original room, and of course, figuring out how to properly make the “infinite loop” effect without making a burn mark in my cpu).

Long story short, I decided to wait for the Ogre implementation where this can all be done much more easily. (I mean my method should theoretically work well in some situations, but it would be the very definition of “inefficiency”.)

another method i thought of that isnt pretty, but could work is taking screenshots of the other room and assiging them to the portals as textures. this isnt how it is in portal, prey, or narbacular drop, but its a cheap work around for the game engine. I really never used the screenshot python function so i dont know if or how it could be done. then you can just set the position of the player at the position of the other portal(theres more involved but thats basically it).

anyone know if the screenshot function can be used to take screenshots from other cameras rather than just the active one?

http://www.blender.org/documentation/pydoc_gameengine/PyDoc-Gameengine-2.34/Rasterizer-module.html#makeScreenshot

Yea, I thought of that too, but I’t still wouldn’t give a good illusion of a portal.

Even though you can take a screenshot on the fly, can you load it on the fly? I don’t know if there is a BGE python function that does that. (I mean wouldn’t that be render to texture in some ways?)

Not to mention that there would be no depth perception as soon as the player came considerably close to any one portal (because it is just a texture).

Ok I know this is the Game Engine fourms, but is it possible to create the same portal expcept in regular blender? Like not the game engine but for Modelling and texture wise.

Umm…yea.

If you have a prerendered animation you can pretty much do anything. The problems encountered here are simply because we are discussing a dynamic environment, based on dynamic functions.

I’ve never tried it, but the add background scene might work for that application. You would have to figure out ways so that only one background scene was being added at a time, like when the player was looking in that direction, etc. I have no idea if it would work or not, just brainstorming. Also, there’s some kind of scene bug where memory isn’t deleted when a scene is exited so that might be a problem. If I needed to do something like this, and I might with my game, I’d just repeat a section of architecture in each scene. So you have a hallway or room that you can see behind the door, and in the next scene your in that hallway.

It could probably be done by using the scene on the other side of the portal as a background scene and using a script to place the camera in the other scene relative to where the character would be.

I think oblivion might want moving portals like in half life 2 portals.

Chirpsalot: did you get the game engine working on open bsd?

nope:(…I sent a message to erwin or whoever but he hasn’t replied yet.

im going to get my dad to reinstall 2.42a and download the source code.

Yeah, you’ll need the source, but you’ll probably also need erwin to explain what to do. I’m not sure how often he checks he email here. Check his stats, he has a physics homepage that I think he checks more often.
http://blenderartists.org/forum/member.php?u=136

import GameLogic
import math

cont = GameLogic.getCurrentController()
own = cont.getOwner()

hui = GameLogic.getRandomFloat()

if (hui):
own.setPosition([0, 0, 0.9])