Page 1 of 1

Getting default uniforms

Posted: Tue Jan 28, 2020 15:27
by Jaromir
Hi Evereyone,

I'm just new to writing ffgl's but i'm somewhat familiar with writing shaders.

I've have compiled the latest ffgl repository from: on my macbook pro using xcode.

Right now i'm trying to write a basic shader but i got stuck.
This piece of code doesn't work.

Code: Select all

static const char _fragmentShaderCode[] = R"(#version 410 core
uniform sampler2D InputTexture;
uniform vec3 Brightness;

in vec2 uv;

out vec4 fragColor;

void main()

	fragColor = vec4(gl_FragCoord.xy/resolution,0.,1.);
When i write it like this it does work:

Code: Select all

fragColor = vec4(gl_FragCoord.xy/vec2(1920.,1080.),0.,1.);
Here: ... ork-better
It states that the resolution is passed by the plugin class.

Or do i need to do something else to get the resolution?

Re: Getting default uniforms

Posted: Thu Feb 13, 2020 10:45
by flyingrub
You need to use the ffglquickstart classes so that the default params are sent, for example FFGLEffect if you are creating an effect.