Beta 26 shader syntax error

hi and big thanks to the devvvvs for this promising release

for now it looks to work great except a little problem i have with an effect (Desax’s SurfacesPhongDirectional.fx) returning “nil” on technique pin.

as advised in the release page i checked the code and yes it looks to be a syntax problem (“line 5832 - redefinition of SteinbachScrew”) but i don’t know how to resolve this as i’m not an hlsl friend.

shader is here tiki-download_file.php?fileId=1193

any help appreciated…

same for distortions 2d shader. Line 333 redefinition of fisheye.

Distortions_2D.fx (8.8 kB)

This compiler change should have been done a long time ago - finally it might force ppl to write shaders correctly =)
As for fixing it - you could try to hexedit the executable and replace the string “d3dx9_XX.dll” by “d3dx9_30.dll”(or whatever it was in previous versions), but please do that only if you really have no time and no other options. And i’m not even 100% sure will this trick work or not…

Aie… Unc would you please have a look at distorsion2d ? Despite it is bad written it is very usefull!!!

…a lot of shaders are returning nil due to smple syntax errors.

Interesting but what has exactly changed here?

Yes, can someone elaborate on how to fix these errors?

the fix is quite easy! most of the time the technique is called like a function of the shader, so just rename this function. i would not rename the technique, because that would break patches using the technique name enum.

Can someone post an example? :)

if you have a function

float3 SteinbachScrew(…)

and a technique

technique SteinbachScrew


rename the function to

float3 SteinbachScrewFunc(…)

or so…

ahh ok.

Just make sure no function shares a name with a technique?..

right, no structure should have the same name than another… the compiler is more strict in naming checks now.

also, make sure shader model 1 is not mentioned (change to 2_0 atleast)
and i remember someone’s shader with “writing” to a global variable - this shouldnt happen

now it got the func! (and 2.0)
thanks a lot guys and big up unc for your amazing texture effects!

here’s Distortions2d in case but i just added func and 2.0. nothing uncroyable…

why isn t it possible ?

@users: contribs would appreciate this shampoo of Func thing ?

this isnt really a good style, and i believe this ‘writing’ was restricted by the compiler (options)