Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Separate logic into function, include an unused function for not inte…
Browse files Browse the repository at this point in the history
…rpolating
  • Loading branch information
Oliver-makes-code committed Nov 28, 2023
1 parent c7ac059 commit c9f238b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Client/Content/shaders/simple.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ layout(location = 0) out vec4 fsout_Color;
layout (set = 1, binding = 0) uniform sampler TextureSampler;
layout (set = 1, binding = 1) uniform texture2D Texture;

void main() {
void dontInterpolatePixels() {
fsout_Color = texture(sampler2D(Texture, TextureSampler), fsin_texCoords) * fsin_Color;
}

void interpolatePixels() {
vec2 inverseTexSize = textureSize(sampler2D(Texture, TextureSampler), 0);
vec2 texSize = 1 / inverseTexSize;

Expand All @@ -37,3 +41,7 @@ void main() {
) / 4;
fsout_Color = sampledColor * fsin_Color;
}

void main() {
interpolatePixels();
}

0 comments on commit c9f238b

Please sign in to comment.