Piorun Posted August 7, 2012 Posted August 7, 2012 Hi guys. I have problem with my shader. It's fx file: texture Tex0; technique simple { pass P0 { //-- Set up texture stage 0 Texture[0] = Tex0; //-- Leave the rest of the states to the default settings } } and lua code: addEventHandler("onClientResourceStart", resourceRoot, function() myShader,tecName = dxCreateShader( "efect.fx" ) myImage = dxCreateTexture( "info.png" ) if myShader and myImage then dxSetShaderValue( myShader, "Tex0", myImage ) outputChatBox( "Shader using techinque " .. tecName ) else outputChatBox( "Problem - use: debugscript 3" ) end end ) addEventHandler( "onClientRender", root, function() if myShader then dxDrawImage( 200, 300, 400, 200, myShader, 0, 0, 0, tocolor(255,255,0) ) end end ) And this is some warn: There were no techniques, Compilation failed What's wrong?
UAEpro Posted August 7, 2012 Posted August 7, 2012 the .fx file must be similar to this float4 MyShader(.... ) ... { ................. } technique fog { pass p1 { VertexShader = null; PixelShader = compile ps_2_0 MyShader(); } }
Piorun Posted August 7, 2012 Author Posted August 7, 2012 Ok, but what im putting here?: float4 MyShader(.... ) ... { ................. <-- here } EDIT Anyway on wiki there is this example for fx file: texture Tex0; texture Tex1; //-- Very simple technique technique simple { pass P0 { //-- Set up texture stage 0 Texture[0] = Tex0; ColorOp[0] = SelectArg1; ColorArg1[0] = Texture; AlphaOp[0] = SelectArg1; AlphaArg1[0] = Texture; //-- Disable texture stage 1 ColorOp[1] = Disable; AlphaOp[1] = Disable; } }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now