Gallardo9944 Posted October 24, 2013 Share Posted October 24, 2013 Hello. I've got a shader made with a render target and I want to attach a GUI element to that shader. Is there any ability to do that? Here goes my code: local mainTarget = dxCreateRenderTarget(sx,sy,true) local mainShader = dxCreateShader("textureReplace.fx") function updateRTarget() dxSetRenderTarget(mainTarget,true) dxDrawRectangle(0,0,sx,sy,tocolor(0,0,0,150)) -- sx and sy are the target sizes. dxSetRenderTarget() dxSetShaderValue(mainShader, "tex", mainTarget) -- Setting a shader "tex" value to the target we have end function drawInterface() updateRTarget() -- Rotating the shader to a particular angle. dxSetShaderTransform(mainShader,rot,0,0) -- I want a GUI element to rotate and move together with the shader without a need to calculate a position of the element. dxDrawImage(posX,posY,sx,sy,mainShader) end addEventHandler("onClientRender",getRootElement(),drawInterface) Thanks in advance. Link to comment
csiguusz Posted October 24, 2013 Share Posted October 24, 2013 You can't apply shaders to gui elements. Link to comment
Gallardo9944 Posted October 24, 2013 Author Share Posted October 24, 2013 You can't apply shaders to gui elements. Just like I thought. Thanks anyway, gonna replace all the GUI stuff with dx-drawn thingies. Link to comment
Ren_712 Posted October 29, 2013 Share Posted October 29, 2013 well you can draw dxDrawImage behind the window and update it's shape and position onClientRender, stretch the screenSource image in the pixel shader to make it more convenient. http://imageshack.us/a/img43/7273/64a5.jpg Link to comment
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