Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, alibaba, Konsti, 2 invisible), 1,418 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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