1. S

    SOLVED Shaders: How to Modify Color Variable(s) from Outside of Shader--Uniforms?

    Hi, am I able to change the value of a color from outside of the shader, as with resolution and time below? //Draw GUI Event: shader_set(shaderType); shaderResolution = shader_get_uniform(shader_current(), "iResolution"); shaderTime = shader_get_uniform(shader_current()...
  2. Heavybrush

    Shaders GLSL 1Bit Dithering Shader work perfectly in all the shader editors but not compile properly in gms

    Hi guys I'm getting into the shaders, I love them but I'm not so good to understand what is going on varying vec2 v_vTexcoord; varying vec4 v_vColour; uniform vec2 resolution; uniform float pixelSize; uniform float gamma; void main() { vec2 uv = gl_FragCoord.xy / resolution.xy; float...
  3. jf_knight

    Shaders Image sharpen shader

    Hello. I'm writing an image sharpening filter in GM2 and need some assistance. I'm not getting any changes on my image when moving a slider tied to "Sharpen". Here's what I have; varying vec2 v_texcoord; uniform vec2 resolution; uniform float Sharpen; void main( ) { vec4 colour =...
  4. jf_knight

    Graphics Shadertoy to Gamemaker GLSL converter

    Hello. I have something to share with you all. I have created a web app that converts simple Shadertoy shader code into GameMaker GLSL ES shader code. It performs the appropriate changes outlined in shader master Xor's tutorial, and I thought i'd automate it as well as give the extra create and...
  5. Edwin

    Legacy GM How to change the variables in shader from event code?

    Hello, guys. I have a small shader that makes the sprite go fully white. I just want to this whiteness disappears in time. I'm very new at shaders, so I have no idea how all this works. My shaders Vertex code is default, but the Fragment code looks like this: varying vec2 v_vTexcoord; varying...
  6. MilkMan5x

    Demo Shader-based procedurally rendered fire effect

    -=[ Shader based procedural fire effect ]=- GitHub repo : =============================================================== Hello again, Recently I wrangled up this decent looking fire effect after getting inspired from these two materials: Hugo...
  7. N

    Understanding GLSL Shaders

  8. ConstaChymic

    Question - Code Default vertex & fragment shader when lighting is used?

    Hi. I'm wondering what default glsl scripts are used when you are drawing things in 3d and are using lights. I've been trying to make my own but I cannot for the life of me figure out how to use any of the gl_* variables provided (bar a few such as gl_Fragcoord and gl_Position), as most of my...
  9. jujubs

    Shaders Mysterious syntax error

    So I followed this tutorial right here to learn how to change my sprites' colors using shaders: It all seemed simple enough, and indeed, I managed to add some color to my game sprites without much hassle. However, the method used in the video also changes how transparency behaves. My player...
  10. Kaliam

    How to pass a vec4 array to a shader? (GLSL)

    Hello, I'm just trying to use a shader uniform that is declared as such: uniform vec4 lightMap[32]; This compiles just fine in GLSL, however, there isn't a GMS2 function that is specifically for a vec4. I've tried using a float array of arrays that represent the vec4's in an array but can't...
  11. 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...
  12. Blokatt

    Asset - Shaders BktGlitch - A highly customisable glitch shader

    Hello everyone, I'm here (a bit late) to tell you about an asset I have released a couple months ago. BktGlitch is a glitch fragment shader package featuring: A variety of effects controllable using parameters through simple setup functions A number of presets, which can be easily set using a...
  13. The Reverend

    Shaders Need help with MRT shader in GLSL (not ES)

    Hi I need help with a MRT (Multiple Render Targets) shader in GMS 2. But first credits to the assets artist: Michele "Buch" Bucelli: Test situation: The view is smaller than the room and follows the player object. I want to draw everything in the game...
  14. The Reverend

    Question - Code GLSL version in GMS 2?

    Does anyone know up to what GLSL (not ES) version we can use in GMS 2?
  15. The Reverend

    Shaders Basic HLSL (and some GLSL) info needed [one more Q]

    I'm working on my next shader tutorial and realized I'd need some help before feeding false information to the community watching the series. The first questions are about GLSL ES: Are these statments correct? 1. GM:S 1.2+ is using GLSL ES 1.0 2. and GMS 2 is using GLSL ES 2.0 And the rest is...
  16. 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...
  17. S

    Shaders Burnt out on this shader error

    Hey yall, just really need a second (or more) pair of eyes on this because i'm not sure what i'm missing. Trying to make a 2d directional spotlight effect with a shader. Heres the SpotLight() function that does the lighting calc. Heres the Main() of the shader so you can see how SpotLight()...
  18. Poking Pug

    Question - Code What GLSL version is Studio v2 using?

    Hi all! I saw that v2 of Studio now has nice and simple ways of creating your own vertex and fragment shaders, but nowhere in the manual did I see the current supported version of the GLSL syntax. For all target platforms it says we can use GLSL ES and it also mentions that for HTML5 we need...
  19. Rackover

    Shaders Looking for a Multiply Shader

    Hi, The artist i'm working with applied a cool effect on his photoshop mockup using a layer set with the blend mode "Multiply". As I already managed to create an Overlay blend mode shader, I'm looking forward to have a multiply one as well ; problem is, finding good documentation about it seems...
  20. TotallyAverageGamez

    Shaders [SOLVED] Outline Shader: How to reference a nearby pixel's alpha?

    Hey All, Have a question about shader code. I am trying to create an outline shader that draws a border (highlight) 1px wide around an object. The code I am using so far is this: varying vec2 v_vTexcoord; varying vec4 v_vColour; uniform vec4 outlineColor; void main() { vec4 originalColor...