Sign in to follow this  

Rendering meshes in Begin/EndScene()

This topic is 3845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. If I have to render all my meshes between the Begin/EndScene() functions, that would noticeably degrade the performance of my app and look ugly, right? Since that bit of code is processed on each frame. Thanks.

Share this post


Link to post
Share on other sites
Yes, you have to render everything between Begin and End, and you have to call it every frame, because you clear the screen every frame. While technically this degrades performance relative to not rendering things, if you don't render anything you don't have much of an application.

Attempts to not clear the screen, and keep dirty rectangles and such like used to be common with old 2D games, will likely be much slower and more error prone due to the added complexity of doing this in 3D (lots of projection and CPU-side transformation of the rendered vertices would be involved).

I don't understand what you mean when you say you think it would look ugly. You have to render between begin/end and you have to render each frame (well, unless nothing moves, I guess...). There is no way around it. It won't look ugly, it will look like what you render, which is probably nicer than the only alternative which is to render nothing. And get a pretty blank screen.

Share this post


Link to post
Share on other sites
Look into some form of view-culling. It's unlikely that you'll have to render all the meshes in your game world for each frame, so you should be using some method to test which meshes are actually visible and require rendering.

However, as jpetrie says, this isn't related to the Begin/End scene methods, which are required for any rendering to occur.

Share this post


Link to post
Share on other sites

This topic is 3845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this