pixel shader output issue.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

pixel shader output issue.

Post 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,
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post 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
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Cez
Posts: 3
Joined: Wed May 21, 2008 6:42 pm

Re: pixel shader output issue.

Post 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.
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post 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 :)
Post Reply