Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 10/15/25 20:44
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 6,732 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vecFogColor.w #420943
04/07/13 10:56
04/07/13 10:56
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

in the manual, it is written that vecFogColor is a float3 and just stores the fog color, but if imported as float4 into a shader, vecFogColor.w stores a 0 or 1 if fog is activated or not. This is very useful. If multiplied with the fog density, it automatically switches fog treatment on and off, like this:

Code:
// fog density, always 0 if fog is disabled
float fFog = vecFogColor.w * smoothstep(vecFog.x, vecFog.y, distance);

// cover pixel with fog
color.rgb = lerp(color.rgb, vecFogColor.rgb, fFog);



It would be nice if you could add that info.

Last edited by HeelX; 04/07/13 10:59.
Re: vecFogColor.w [Re: HeelX] #421003
04/08/13 13:43
04/08/13 13:43
Joined: Jul 2000
Posts: 28,028
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,028
Frankfurt
Yes, this will be documented.


Moderated by  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1