#### mbeytekin

##### Member

How we use texture2dLod function in GameMaker?

My example code like that in vertex shader;

attribute vec3 in_Position;

varying vec2 fragCoord;

varying vec4 Colour;

uniform vec3 iResolution;

uniform sampler2D tfm;

void main()

{

vec4 Position = vec4( in_Position, 1);

gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * Position;

fragCoord = in_Position.xy;

vec2 uv = fragCoord.xy/iResolution.xy;

sum = texture2DLod(tfm,uv,1.).rgb;

Colour=vec4(sum.rgb,1.);

}