Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,699 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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