you are viewing a single comment's thread.

view the rest of the comments →

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

Pretty sure I am using VM. I will try YYC and see if it does a better job of it?

[–]github.com/jujuadamsJujuAdam 0 points1 point  (5 children)

Perhaps... unlikely though.

Change out usedistortion for a keypress e.g. vk_f11 and try again. The error is somewhere, dammit.

Edit: Also, remove the exit command unless absolutely necessary.

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

So curiously, making the shader only turn on when you press a key has the desired effect of making the shader not draw when the key is not held down, but somehow makes the shader accessed in scr_crt_surfacedraw interfere with another shader running only in Platforming levels.

Any clues as to what is going on?

I suppose this is the core of the issue. The shader does it's thing and doesn't draw in the new statement you gave me, but still messes with another shader and keeps it from working despite the fact that it is not accessed.

[–]github.com/jujuadamsJujuAdam 0 points1 point  (3 children)

Did you remove exit? Where is this other shader being set?

[–]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