Tag Info

New answers tagged

1

Since I am working with SpriteKit on iOS the shader support in SpriteKit is still missing a few things to implement an animated color gradient shader in SpriteKit. However for those who come up to the same situation I have found a more performant way to make animated gradients with sprite kit. Instead of working with shaders I have created a simple image ...


4

Here's how I would do this. First, make sure you have the object's UVs or world coords (which you can pass through from your vertex shader) available to you. If it's just a background, you could also just use fragment coords (gl_FragCoord). For instance, let's say we're using UV coords. A fragment shader with only: gl_FragColor = vec4(vec3(uv.x),1.0); will ...


1

I think that it is impossible to solve your problem just by using a pair of tricky fragment and vertex shaders. That is why: You select a set of UV points in 2D space. Then, using the function you have defined, you can get another "linked" set of UV points. But you still have to get somehow 3D coordinates from the surface UV coordinates. So your problem can ...


0

Try using this instead: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 256, 1, 0, GL_BGRA, GL_UNSIGNED_BYTE, pLUT);



Top 50 recent answers are included