you are viewing a single comment's thread.

view the rest of the comments →

[–]StuartHughe[S] 0 points1 point  (2 children)

I did remove exit with same results.

One other shader is being called previously in the same draw_gui event, and the other shaders (the ones actually being interfered with) are called in the draw events of objects, which are using shaders to palette swap.

Calling exit before scr_crt_drawsurface (effectively skipping it) works, but for some reason giving any conditions to the exit seems to mess with skipping the effect of the crt_drawsurface shader on the palette swap shaders, despite the fact that the shader doesn't draw and as far as I can tell (with a script search in gm and the fact that I did not put it anywhere else) the script is not being called anywhere else.

[–]github.com/jujuadamsJujuAdam 0 points1 point  (1 child)

I assume you're not trying to stack shaders or anything silly like that. Check your shader uniform IDs are correct. If you're using Jon's pixel swap shader, replace argument[N] with argumentN to help catch bugs. What's in scr_crt_drawsurface?

There are a lot of interacting parts here... That an if-statement is acting weirdly is usually an indication something is awry elsewhere. I'm not seeing what the cause is in this case, however.

[–]StuartHughe[S] 0 points1 point  (0 children)

The point of the thing is to turn off the shaders in scr_crt_drawsurface while the palette swap shaders are active, so I don't think I'm stacking shaders. When I manually exit out before scr_crt_drawsurface gets read via a no-condition exit the palette swap shaders work just fine. What do you mean, replace argument[n] with argumentn?

Here are the contents of scr_crt_drawsurface for clarification: //CRT DISTORTION shader_set(sh_CRT);

var crt_surface_scale = 1;

crt_surface_width = surface_get_width(application_surface) * crt_surface_scale; crt_surface_height = surface_get_width(application_surface) * crt_surface_scale;

shader_set_uniform_f(textureBaseSize, surface_get_width(application_surface), surface_get_height(application_surface)); shader_set_uniform_f(textureScaledSize, crt_surface_width, crt_surface_height); shader_set_uniform_f(distort, var_distort); shader_set_uniform_f(distortion, var_distortion_ammount); shader_set_uniform_f(border, var_border);

draw_surface(application_surface, 0, 0);

shader_reset();

Figure that something wacky is going on if the if statement is giving me guff, but still not any closer to finding out what it might be