Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to do fog with HLSL #42167
03/06/05 23:51
03/06/05 23:51
Joined: Aug 2003
Posts: 183
BionicHero Offline OP
Member
BionicHero  Offline OP
Member

Joined: Aug 2003
Posts: 183
Just when I thought I understood HLSL there's always something to throw me back to zero. All I wanted to do is add fog to the water shader. So what I did was turning this:
Code:
 
struct VS_OUTPUT
{
float4 Pos: POSITION;
float2 texCoord: TEXCOORD0;
float3 eyeLinear: TEXCOORD1;
};


into this:
Code:
 
struct VS_OUTPUT
{
float4 Pos: POSITION;
float2 texCoord: TEXCOORD0;
float3 eyeLinear: TEXCOORD1;
float fog: FOG;
};


If I'm already wrong here please tell me. Then (for testing) the vertex shader for calculating fog looks like this:
Code:
 Out.fog=1.0; 


Yes, I know it's stupid, but it's just for testing.
And my pixelshader just multiplies the output color with this value:
Code:
 reflection *= In.fog; 


But when I run it I get "error X4502: invalid reference to the input semantic 'POSITION0'". The line given is the declaration of the vertex shader output "float4 Pos: POSITION;".
Could anyone help me on this one? I really don't get it...

Re: How to do fog with HLSL [Re: BionicHero] #42168
03/08/05 09:31
03/08/05 09:31
Joined: Aug 2003
Posts: 183
BionicHero Offline OP
Member
BionicHero  Offline OP
Member

Joined: Aug 2003
Posts: 183
Anyone???


Moderated by  Blink, Hummel, Superku 

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