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 ThibaultD · Sep 18, 2012 at 07:00 AM · camerarenderfullscreen

Manual camera render on fullscreen flicker/ghosting issue

My setup use various cameras. Most are automatically rendered on the usual Update Unity loop, but one of them is manually rendered using camera.Render() at a specific target framerate. I can switch from one camera to another and everything works fine in windowed mode.

However, when I try it in fullscreen, the manually rendered camera flickers. It is rendered as if the video double/triple buffer was rendered in a random order, or that the camera was rendering previous images in between my fixed framerate calls. I cannot provide a screenshot because each individual frame is fine, it is only the sequence of rendered frames which is corrupted.

Just to be sure, I removed the camera post effects like FXAA, but to no avail.

Maybe the problem comes from the way I "manually render". All cameras are disabled and I call camera.Render() in FixedUpdate() when I determine the timing is right to match the framerate I am targeting.

Does anyone have an idea? I don't know much about rendering, so maybe the trick is simple and obvious.

By the way, this happens on Windows 7, using various NVidia cards: GT220, GTX560Ti and GTX670.

Comment
Add comment · Show 1
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 ThibaultD · Sep 21, 2012 at 01:48 AM 0
Share

Some more explanations and a workaround:

In fullscreen mode, the screen buffer is randomly filled with previous buffers when Unity feels like rendering between explicit camera.Render() calls. In windowed mode, the screen buffer is left untouched between render calls, which is the expected behaviour (expected by me at least!)

In the light of this, I used the following workaround:

1) The camera is set up to render to a texture:

 screenRect = new Rect(0, 0, Screen.width, Screen.height);
 cameraTexture = new RenderTexture(Screen.width, Screen.height, 24);
 camera.targetTexture = cameraTexture;

2) I call camera.Render() in FixedUpdate() when I deter$$anonymous$$e the ti$$anonymous$$g is right.

3) In Update, I draw the texture rendered in 2):

Graphics.DrawTexture(screenRect, cameraTexture);

This workaround basically does not let the fullscreen mode play by itself. It explicitly draws several times the exact same buffer.

This works for me, but I am still interested in hearing why the fullscreen mode does that.

0 Replies

· Add your reply
  • Sort: 

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

10 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

Related Questions

Set renderable objects on camera without Layers 2 Answers

Can i render a camera to a gui texture? 1 Answer

Detailed render for far away objects? 1 Answer

Masking camera from rectangular to arbitrary shape 0 Answers

RenderTexture on RawImage requiring second camera? 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