shaders

  1. D

    Shaders [SOLVED] Shader not working on iOS

    I'm trying to use this bloom shader for my iOS game: https://marketplace.yoyogames.com/assets/4729/simple-bloom-shader It seems to work alright when I test it from the IDE, but it doesn't seem to have any effect at all when I run it on my iPhone. What could be the problem? Xcode shows a few...
  2. Y

    Shader Lagging [Solved]

    Hi evryone, i have this simple shader: // // Simple passthrough vertex shader // attribute vec3 in_Position; // (x,y,z) //attribute vec3 in_Normal; // (x,y,z) unused in this shader. attribute vec4 in_Colour; // (r,g,b,a) attribute vec2...
  3. MartinK12

    Shaders [SOLVED] How to convert 3 digits RGB to 1 digit RGB in shaders ?

    I'm trying to learn more about shaders and created this simple one in .fsh tab in shaders to replace specific color in sprite with different color: if ((gl_FragColor.r == 1.0) && (gl_FragColor.g == 1.0) && (gl_FragColor.b == 1.0)) { gl_FragColor.r = 0.9; gl_FragColor.g = 0.6...
  4. K

    Shaders [Solved] Arrays and Shaders

    So, ideally I would love to have a uniform vec2 array, but I don't know if that's possible and I can't even get a uniform float array to work. I'm using shader_set_uniform_f_array() for the first time and in the yoyo doc it doesn't say how you write it in the shader. I found an example online...
  5. K

    GMS 2 [Solved] Applying a shader to tiles

    I've made a shader that requires uniform variables. It works great with objects, and I can get it to work on tiles without uniform variables using layer_shader(), but i can't for the life of me get it to apply to tiles with uniform variables. I tried to use layer_script_begin(), but found out...
  6. L

    Help with coloured dynamic shadow shader

    I have recently been trying to implement a dynamic shadow shader into my projects. I have found this which video which shows off his shader code but honestly I need some help working it into my projects. If someone could help me here that would be great, thanks in advance.
  7. MirthCastle

    GML MoonLighter Night Cycle (Tech Talk) (Help)

    Hey All, I have been trying to recreate the MoonLighter night cycle in GMS - I think I am CLOSE - but not quite there... I'm missing something i can't put my finger on... My goal is to have a dynamic day-night cycle - where the nighttime ends up looking like Moonlighter. Please See...
  8. Kaliam

    Question - Code No textureSize() funtion in GMS2 GLSL Shaders?

    The title says it all, I'm just curious why this method doesn't exist in GMS2 since it's been in GLSL since version 1.30. It doesn't make a difference if you're using GLSL or GLSL ES, although the type of compilation error you get is different. Just curious, didn't want to have to pass in all...
  9. 3

    Shaders How Much Can the GPU Handle in 3 Dimensions?

    Relatively quick question, in the process of drawing 3d models i normally, map out a .obj file to their corresponding; v (x,y,z) , vt (u,v,w) , vn (i,j,k); vertex position in 3d space ,xyz, vertex texture in 2d space with w for mapping ,uvw, and vertex normal for lighting ,ijk,. I've gotten...
  10. T

    Shaders [solved]lerping image blend shader

    Hi. I have been doing morphing between image blend colours like this example below, and was hoping someone could show me if there's a way to do this with shaders in a more straightforward manner :) I know there are examples of shaders within the GMS demo' but I couldn't understand how they...
  11. G

    Legacy GM Applying High Res Texture - Pixel Art

    I have a view resolution of 240x135 and a view port of 1920x1080. This means that the graphics are actually displayed at the higher resolution. When I draw a texture on top of the game window with the GUI layer using a subtract blend mode, I get this nice looking effect where the graphics look...
  12. Y

    Shaders How to/ is it possible to temporarily apply a shader to an object through a with statement?

    So I have a cursor object and when it hovers over any object that is a child of "selectable" I want the object to have a outline around it. The way I would like to accomplish this is through a with statement located in the cursor object that applies a shader to the object it is hovering over...
  13. Erayd

    Shaders Creating a window to the player's location

    Here's the issue: In a pseudo 3D game (Zelda/golden sun), when a player walks in front of a tall building or cliff, the player then becomes invisible to the player. I want to find a way to communicate to the player in a fluid way, where the player is and what might be behind that wall when the...
  14. cidwel

    Shaders Desaturate overtime shader

    Hello! I'm trying to find a good shader that will let me convert any sprite into greyscale over a time variable. Right now I have this: void main( void ) { vec3 color = vec3(1,0,0); vec3 c1 = color; float compRMax = 0.3; float compGMax = 0.59; float compBMax =...
  15. Ggd07

    GMS 2 [SOLVED] Using surfaces with alpha correctly

    Hello, I have been trying to fix this for weeks now, and due to my limited understanding with blending and shaders I am not able to do so. I've read countless threads on reddit and on the forums but was not able to fix this. Basically, the problem is this: What I am doing exactly, is having...
  16. R

    Shaders Question about Texture Coordinates

    Hi, I'm trying to make a shader where I need to get some RGB values from a texture input from a surface (actually it's an output of another shader) I tried something like this: varying vec4 v_vColour; varying vec2 v_vTexcoord; uniform sampler2D Texture; // The 'texture surface' // This is...
  17. The-any-Key

    Shaders Get destination color to shader

    I want to get the destination color to a shader so I can manually blend it with the source color using (bm_one,bm_zero) as blend mode so the destination color wont be processed again after the shader. But I have trouble of getting the destination color because I don't know how calc the texture...
  18. Azenris

    Legacy GM [Solved] Shader Uniform Not Setting

    Hi ! I have a problem I'm not understanding. Am I allowed to change a uniform more than once ? ATM i have the following code. var from; var to; var horizontal = false; from[0] = bloom_surface; to[0] = blurred_bloom_surface; from[1] = blurred_bloom_surface...
  19. Azenris

    Legacy GM [Solved] Multi target rendering

    So I'm attempting to get MTR to work. varying vec2 v_vTexcoord; varying vec4 v_vColour; void main() { vec4 colour = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord ); gl_FragData[0] = colour; gl_FragData[1] = vec4( 0, 0, 0, 1 ); } This fails with the error: array index out...
  20. Bingdom

    Shaders Making vertex buffers pixelated

    Hello GMC, So from my understanding, vertex buffers/ primitives are shot straight to the GPU. Ignoring all game resolutions and only using your monitor's display resolution. I know to get texture coords, it's v_vTexcoord. I'd like to know an equivalent or similar way to this. The problem I'm...
Top