Skip to content

Commit 592ab9f

Browse files
author
keldu
committed
final fix
1 parent 1d4bdb2 commit 592ab9f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

backend_opengl2.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <math.h>
2+
13
int backend_compile_shader(GLuint shader_id, unsigned char** shader_source, ssize_t shader_length){
24
GLint result = GL_FALSE;
35
int log_length;
@@ -226,7 +228,7 @@ int xlaser_render(XRESOURCES* xres, uint8_t* channels){
226228
double dimmer_factor = (double) channels[DIMMER] / 255.0;
227229
uint8_t selected_gobo;
228230
double focus = (double) channels[FOCUS] / 255.0;
229-
const double trace = 1.0 - (double) channels[TRACE] / 255.0;
231+
const double trace = sqrt(1.0 - (double) channels[TRACE] / 255.0);
230232
const double angle = M_PI * 2 *((double) (channels[ROTATION] / 255.0));
231233
const double cos_a = cos(angle);
232234
const double sin_a = sin(angle);

shaders/hdr_fragment.shader

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void main(){
1010
vec4 hdrColor = texture2D( goboSampler, UV );
1111
vec4 bloomColor = texture2D( textureSampler, UV );
1212
//hdrColor += bloomColor;
13-
vec3 result = vec3(1.0) - exp( -hdrColor.rgb -bloomColor.rgb * exposure );
13+
vec3 result = vec3(1.0) - exp( (-hdrColor.rgb * 0.5 -bloomColor.rgb) * exposure );
1414
result = pow( result, vec3( 1.0 / gamma ));
1515
gl_FragColor = vec4(result.rgb, 1.0);
1616
}

0 commit comments

Comments
 (0)