Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 1,112 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, this will be documented.


Moderated by  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | chip programmers | 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