mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[vulkan] Switch to float/normalized for pics
It gives better results when pics are squished or expanded.
This commit is contained in:
parent
03f614ccb9
commit
8a85b5c610
3 changed files with 9 additions and 9 deletions
|
@ -26,7 +26,7 @@
|
|||
minLod = 0;
|
||||
maxLod = 0;
|
||||
borderColor = float_transparent_black;
|
||||
unnormalizedCoordinates = true;
|
||||
unnormalizedCoordinates = false;
|
||||
};
|
||||
};
|
||||
descriptorPools = {
|
||||
|
@ -119,7 +119,7 @@
|
|||
{
|
||||
location = 1;
|
||||
binding = 0;
|
||||
format = r32g32_sint;
|
||||
format = r32g32_sfloat;
|
||||
offset = 8;
|
||||
},
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ layout (set = 0, binding = 0) uniform Matrices {
|
|||
(\a x, \a y) and texture coordinate for the icon (\a s=z, \a t=w).
|
||||
*/
|
||||
layout (location = 0) in vec2 vertex;
|
||||
layout (location = 1) in ivec2 uv;
|
||||
layout (location = 1) in vec2 uv;
|
||||
layout (location = 2) in vec4 vcolor;
|
||||
|
||||
layout (location = 0) out vec2 st;
|
||||
|
@ -21,6 +21,6 @@ void
|
|||
main (void)
|
||||
{
|
||||
gl_Position = Projection * vec4 (vertex.xy, 0.0, 1.0);
|
||||
st = vec2(uv);
|
||||
st = uv;
|
||||
color = vcolor;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
typedef struct {
|
||||
float xy[2];
|
||||
int st[2];
|
||||
float st[2];
|
||||
float color[4];
|
||||
} drawvert_t;
|
||||
|
||||
|
@ -352,10 +352,10 @@ draw_pic (float x, float y, int w, int h, qpic_t *pic,
|
|||
drawvert_t *verts = quad_verts + num_quads * VERTS_PER_QUAD;
|
||||
num_quads += VERTS_PER_QUAD;
|
||||
|
||||
float sl = (srcx);
|
||||
float sr = (srcx + srcw);
|
||||
float st = (srcy);
|
||||
float sb = (srcy + srch);
|
||||
float sl = (srcx + 0.03125) / 128.0;
|
||||
float sr = (srcx + srcw - 0.03125) / 128.0;
|
||||
float st = (srcy + 0.03125) / 128.0;
|
||||
float sb = (srcy + srch - 0.03125) / 128.0;
|
||||
|
||||
verts[0].xy[0] = x;
|
||||
verts[0].xy[1] = y;
|
||||
|
|
Loading…
Reference in a new issue