Sign in to follow this  
duskndreamz

Directx 9 Rendering getting stuck

Recommended Posts

duskndreamz    179
Hi,
I am rendering a extensive visual world with about 95K poygons.

While travelling through the world by moving the camera visual tends to get stuck at some locations for a couple of frames where the polygons are in high density.

My normal frame rate is 50, but it just gets stuck a lot.

Please suggest me what to do.

Share this post


Link to post
Share on other sites
Buckeye    10747
1. Create a low poly version of each object for rendering when the object is far enough from the camera that detail isn't required.

2. Test each object against the viewing frustum and don't render it if it's not visible in the view. The fastest triangles are the ones that aren't drawn.

3. If you're using the FFP, use a shader. It may be faster.

4. Set your projection far-plane to a smaller value to reduce the number of objects in view. Use fog to hide the far end of the frustum.

Share this post


Link to post
Share on other sites
duskndreamz    179
Quote:
Original post by Buckeye
1. Create a low poly version of each object for rendering when the object is far enough from the camera that detail isn't required.

2. Test each object against the viewing frustum and don't render it if it's not visible in the view. The fastest triangles are the ones that aren't drawn.

3. If you're using the FFP, use a shader. It may be faster.

4. Set your projection far-plane to a smaller value to reduce the number of objects in view. Use fog to hide the far end of the frustum.


Thanks a lot for your reply.

I just had another query, is it advisable to have multiple small objects or a single big object?

also for your 4th .Point: using fog to hide far end of the frustum, For rendering a clear day also, would fog be helpful (by probably changing the fog color)

Share this post


Link to post
Share on other sites
Buckeye    10747
Quote:
is it advisable to have multiple small objects or a single big object?

That's difficult to answer because "multiple" can be anything from 2 to a million. The answer to your question is: "what works best with your application."

Culling objects from the view before you render the scene is probably the most important step. So, for those objects which aren't culled and will be rendered, the primary effect on performance will be the setup time to render each object (setting matrices, textures, materials, etc.)

You'll have to do a bit of profiling of your rendering loop if you want to improve performance. Do testing with various size objects to see what works with your program. For smaller objects, you'll lose time setting up each render. For larger objects which are only partially within the frustum, you'll lose time rendering triangles that get partially processed and then culled if they're not in the frustum. It's a tradeoff.
Quote:
using fog to hide far end of the frustum, For rendering a clear day also, would fog be helpful (by probably changing the fog color)

Anything that reduces the number of triangles being drawn will help. And there really isn't a "clear" day. There's always atmospheric haze, due to moisture, dust, etc., so you always have an excuse to use fog. A "clear" day is just a day when the far-plane of the frustum is farther away from the near-plane. Yes, the color of the fog is usually a color that closely matches the "sky" so that far objects just "disappear," appearing to become "sky."

Just to make it clear, the reason for using fog, besides adding some nice realism to the scene, is to cull objects from rendering which are beyond a certain distance.

Share this post


Link to post
Share on other sites

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