Page 1 of 1

Fog with Sprite3D

Posted: Fri Dec 23, 2005 6:52 pm
by Ypser
Hello world!
I am working on a 3D-Engine using PBs Sprite3D.

Image

Now i want to have fog and night effects but dont know how to do it.
I could put a semitransparent fog sprite over every texture, but that would make it very slow.
So i thought that there may be a way to fade a sprite on the fly, like to color it with
Danilos code. I think S.M. did it in his great Sprite3DReal-Engine, so it must be possible.

Any ideas? :roll:

Thanks for help.

Posted: Fri Dec 23, 2005 11:26 pm
by va!n
mhhhh.. very nice awesome engine... whats about using a 2d or (better 3d) sprite like 256x256 and resize it to the screen resolution.. you can do some bleding stuff and you can do some fog effects and day/nigght effects too!?

another idea is to use for example 4 different screen sized textures and positition it (also its transparent) in the distance of y... !?

Posted: Sun Dec 25, 2005 7:48 pm
by Ypser
Thats what i'm doing now. But i have to do it with EVERY texture which is displayed, because fog or darkness
depend on the distance to the camera. Thats why its very slow, cause this method doubles the number of sprites displayed...

Posted: Mon Dec 26, 2005 7:54 pm
by Ypser
Ok, i have nice fog now. Thanks S.M.!!! :D

Posted: Mon Dec 26, 2005 8:15 pm
by blueznl
i'm interested, what was the solution in the end?

Posted: Mon Dec 26, 2005 8:48 pm
by Ypser
The solution was a procedure named "DisplaySprite3DMultiTexture()", Stefan gave me.
It lays a sprite over a Sprite3D with alphablending and displays the result.