Static Geometry and Transparency?

Problems building or running the engine, queries about how to use features etc.
Post Reply
Posts: 3
Joined: Thu Jan 25, 2007 2:19 am

Static Geometry and Transparency?

Post by BurritoSupreme »

Is there any way at all to get alpha transparency to work with static geometry without the depth sorting problems?

I ask because I have hundreds of crossed quads clamped to the terrain to act as grass, and I need them all to be transparent, something like 90% opaque close up to around 10% far away. This is how it looks in games like Medieval: Total War and Mount&Blade.

I've tried to do this using Entities and SceneNodes but the hit to the framerate was far too severe, so I'm sure I need to use static geometry because I'm using so much grass. Oh and alpha_rejection won't work as I need to make the whole texture transparent, not just parts of it.

Any suggestions, or am I just out of luck here?
User avatar
Posts: 260
Joined: Mon Sep 01, 2003 3:59 am
Location: London, United Kingdom
x 1

Post by gerds »

Static geometry will not depth sort so you can't use them for semi-transparent rendering. You can only get away with transparencies *if* you can use alpha_rejection.

If you want to render hundreds of entities (ie: blades or patches of grass) you'll have to use gpu hardware somehow, either with your own shader, check out the grass sample with ogre, or using hardware instancing (which I believe is checked in under a different branch at the moment).

I think hardware instancing is more aimed at rendering heaps of people, but I'm assuming you could sort the instances by eye-distance and render hundreds of patches of grass ok.
Post Reply