Skip to content

Commit

Permalink
Reduce sample to 4
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingJellyfish committed Jan 17, 2025
1 parent 90e24e8 commit 1a36e33
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/shaders/bilateralH.comp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uniform sampler2D source;
uniform sampler2D depth;
uniform vec2 pixel;
layout(r16f) volatile restrict writeonly uniform image2D dest;
uniform float sigma = 1.5;
uniform float sigma = 2.;

layout (local_size_x = 4, local_size_y = 4) in;

Expand Down
2 changes: 1 addition & 1 deletion data/shaders/bilateralH.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ out vec4 FragColor;

void main()
{
float sigma = 1.5;
float sigma = 2.;

vec2 uv = gl_FragCoord.xy * pixel;
float X = uv.x;
Expand Down
2 changes: 1 addition & 1 deletion data/shaders/bilateralV.comp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uniform sampler2D source;
uniform sampler2D depth;
uniform vec2 pixel;
layout(r16f) volatile restrict writeonly uniform image2D dest;
uniform float sigma = 1.5;
uniform float sigma = 2.;

layout (local_size_x = 4, local_size_y = 4) in;

Expand Down
2 changes: 1 addition & 1 deletion data/shaders/bilateralV.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ out vec4 FragColor;

void main()
{
float sigma = 1.5;
float sigma = 2.;

vec2 uv = gl_FragCoord.xy * pixel;
float X = uv.x;
Expand Down
8 changes: 5 additions & 3 deletions data/shaders/ssao.frag
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ out float AO;
const float bias = .0005;
const float thickness = 10.0;

#define SAMPLES 8
const float invSamples = 0.125; // 1. / SAMPLES
#define SAMPLES 4
const float invSamples = 0.25; // 1. / SAMPLES

vec3 getXcYcZc(int x, int y, float zC)
{
Expand Down Expand Up @@ -60,7 +60,9 @@ void main(void)
float h = r * alpha;
vec2 localoffset = h * rotations;

ivec2 ioccluder_uv = clamp(ivec2(x, y) + ivec2(localoffset), ivec2(0), ivec2(u_screen));
ivec2 ioccluder_uv = ivec2(x, y) + ivec2(localoffset);

if (ioccluder_uv.x < 0 || ioccluder_uv.x > int(u_screen.x) || ioccluder_uv.y < 0 || ioccluder_uv.y > int(u_screen.y)) continue;

float LinearoccluderFragmentDepth = textureLod(dtex, vec2(ioccluder_uv) / u_screen, max(m, 0.)).x;
vec3 OccluderPos = getXcYcZc(ioccluder_uv.x, ioccluder_uv.y, LinearoccluderFragmentDepth);
Expand Down
2 changes: 1 addition & 1 deletion src/tracks/track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void Track::loadTrackInfo()
m_sun_diffuse_color = video::SColor(255, 255, 255, 255);
m_sun_position = core::vector3df(0, 10, 10);
irr_driver->setSSAORadius(0.5);
irr_driver->setSSAOK(2.0);
irr_driver->setSSAOK(3.);
irr_driver->setSSAOSigma(1.);
XMLNode *root = file_manager->createXMLTree(m_filename);

Expand Down

0 comments on commit 1a36e33

Please sign in to comment.