Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Setsuki · Oct 24, 2013 at 08:34 AM · billboard2d characterz-buffer

Billboard in front of 3D object

Hello everyone, I am currently facing a rendering problem. In our game, the character is a sprite rendered on a plane, living in a 3D world. The plane is a billboard always facing the camera, camera which is over his head. So, the plane is almost horizontal to show a character standing vertically. It provokes visual problems when the billboard goes through a wall.

To prevent this, I made a shader changing the offset, giving our character a little more space.(Shader is Cutout diffuse with "Offset 0,-150" added) alt text

for the walls, the solution works, but when the character is next to anything, it hurts my brain.

alt text

Since the player is behind the cube, the shadow is rendered on him, but because of the shader, the head of the player is rendered above the cube.

I don't really know how to ask the question (probably part of the reason I can't find the answer) Does anybody knows how I could have my character feel like he's vertical ?

1.jpg (251.7 kB)
2.jpg (216.6 kB)
Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Tarlius · Oct 24, 2013 at 09:34 AM

This was asked a while ago but I couldn't find the post either >.> There are a few approaches to this problem, each with their own catches.

The easiest way will be to set layers so that the sprite will alway be drawn on top of the background. The catch is it will only work for simple cases.

Another approach is be to skew the sprite so that its always upright. Catch is that your sprite may look odd and shadows might look weird

The most realistic way to do it would be to have a separate texture to represent depth and a shader that calculates whether each pixel should be drawn. This is the approach that The Sims used for the furniture/etc. The catch is it will be a pain to implement.

Comment
Add comment · 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 Setsuki · Oct 24, 2013 at 10:10 AM 0
Share

Thanks, I already thought of each solution, and of course, the one that I would like to be able to implement is the last one, I'm already trying to work on it.

avatar image
0

Answer by JonahStrix · Feb 17, 2015 at 07:27 AM

The best solution I could come up with was to use cylindrical billboarding for depth calculations and spherical for the quad's actual position. This allows you to use spherical billboarding while ensuring the quad's depth remains constant.

If needed I have more details here.

Comment
Add comment · 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
0

Answer by brokilodeluxe · Mar 18, 2018 at 06:42 PM

Did you ever come up with a fix for this?

I've been playing with shaders for the past week and just cannot figure it out.

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Billboard in front of 3D object 2 Answers

How do I display a web page on a cube 2 Answers

Billboard grass rotate weird 1 Answer

Lookat on local axis 2 Answers

How do I Fade Terrain Tree's to Blend with Billboard? 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