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 Jotunn · Jan 10, 2014 at 01:41 PM · sprite

How to Display Sprite Renderer like GUI Texture in 3D?

Hello. I created a Sprite Renderer, it has sprite sheet animation.

I would like to display it like GUI Texture in 3D, i.e.

  • always displayed regardless of the position of the camera

  • display position is given by a screen coordinate

  • display over all other 3D objects

I tried to assign screen position to v2f vertex(SV_POSITION) in sprite shader, but it displayed at unexpected position and disappeared when camera moved a certain distance.

(When the camera does not move, sprite does not disappear)

How can I display Sprite Renderer like GUI Texture in 3D?

Sorry my English is limited. I thank you for reading it through.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by eezSZI · Jan 14, 2014 at 05:40 PM

If you want to use it like a HUD, you could create a separate orthographic camera and put the sprite in front of it. Then set that camera to be rendered last. Otherwise you could write a script to have the texture always face the camera?

I'm not exactly sure how you want the sprite to interact with the world though.

Comment
Add comment · 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 Jotunn · Jan 15, 2014 at 12:06 PM 0
Share

Thanks eezSZI, I created a new orthographic camera for UI, set Clear Flags Depth Only, set Depth 1($$anonymous$$ain Camera's Depth is -1).

It works fine! This is what I want exactly.

Thank you very much.

avatar image Sisso · Jan 15, 2014 at 12:09 PM 0
Share

@Jotunn, I convert your "answer" into a comment. Please, don't comment in answers.

avatar image Jotunn · Jan 15, 2014 at 12:34 PM 0
Share

I'm sorry, I will be careful from now.

avatar image
0

Answer by LucasReis · Jan 10, 2014 at 02:29 PM

You have to make sure the material attached to the sprite renderer is the Sprites-Default, if you do that, i'm pretty sure they will behave as you wanted

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 Jotunn · Jan 11, 2014 at 04:02 PM 0
Share

Thanks LucasReis, but still I can't reach to the result I want.

I created new Project, new scene and new sprite renderer, and make sure the material attached to the sprite renderer is the Sprites-Default.

The result I got is this.

alt text

The result I want is below. (GUI Texture)

alt text

GUI Texture is useful, but I want to use sprite sheet animation and custom shader.

gui.jpg (44.6 kB)
sprite.jpg (45.3 kB)

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

21 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 avatar image avatar image avatar image avatar image

Related Questions

how to use texturepacker json in unity3d 0 Answers

How to deal with an animation from sprites of different sizes? 0 Answers

OnBecameInvisible not working for Sprite 2 Answers

Updating Sprite texture leaves red outline 1 Answer

for a 2d background, sprite or a quad with shader, would be best? 0 Answers


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