Random changes
This commit is contained in:
5
main.cpp
5
main.cpp
@@ -238,13 +238,9 @@ protected:
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
ReWindow::Logger::Debug.EnableConsole(false);
|
||||
|
||||
|
||||
auto* program = new ReShaderProgram();
|
||||
|
||||
program->Open();
|
||||
@@ -255,6 +251,5 @@ int main(int argc, char** argv) {
|
||||
while (program->IsAlive())
|
||||
program->ManagedRefresh();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
34
shaders/blur.frag.glsl
Normal file
34
shaders/blur.frag.glsl
Normal file
@@ -0,0 +1,34 @@
|
||||
#version 120
|
||||
|
||||
in VS_OUT
|
||||
{
|
||||
noperspective vec2 uv;
|
||||
} IN;
|
||||
|
||||
out vec4 outColor;
|
||||
|
||||
uniform sampler2D offscreen;
|
||||
|
||||
const vec4[] gaussKernel3x3 =
|
||||
{
|
||||
vec4(-1.0, -1.0, 0.0, 1.0 / 16.0),
|
||||
vec4(-1.0, 0.0, 0.0, 2.0 / 16.0),
|
||||
vec4(-1.0, +1.0, 0.0, 1.0 / 16.0),
|
||||
vec4( 0.0, -1.0, 0.0, 2.0 / 16.0),
|
||||
vec4( 0.0, 0.0, 0.0, 4.0 / 16.0),
|
||||
vec4( 0.0, +1.0, 0.0, 2.0 / 16.0),
|
||||
vec4(+1.0, -1.0, 0.0, 1.0 / 16.0),
|
||||
vec4(+1.0, 0.0, 0.0, 2.0 / 16.0),
|
||||
vec4(+1.0, +1.0, 0.0, 1.0 / 16.0),
|
||||
};
|
||||
|
||||
void main(void)
|
||||
{
|
||||
const vec2 texelSize = vec2(1.0) / textureSize(offscreen, 0);
|
||||
|
||||
vec4 color = vec4(0.0);
|
||||
for (int i = 0; i < gaussKernel3x3.length(); ++i)
|
||||
color += gaussKernel3x3[i].w * texture(offscreen, IN.uv + texelSize * gaussKernel3x3[i].xy);
|
||||
|
||||
outColor = color;
|
||||
}
|
0
shaders/blur.vert.glsl
Normal file
0
shaders/blur.vert.glsl
Normal file
@@ -1,5 +1,6 @@
|
||||
#version 120
|
||||
|
||||
void main() {
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_Position = ftransform();
|
||||
}
|
Reference in New Issue
Block a user