- Home /
Camera panning on pre-rendered backgrounds
Hi, I'm currently working on RPG games using pre-rendered BG like old JRPG in PS1; FF, Dragoon, Chrono Cross, etc. I encounter a problem as to how to pan the camera to follow character movement. The camera stays on certain position to keep the pre-rendered BG perspective match the colliders, only pan around to follow character. This is what I want to achieve: https://youtu.be/bX1VrZA1nbY?t=17m11s
I've tried several methods:
OffsetVanishingPoint : this is almost perfect except I can't convert player position to projection matrix of the camera, not so feasible.
This answer : is using GUITexture which is not really good technique because it needs huge resolution to keep the quality, also I don't really see how to pan around the GUI to track player movement using this technique.
Right now, I use RenderTexture to capture all 3d colliders and background, and put them into one plane with RenderTexture's material attached to it, so I can move around the camera looking straight into this plane without making any perspective mismatch. But then again, I don't know how to convert my real 3d character's world position to the RenderTexture's position.
Any idea how can I solve this? I've been looking workarounds since forever and can't really seem to find the right solution. Thanks.
Answer by wibble82 · Nov 13, 2015 at 03:18 PM
Hi Cazmi
I would propose that maybe you're going about it slightly the wrong way. Typically the old school 'pre rendered sprite' game was entirely 2D - just an orthographic camera pointing at some cleverly drawn sprites that sit in different layers. In addition, you'd have 2D colliders manually created to block the 2D player collider from intersecting them.
If you do want to go full 3D physics, I'd suggest you need to do a billboard like effect, and rotate your textures (using quad meshes) to be at the correct location (based on their 3D position) and facing the camera. That said, if you're going to the effort of trying to match colliders to 2D images, I don't know why you'd bother with 3D at all - it just seems to complicate things!
-Chris
@wibble82 I did use orthographic back then, but it felt off. What I mean is the character would stay at the same angle wherever he goes. But this video tells different story ; it's clearly perspective. Look at them when they're going all the way down to the bottom of the stairs. Yes you're right, this is exactly what I've been doing
Answer by Cazmi · Nov 15, 2015 at 10:17 AM
So, no one can help me? I'm really desperate lol
Hey Cazmi!
You ever find an answer? We're in the same situation as well
Hey, I actually found some hackish workaround for this matter. Not looking neat, but yeah it works. I'm gonna share it once I get back home.
Hey Camzi! Been working on and off again on our project as well.
Offsetvanishingpoint does indeed work, but like you stated, getting it to track the player is pretty difficult. Just wanted to check in with you again and see if you had found any other ways to approach it.
Thanks!
Your answer
Follow this Question
Related Questions
Rendering the same Render Texture differently to separate cameras 0 Answers
2D Infinite Runner - Pan camera by screen height 1 Answer
Culling Mask with Depth Occlusion 1 Answer
How do you programmatically retrieve the rendering camera from its render texture? 2 Answers
Multiple camera One rendertexture (panoramic view) Please Help Very Important!! 1 Answer