Jump to content

Optimization question


Alienhead
 Share

Go to solution Solved by Josh,

Recommended Posts

Is there a clear advantage to updating and rendering every other loop? Granted speed variables and a few other things need adjusting to compensate. I've recently began experimenting with a controlled rendering loop and have seen some nice results.  I'm just wondering if what I'm seeing is an actual improvement or just the results of 1 frame  updated every too loops increasing the fps.

Here's a short example of what I'm talking about.

 

sets = {}
sets.optimizationlvl = 2


while appquit == false  do

		Time:Update()
		--Render the world
		if rendertick == sets.optimizationlvl then

			-- do 3d

			world:Update()
			world:Render()

			-- do 2d

			context:Sync(false)

		end

	if rendertick == sets.optimizationlvl then rendertick = 0 end
	rendertick = rendertick + 1

end

 

I'm just wondering if I'm wasting my time with this or if this framework could be tweaked in some ways to provide some additional horsepower.

I'm only happy when I'm coding, I'm only coding when I'm happy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...