Fog with Sprite3D

Advanced game related topics
User avatar
Ypser
User
User
Posts: 19
Joined: Wed Jun 18, 2003 9:13 am
Location: Germany
Contact:

Fog with Sprite3D

Post 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.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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... !?
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Ypser
User
User
Posts: 19
Joined: Wed Jun 18, 2003 9:13 am
Location: Germany
Contact:

Post 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...
User avatar
Ypser
User
User
Posts: 19
Joined: Wed Jun 18, 2003 9:13 am
Location: Germany
Contact:

Post by Ypser »

Ok, i have nice fog now. Thanks S.M.!!! :D
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i'm interested, what was the solution in the end?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Ypser
User
User
Posts: 19
Joined: Wed Jun 18, 2003 9:13 am
Location: Germany
Contact:

Post 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.
Post Reply