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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, AndrewAMD), 1,076 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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