mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | Texture finally working entirely
This commit is contained in:
@ -238,6 +238,11 @@ void main()
|
||||
ivec2 pixel_coords = ivec2(gl_GlobalInvocationID.xy);
|
||||
if (pixel_coords.x >= int(u_resolution.x) || pixel_coords.y >= int(u_resolution.y))
|
||||
return;
|
||||
|
||||
// vec2 uv = ((vec2(pixel_coords)) / u_resolution);
|
||||
// uv.x *= u_resolution.x / u_resolution.y;
|
||||
// imageStore(output_image, pixel_coords, vec4(vec3(uv, 0.), 1.));
|
||||
// return ;
|
||||
|
||||
if (u_pixelisation != 1 && (uint(pixel_coords.x) % u_pixelisation != 0 || uint(pixel_coords.y) % u_pixelisation != 0))
|
||||
return;
|
||||
|
@ -113,8 +113,8 @@ vec3 getTextureColor(int texture_index, hitInfo hit)
|
||||
{
|
||||
GPUTriangle tri = triangles[hit.obj_index];
|
||||
uv = hit.u * tri.texture_vertex2 + hit.v * tri.texture_vertex3 + (1 - (hit.u + hit.v)) * tri.texture_vertex1;
|
||||
uv = vec2(uv.x, 1-uv.y);
|
||||
}
|
||||
|
||||
return (texture(textures[texture_index], uv).rgb);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user