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
6
Question by Andrew 8 · Dec 02, 2010 at 04:40 AM · editorscenewindowhandlesdepth-buffer

Rendering a camera to an Editor Window

Hello,

I've been trying to set up an Editor Window that mimics the default Scene View with a few extra project related features, similar to a middleware solution. To do this, it needs to render a camera created and hidden with hide flags to the window, and then have additional details drawn in relation to specific points in the scene.

I've done this by using Handles, but the documentation for this class is both deprecated and not very descriptive. I've got it rendering properly and all of the extra features functioning, but there is a major crippling bug.

The camera does not render with a depth buffer, so objects are "randomly" drawn over other objects. I don't think its a problem with how I'm using the Handles class, because when I try directly calling .Render() from the camera it still rendering incorrectly. I've commented out all of my other code when I do this, so I am sure it is nothing I have done wrong, but more what I'm not doing.

Here's what I've found out from trying to debug this problem over the last few days:

  • The camera itself is fine, if I don't hide it with hide flags and view the preview in the default Scene View, it renders correctly.
  • The scene can be renderred correctly with a Render Texture, but what I'm working on has to be usable on an Indie version of Unity (I myself have a Pro License). I am also in doubt some of the required features will work in conjunction with Render Textures.
  • It's nothing wrong in my code, as I've tried rendering in an empty class with no adjoining code seperately to my main Editor Window, so it has to be a limitation of the editor scripting or something that I'm not doing (like telling it to render with depth).

Does anyone have any experience with this type of problem? I haven't been able to find any related questions posted on the site, besides these:

http://answers.unity3d.com/questions/27275/how-to-create-an-editor-screenview-like-camera-preview-window-for-cameras

http://answers.unity3d.com/questions/24070/debug-rendering-using-the-depth-buffer

These were the closest I found and neither helped solve the problem. So either my problem is really simple (probably), or not many people are doing this (less likely).

Thanks.

Comment
Add comment · Show 2
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 numberkruncher · Jul 24, 2012 at 04:41 PM 0
Share

Same problem; though I tried using non-Pro version of Unity. It seems to ignore the depth buffer entirely, however if you select the camera the preview window in scene view is correct...

avatar image numberkruncher · Jul 24, 2012 at 04:44 PM 0
Share

I am very keen for an answer of this question because it is holding me back atm. $$anonymous$$y extension must too work with both pro and non-pro versions of Unity :)

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by vlevykin · Jan 01, 2013 at 05:11 PM

How do you render? I use Handles.DrawCamera and had similar depth problem. Somehow setting drawMode to Textured helped me. But could somebody explain this?

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 scanzy · Oct 16, 2015 at 03:18 PM

With Unity 5 now RenderTexture is FREE, so everything turns out to be so much easier!

http://unity3d.com/support/documentation/Components/class-RenderTexture.html

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Issues with Handles not being at a right position 0 Answers

Drawing Handles 1 Answer

Editor scene preview window 0 Answers

Scene Box/Rectangle Editor. Does one exist? 0 Answers

Strange Handle names. 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