Ogre rendering optimization experience (2)-renderable and rendering batches, movableobject and camera cropping, simplerenderable and terrain

Source: Internet
Author: User

Before optimization, first understand the optimization principle.

1). renderable and rendering batches:

What is the rendering batch of Shenma? Let's take a look at the tutorial. In short, it greatly affects the rendering efficiency, so there are as few rendering batches as possible. for example, rendering 10000 triangles in 10 batches is much faster than rendering 10 triangles in 10000 batches,

How is a batch counted? Rendering an renderable is a batch. renderable is the smallest rendering unit in ogre, and all objects to be rendered inherit from this.

One sentence: A renderable is equal to a batching (rendering batch), reducing the renerable in the scenario reduces the batch.

How to Reduce renderable? For example, if there are two trees with the same material (two renderable trees), I can synthesize one tree (one renderable). There are two synthesis methods. One is static merge by the artist in Max, one isProgramDynamic Merge (staticgeometry)

It is worth mentioning that a mesh is not necessarily a batch, but a submesh is. If a mesh has two submesh of different materials, it is normal,

If there are two submesh with the same material, it is not good. I should immediately seek an artist and scold him. Why not combine two submesh with the same material?

2) movableobject and camera Cropping

Ogre's octreescenemanager camera cropping is based on the surrounding box, which means that objects with the surrounding box can be cropped,Is renderable bounded? No! But movableobject is available. movableobject is the basic object for moving objects. It inherits shadowcaster and can cast shadows.

It is worth mentioning that the camera's cropping is not in the unit of movableobject, but in the unit of scenenode. Only the movableobject mounted to the scenenode can be used.

Will be cropped,

3) To render, renderable, to move,Moveable. The simplest object should be simplerenderable: Public movableobject and public renderable.

I think that I used to use mesh for terrain. It was very stupid and inefficient. The mesh class should be too large to contain too many things that I don't need.Simplerenderable is the most efficient.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.