• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by Cazmi · Nov 13, 2015 at 01:54 PM · camerarendertexturepanning

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:

  1. OffsetVanishingPoint : this is almost perfect except I can't convert player position to projection matrix of the camera, not so feasible.

  2. 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.

  3. 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.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image

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

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cazmi · Nov 14, 2015 at 12:07 AM 0
Share

@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

avatar image

Answer by Cazmi · Nov 15, 2015 at 10:17 AM

So, no one can help me? I'm really desperate lol

Comment

People who like this

0 Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ChristmasGT · May 02, 2016 at 11:48 PM 0
Share

Hey Cazmi!

You ever find an answer? We're in the same situation as well

avatar image Cazmi ChristmasGT · May 03, 2016 at 09:35 AM 0
Share

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.

avatar image ChristmasGT Cazmi · May 09, 2017 at 10:34 PM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Error node.m_Bounds.IsValid() on UnityEngine.Camera:Render() 1 Answer

Camera.RenderWithShader not working as of Unity 5.3? 0 Answers

First Person Camera Pixelation 1 Answer

RenderTexture.active for a non-VR camera in a VR project 0 Answers

Steam VR Render object to only one eye 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges