XEffects problems with vertex shader

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
balor
Posts: 5
Joined: Wed Mar 04, 2009 4:48 pm
Location: PL

XEffects problems with vertex shader

Post by balor »

Hi,
I'm trying to use XEffects to my current project based on Irrlicht 3D engine for 2 days now. The problem is, that I don't see geometry on screen, because, I think, of the vertex shader error, so the XEffects can't render it.

This is the error I got when I'm debugging program (c++ compilation runs ok) even with only effectHandler initiated:

HLSL vertex shader compilation failed:
error X3506: unrecognized compiler target 'vs_3_0'

HLSL vertex shader compilation failed:
error X3506: unrecognized compiler target 'vs_3_0'

HLSL vertex shader compilation failed:
error X3506: unrecognized compiler target 'vs_3_0'

HLSL vertex shader compilation failed:
error X3506: unrecognized compiler target 'vs_3_0'

XEffect demos run well on my Intel 4 Series Express graphic card on Dx9, I have latest Dx runtimes and irr precompiled engine. I really don't know what can it be, please help.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Interesting, go into effectWrapper.cpp and replace all "EVST_VS_3_0" with "EVST_VS_2_0" and all "EPST_PS_3_0" with "EPST_PS_2_0". You will get some compile errors in the console but if you choose a lower filtering mode (PCF8 or less), it should still work.

Also try updating your DX sdk and recompiling Irrlicht, maybe Irrlicht was precompiled with an outdated SDK?

Are you trying to use post processing or shadows or both?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
balor
Posts: 5
Joined: Wed Mar 04, 2009 4:48 pm
Location: PL

Post by balor »

I also have latest Dx sdk. I tried to use both, but I got this error even if I just create effectHandler and just use update(). I replaced all strings in effectWrapper.cpp and it renders correctly! Despite that, I get errors like:

Code: Select all

HLSL pixel shader compilation failed:
(48): error X5608: Compiled shader code uses too many arithmetic instruction slots (84). Max. allowed by the target (ps_2_0) is 64.

HLSL pixel shader compilation failed:
(48): error X5608: Compiled shader code uses too many arithmetic instruction slots (104). Max. allowed by the target (ps_2_0) is 64.
(1): error X5609: Compiled shader code uses too many instruction slots (120). Max. allowed by the target (ps_2_0) is 96.
But I'll try to use ps_3_0 and just leave vs_2_0 as it is. Also I'll add shadows and post processing now and I'll report outcome.

BlindSide, thnx for support!
balor
Posts: 5
Joined: Wed Mar 04, 2009 4:48 pm
Location: PL

Post by balor »

Ps_3_0 also rises errors during shaders compilation, so I changed it back to ps_2_0.

Well, post processing effects are working well. The problem is when I add shadows. I receive 2 kinds of errors. At the beginning:

Code: Select all

HLSL pixel shader compilation failed:
(48): error X5608: Compiled shader code uses too many arithmetic instruction slots (84). Max. allowed by the target (ps_2_0) is 64.

HLSL pixel shader compilation failed:
(48): error X5608: Compiled shader code uses too many arithmetic instruction slots (104). Max. allowed by the target (ps_2_0) is 64.
(1): error X5609: Compiled shader code uses too many instruction slots (120). Max. allowed by the target (ps_2_0) is 96.
and then, after the media loaded, every frame I get:

Code: Select all

Error setting float array for HLSL variable
Meshes are rendered well but the shadows have weird stripes. Tomorrow I'll try to compile Irrlicht on new SDK. Again, thank you for support BlindSide!
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

These weird intel cards are annoying. To get rid of errors you can just comment out the creation for the PCF_12 and PCF_16 materials.

What is happening is that the test in Irrlicht for PS_3 is reporting true, but then when I go ahead and do it the Intel cards complain. So basically the card is lying about PS_3 support, which cannot really be the case since Intel claims these cards are DX10 compatible.

So the only reason I can think of is outdated drivers, DX Runtime, or DX SDK. (Make sure you have the latest of all these 3!)

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
balor
Posts: 5
Joined: Wed Mar 04, 2009 4:48 pm
Location: PL

Post by balor »

When I was reading effectHandler I discovered that there are ps and vs compatibility cases, so It must be something with ps and vs detection.

I have November Dx sdk and November runtime downloaded from microsoft website few days ago. My graphic card driver is also downloaded around month ago from lenovo support website.

I'm really confused, guess I'll use "ps_2 and vs_2 only version of effectWrapper" till my computer with nvidia comes from service :)

Thank you BlindSide, your piece of work really is great and I'll use it in every Irrlicht project from on now.

Cheers!
Post Reply