This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Oliver-makes-code/msaa-mrt
-MSAA and MRT support :D
- Loading branch information
Showing
18 changed files
with
395 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#version 450 | ||
|
||
layout(location = 0) in vec2 fsin_texCoords; | ||
layout(location = 0) out vec4 fsout_Color; | ||
|
||
layout (set = 0, binding = 0) uniform sampler TextureSampler; | ||
layout (set = 0, binding = 1) uniform texture2D Texture; | ||
|
||
void main() { | ||
fsout_Color = texture(sampler2D(Texture, TextureSampler), fsin_texCoords); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 450 | ||
|
||
layout(location = 0) in vec3 Position; | ||
layout(location = 0) out vec2 fsin_texCoords; | ||
|
||
layout (set = 1, binding = 0) uniform TextureDrawParams { | ||
vec2 SrcMin; | ||
vec2 SrcMax; | ||
vec2 DstMin; | ||
vec2 DstMax; | ||
vec2 SrcSize; | ||
vec2 DstSize; | ||
}; | ||
|
||
void main() { | ||
vec2 scaledDstMin = DstMin / DstSize; | ||
vec2 scaledDstMax = DstMax / DstSize; | ||
|
||
//Move vertex to correct place on texture. | ||
vec2 uv = (scaledDstMin + (scaledDstMax - scaledDstMin) * Position.xy); | ||
uv.y = 1-uv.y; | ||
|
||
gl_Position = vec4((uv * 2) - 1, 0, 1); | ||
|
||
vec2 scaledSrcMin = SrcMin / SrcSize; | ||
vec2 scaledSrcMax = SrcMax / SrcSize; | ||
|
||
//Sample from source texture. | ||
fsin_texCoords = scaledSrcMin + (scaledSrcMax - scaledSrcMin) * Position.xy; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.