Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:18:34+00:00 2026-05-23T09:18:34+00:00

[Edit: I’ve found an answer – see below] I have a 3D game world

  • 0

[Edit: I’ve found an answer – see below]

I have a 3D game world on an iPhone (limited graphics speed), and I’m already regulating whether I draw each shape on the screen based on it’s size and distance from the camera. Something like…

if (how_big_it_looks_from_the_camera > constant) then draw

What I want to do now is also take into account how many shapes are being drawn, so that in busier areas of the game world I can draw less than I otherwise would.

I tried to do this by dividing how_big_it_looks by the number of shapes that were drawn last frame (well, the square root of this but I’m simplifying – the problem is the same).

if (how_big_it_looks / shapes_drawn > constant2) then draw

But the check happens at the level of objects which represent many drawn shapes, and if an object containing many shapes is switched on, it increases shapes_drawn lots and switches itself back off the next frame. It flickers on and off.

I tried keeping a kind of weighted average of previous values, by each frame doing something like shapes_drawn_recently = 0.9 * shapes_drawn_recently + 0.1 * shapes_just_drawn, but of course it only slows the flickering down because of the nature of the feedback loop.

Is there a good way of solving this?

My project is in Objective-C, but a general algorithm or pseudo-code is good too.

Thanks.

Edit: Please note I’m not asking for general advice on rendering performance. I need an answer to the specific question of how to take the shapes drawn in previous frames into account without getting flickering.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:18:34+00:00Added an answer on May 23, 2026 at 9:18 am

    Make each object remember whether it was drawn or not the previous frame.

    It it was, be more lenient with it when deciding whether it should be drawn this frame than you would be if it hadn’t been drawn the last frame. So…

    if (how_big_it_looks * (1.2 if drawn last frame, 1.0 if not) / shapes_drawn > constant2) then draw
    

    Voila, no flicker. Can’t believe I didn’t think of this sooner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: I have solved this by myself. See my answer below I have set
EDIT: The cause of the errors (see below): my default primary key in doctrine_pi.php
Edit: The below question was answered by this . I have a new updated
Edit 4: I was finally able to solve my own issue. See checkmark answer
EDIT: Updated thanks to @daroczig's lovely answer below. However, test 2 still feels like
Edit: From another question I provided an answer that has links to a lot
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
EDIT: Changed as I have a different issue with the same code 2nd Edit:
EDIT: I'll try and make it clearer sorry for the confusion. I have two
EDIT Per the comment below, here's my attempt at splitting / combining / converting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.