Troubles with fog and alpha

guru

17-01-2009 21:48:17

Today I enabled fog/ground fog and I reall like how it makes the scene a lot more realistic. I did run into some kind of alpha/compositor trouble, though, as in this pic:
[attachment=0]alpha.jpg[/attachment]

Any pointers into the right direction would be great :)

cdleonard

19-01-2009 06:22:44

I assume you're talking about the DepthComposer class. That class relies on rendering the depth buffer to a separate texture first and reconstructing coordinates for that. Such a technique works poorly for complicated transparency.

By default that class will automatically render depth for objects in the scene; assuming no vertex deformations. If you want to output something else you can add a special technique in some materials with the scheme attribute set to "CaelumDepth". There's a demo for that in the latest CaelumSample.material. It does proper depth rendering for alpha rejection materials and simply skips all output for alpha-blended materials. That makes stuff work less poorly.

guru

20-01-2009 15:54:53

Thank you for the very fast response to my problem. And thank you again for directly supporting alpha now. I saw you implemented a test-case in CaelumLab - it's very appreciated. Frankly I doubt commercial support could be this good :)