Getting default uniforms

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
Jaromir
Met Resolume in a bar the other day
Posts: 1
Joined: Tue Jan 28, 2020 15:02

Getting default uniforms

Post 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: https://github.com/resolume/ffgl 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: https://github.com/resolume/ffgl/wiki/3 ... 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?

User avatar
flyingrub
Met Resolume in a bar the other day
Posts: 11
Joined: Thu Feb 21, 2019 10:24
Location: Out of space

Re: Getting default uniforms

Post 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.

Post Reply