Page 1 of 1

pixel shader output issue.

Posted: Mon Oct 20, 2008 6:50 pm
by Mirror
Hi.

I had this and was working fine ( The Color variable gets read by the next shader ) :

Code: Select all

struct PS_OUTPUT
{
	float4 Color		: COLOR;
};

...

	PS_OUTPUT Out = (PS_OUTPUT).0;

...

	float4 Color2;
	Color2.rgb = Color;
	Color2.a = In.TexCoord.z;

	Out.Color = Color2;

	return Out;
Now, if i make it like this :

Code: Select all

struct PS_TO_NEXT
{
	float4 Color		: COLOR;
	float Depth	: DEPTH;
};

...

	PS_OUTPUTT Out = (PS_TO_NEXT).0;

...
     
	float4 Color2;
	Color2.rgb = Color;
	Color2.a = In.TexCoord.z;

	Out.Color = Color2;
	Out.Depth =0;

	return Out;
When it's done like this ( with actually no change other than adding just the second pixel shader output variable, which is nullified ) the Color variable doesn't get read any more correctly...Any ideas ?

2nd question, I have an nvidia 6600 128MB ( desktop PC ) and when i try to use EPST_VS_3_0 or EPST_PS_3_0 it doesn't get recognized. Isn't the geforce 6 series supposed to support vs/ps 3.0 ? the exact error is

Code: Select all

HLSL pixel shader compilation failed:
error X3506: unrecognized compiler target 'ps_3_0'
when i change to

Code: Select all

				video::EPST_PS_3_0,

Posted: Tue Oct 21, 2008 2:16 am
by BlindSide
Not sure why you're getting those problems, probably an outdated Direct3D installation (Either the SDK, redist or the drivers, update them all).

This

Code: Select all

PS_OUTPUTT Out = (PS_TO_NEXT).0;
should be:

Code: Select all

PS_TO_NEXT Out = (PS_TO_NEXT)0;
(Don't need shader knowledge to figure that one out.)

Cheers

Re: pixel shader output issue.

Posted: Tue Oct 21, 2008 1:06 pm
by Cez
Mirror wrote:
2nd question, I have an nvidia 6600 128MB ( desktop PC ) and when i try to use EPST_VS_3_0 or EPST_PS_3_0 it doesn't get recognized. Isn't the geforce 6 series supposed to support vs/ps 3.0 ?
I had a similar problem some times ago and I had to recompile irrlicht source code to get it working...

But in your case, it may be something else.

Posted: Tue Oct 21, 2008 3:20 pm
by Mirror
BlindSide wrote:Not sure why you're getting those problems, probably an outdated Direct3D installation (Either the SDK, redist or the drivers, update them all).

This

Code: Select all

PS_OUTPUTT Out = (PS_TO_NEXT).0;
should be:

Code: Select all

PS_TO_NEXT Out = (PS_TO_NEXT)0;
(Don't need shader knowledge to figure that one out.)

Cheers
Blindside, thank you for your reply. Now, that is not the case about the PS output, those naming inconsistencies are only in the forum not in the actual shader, since i wanted to change it from PS_TO_NEXT to PS_OUTPUT so that it could be more obvious in the forum, so there are no such inconsistencies in the actual shader.

I will post it again in order to be more obvious.

This works :

Code: Select all


struct PS_TO_NEXT
{
	float4 Color		: COLOR;
//	float Depth	: DEPTH;
};

	PS_TO_NEXT Outs = (PS_TO_NEXT).0;

	float4 Color2;
	Color2.rgb = Color;
	Color2.a = In.TexCoord.z;

	Outs.Color = Color2;
	//Outs.Depth = 0;
	return Outs;
this doesn't :

Code: Select all


struct PS_TO_NEXT
{
	float4 Color		: COLOR;
	float Depth	: DEPTH;
};

	PS_TO_NEXT Outs = (PS_TO_NEXT).0;

	float4 Color2;
	Color2.rgb = Color;
	Color2.a = In.TexCoord.z;

	Outs.Color = Color2;
	Outs.Depth = 0;
	return Outs;
edit: thanks also to cez, recompiling irrlicht solved the unrecognized ps/vs 3.0 issue :)