Front to back rendering

Started by jamfull, July 26, 2013, 07:32:06 PM

Previous topic - Next topic

jamfull

Does anyone know why terragen renders from back to front (or far to near)? A lot of scenes have a lot of redundant rendering of blocked objects, terrain, water etc... It seems it would be way more efficient to render from front to back. I imagine there is a good reason it's the current way but is it possible to switch? I found an old post online and it said terragen classic rendered front to back. Was there an intentional change at some point?

James


Matt

#2
If you are just rendering terrain and sky, Terragen does attempt to render front to back. Within each bucket (tile), the renderer roughly sorts the scene elements from front to back and renders in that order. In some case it doesn't do a very good job because of large displacements or very large objects such as lakes. This is an area that could be improved upon.

If you have a certain object that you want Terragen to render first, in Terragen 3 you can use the "sorting bias" control on that object. A very big positive number e.g. 10000000 (or 1e7) will usually force the object to render first. If you want to make sure that an object such as a lake renders after most of the terrain, use a very big negative number on the lake, e.g. -10000000 (or -1e7). This only works for objects that are rendered using the micropolygon renderer (not in the ray tracing pass).

If you have imported objects or other built-in non-displaceable objects (Grass Clump and Card) and you render with "ray trace objects" turned on, these objects are rendered in a separate ray tracing pass. Terragen chooses to render the terrain (and other displaceable primitives) first so that it has a depth map available to figure out which parts of the ray traced objects should be hidden. It would be possible to render the ray traced pass first, but for most Terragen scenes this would be slower.

We have plans to introduce a more unified render method in future versions of Terragen which will render everything in one pass. There are some benefits to this (such as eliminating the overdraw we are talking about here), but also some disadvantages in some cases.

(EDIT: I changed some of the numbers above.)

Matt
Just because milk is white doesn't mean that clouds are made of milk.

jamfull

Thanks guys. I'll look into the sorting bias control.

James