Aperture Science Portal Rendering

Before I begin, I want apologize for the extreme ambiguity of this question. I’m reading some old code and I’m afraid I’m getting lost in the terminology and some techniques. Since it’s built upon JME2, I’m afraid these forums are my only resource for assistance. The gist of it is an implementation of portals similar to the esteemed video game.



From what I can tell, the portals are being rendered to the same renderbuffer that the canvas UI component uses, calling it the onscreen renderbuffer. My first question is, why use this renderbuffer instead of an arbitrary buffer?



Second, there is a fair amount of camera updating and applying and I’m not sure how this is related. Does it sound familiar at all?



Lastly, at the end of each scene render, the GLCanvas calls swapBuffers(). Is there a 30 second reason why this needs to be done?



I apologize for all the ambiguity, if you didn’t notice, I’m quite lost. I appreciate any and all support given!



thanks!

jW

If you are lost, why not drop the old jME2 code, use JME3 and take the issue from the other side :

What would you need to create a portal like in Portal?



You need to render the scene from another point of view. This render will be applied as a texture on a wall for example.



In jME3 this can be done with preViewPorts and frameBuffers.

Look at this code example, it renders the scene from another point of veiw and apply the resulting texture on a cube

http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestRenderToTexture.java

1 Like

Nehon,



Thank you so much for the response! I would absolutely love to migrate to JME3, though I’m stuck with some constraints of an existing codebase and unfortunately I need to live with JME2. That being said, I assume the idea of swapping buffers and using cameras with renderbuffers are higher level concepts that can be useful regardless of game engine. Is this incorrect?



thanks again for the response!

jW

You are correct yes.



But I’m afraid I can’t help you then, because I’m not familiar at all with jME2, and the rendering workflow is very different in jME3.