02-24-2008, 09:49 AM
why stencil shadows not affected with the fog(look to the picture)?
how can i solve this problem?
02-24-2008, 02:04 PM
That is because your shadowing algo is rather dumb - sou simply blend your screen picture with dark-gray rectangle, isn't it? And fog applies depending on the screen-distance. So to do this correctly, you should think a little bit.
You may write rather simple fragment program, which takes screen depth, converts it to distance and simulates fog, and use it when full-screen blend pass occurs.
Or you may cancel with full-screen blending and make double-pass, first one is Z-fill pass with ambient lighting, stencil-test disabled, second pass doesn't modifies depth, makes diffuse lighting, and stencil-test enabled.
Or you may implement smth your own.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.