New answers tagged

0

I have implemented a simple solution that seems to be working for myself. I solved it by ensuring that my shader takes in both colour and texture coordinate data. The other requirement is that you set the colour of all textured vertices to black. My fragment shader is then set up as follows: #version 330 core out vec4 gl_FragColor; in vec2 ...


0

I figured out a solution, now I keep track of the cameraoffset/delta (xy distance the camera moved from the initial position) as a uniform vec2 and then add it to gl_FragCoord.xy in main() Line #1


0

Yes it's possible, texture/imageLoad are for reading and imageStore is for writing.


2

b is the size of the box, measured from the center to one corner - what we often call the "half-extents" of the shape. So a box 10 units wide and 2 units tall would use b = vec2(5, 1) To draw a 2x2 square, you'd want b = vec2(1, 1)


Top 50 recent answers are included