Guidance on adding terra pass

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
Nickak2003
Gremlin
Posts: 194
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

Guidance on adding terra pass

Post by Nickak2003 »

So I want to add a pass to terra to calculate greeble visibility. (greeble = grass/tree)
Basically, I want to fill a texture (heightmap.x * heightmap.y) with 1 or 0s depending on if the greeble at (x,y,z) is visible or not.
What I want to do is have terra run and generate its vertex data, and have backface culling occur, then pass into a shader which fills up a greeble visibility texture.

Is this possible to do?

My thinking right now, is add an additional channel to terra, and set it to the greeble texture. Then, add a compositor/pass which uses the greeble occulsion material/pixel shader.

In this material, I need to write out to the greeble texture which will be referenced from c++. A question is, can I get the x/y/z from the tex coords and height map? I'm sort of confused on translating the terra geometry into a quad/texture. Terra is rendered from a camera direction, which creates occulsion data, while the texture would be rendered top-down and represent where that occlusion data is on the heightmap.

I am sort of confused about what I'm doing or how to proceed, if I could get some guidance please.

Nickak2003
Gremlin
Posts: 194
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

Re: Guidance on adding terra pass

Post by Nickak2003 »

maybe I can render terra, but instead of outputting a color to the texture, I output a x,y,z instead. Then I could reference this texture to obtain visible vertices?

Post Reply