Sylvek Posted July 26, 2018 Share Posted July 26, 2018 Hi! Last time I scripted some gps script and it works really nice with nodes from default gps resource. Used this in map script where you can easily zoom and move around san andreas then just select waypoint for gps. Main issue is quality of drawed lines on path. I found on it some "bad pixels?" and another quality losses. Just take a look at this: You can easily see some type of jagged edges. You can now say that's the bend problem but on straight lines you can see this problem too. From script side line is drawed on renderTarget then drawed with imageSection on map gui. Its just the line. Converting this to texture and using any color type or mipmaps doesnt work. I think shader will be good idea but which type? Link to comment
Jayceon Posted July 26, 2018 Share Posted July 26, 2018 I solved this problem with a 8x8 circle image. Added image to the every node position in RT and looks better. What I mean? dxSetRenderTarget(gpsRouteImage) dxSetBlendMode("modulate_add") for i = 2, #gpsLines do if gpsLines[i - 1] then local x0 = gpsLines[i][1] - routeStartPosX + 8 local y0 = gpsLines[i][2] - routeStartPosY + 8 local x1 = gpsLines[i - 1][1] - routeStartPosX + 8 local y1 = gpsLines[i - 1][2] - routeStartPosY + 8 dxDrawImage(x0 - 4, y0 - 4, 8, 8, "dot.png") dxDrawLine(x0, y0, x1, y1, tocolor(255, 255, 255), 9) end end dxSetBlendMode("blend") dxSetRenderTarget() 2 Link to comment
Sylvek Posted July 27, 2018 Author Share Posted July 27, 2018 Wow. Really clever and simple. Really thanks. I think we can close this topic. For close. Link to comment
Discord Moderators Pirulax Posted July 28, 2018 Discord Moderators Share Posted July 28, 2018 @Jayceon Drawing a texture from a path is slow. Use a texture created with dxCreateTexture instead. And, drawing a whole map which is 3072x3072 is also slow. 1 Link to comment
Discord Moderators Pirulax Posted July 28, 2018 Discord Moderators Share Posted July 28, 2018 But ur solution is more than great 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