Overkillz Posted September 2, 2020 Share Posted September 2, 2020 Hello dear community, Im having an issue with renderTargets. Well, my problem is simple. Im trying to apply a fade effect to a renderTarget. Well, I want to have a decent quality while drawing stuffs on it, so, Im forced to se the function dxSetBlendMode. However, If I use it, I can't make fade animation. Here is the wiki example with the fade animation local myRenderTarget = dxCreateRenderTarget(500, 500, true) local alpha = 0 function updateRenderTarget() dxSetRenderTarget(myRenderTarget, true) dxSetBlendMode("modulate_add") dxDrawRectangle(0,0,500,500,tocolor(255,0,0,255)) dxDrawText("Testing "..getTickCount(), 0, 0, 0, 0, tocolor(255, 255, 255, 255), 2, "clear") dxSetBlendMode("blend") dxSetRenderTarget() end addEventHandler("onClientRender", root, function() alpha = math.min(alpha+10,255) dxSetBlendMode("add") dxDrawImage(100, 200, 500, 500, myRenderTarget, 0,0,0,tocolor(255,255,255,alpha)) dxSetBlendMode("blend") end ) updateRenderTarget() Is there any way to fix it without losing the quality that brings dxSetBlendMode ? Thanks for reading, best regards. Link to comment
Discord Moderators Zango Posted September 2, 2020 Discord Moderators Share Posted September 2, 2020 Try using modulate_add as blend mode instead of add before fading it (line 18) Link to comment
Overkillz Posted September 2, 2020 Author Share Posted September 2, 2020 I already test it, but it doesn't reach the quality like using only add Link to comment
Discord Moderators Zango Posted September 3, 2020 Discord Moderators Share Posted September 3, 2020 I tested it and it looked fine. Can you show with a screenshot what looks wrong? Link to comment
Overkillz Posted September 3, 2020 Author Share Posted September 3, 2020 Might you can apreciate the difference due to you are using default fonts or not thing fonts, but look As you can see, the second image is clearer. Due to the image cut, might you cant difference the quality, but, if you would see the full tab, the quality lost is appreciable. Anyways, I have done several test and ways to make it work, but nothing, texture shader doesn't work too ...etc So, maybe I will be forced to use module_add arg instead of add only. Regards. 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