1
votes

I'm trying to create a shader in Apple's OpenGL Shader Builder and I need a texture as input for the fragment shader.

The input is defined like:

uniform sampler2D texture;

It seems obvious I could somehow use a texture already loaded into OpenGL Shader Builder but I can't figure out how.

2

2 Answers

2
votes

In the main window you should see three tabs : Render, Texture and Symbols. Click the Texture tab and simply drag and drop an image file in the first available slot. Each slot represents a texture unit and will always be in the order of your uniforms.

If you don't have any texture set up, the result will be a black screen.

1
votes

Once you define a uniform sampler2D symbol for the texture, you can go to symbols pane, there you can set the number of texture unit for the symbol (I think the first entry field is the one, but won't hurt if you fill all three).