Bingdom
Googledom
Hello GMC,
So from my understanding, vertex buffers/ primitives are shot straight to the GPU. Ignoring all game resolutions and only using your monitor's display resolution.
I know to get texture coords, it's v_vTexcoord. I'd like to know an equivalent or similar way to this. The problem I'm having is whenever I try to draw stuff using gms' draw functions, they draw relative to the display (as I mentioned earlier).
Since I'm upscaling the game, sprites in the game have room to move by "sub-pixels". I need to take account of that for the trails. I'm beginning to think I might need to rethink about this approach, as to there's no way that the trail is going to both have the correct offsets and keep the structure of the pixelization consistent.
Here's an image to show my problem. Look at the trail from the projectiles. I'm trying to make the projectile trail as pixelated as the rest of the game
I don't want to use separate surfaces nor do I want to make a fullscreen surface. There's going to be a lot of these bullets and the surface will have to vary in sizes. I figured a shader would be much faster in this case.
In the fragment part of the shader, I've done this:
As suspected, it did nothing.
Then for the vertex part, I changed this:
This is close, however, it looks like it only adjusts the vertices of the vertex buffer, and not modify the rest of how it's drawn. It also wouldn't have the "sub-pixels", but I think that's an error on my part.
Thanks for reading.
So from my understanding, vertex buffers/ primitives are shot straight to the GPU. Ignoring all game resolutions and only using your monitor's display resolution.
I know to get texture coords, it's v_vTexcoord. I'd like to know an equivalent or similar way to this. The problem I'm having is whenever I try to draw stuff using gms' draw functions, they draw relative to the display (as I mentioned earlier).
Here's an image to show my problem. Look at the trail from the projectiles. I'm trying to make the projectile trail as pixelated as the rest of the game
I don't want to use separate surfaces nor do I want to make a fullscreen surface. There's going to be a lot of these bullets and the surface will have to vary in sizes. I figured a shader would be much faster in this case.
In the fragment part of the shader, I've done this:
Code:
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, floor(v_vTexcoord*res)/res).a;
Then for the vertex part, I changed this:
Code:
vec4 object_space_pos = vec4( floor(in_Position.xy/resScale)*resScale, in_Position.z, 1.0);
Thanks for reading.
Last edited: