Tag Info

Hot answers tagged

2

From your original equation a_position.x = a_position.x + amplitude * sin(phase + a_position.x); We'll just be taking at look at the sin portion as this is where this effect comes from sin(phase + a_position.x); Let's look at the sin function over a half of a period for different positions (phase is in degrees) Position 1 - a_position.x = 0 sin(0 + 0) ...


2

INVALID_OPERATION will be returned by glProgramBinary if the binary code is rejected. If this happens, you must recompile the GLSL source code the usual way and then use glGetProgramBinary in order to grab the new binary shader. So, basically, something like like this rough pseudo-source: load_shader(path): binary := load_binary(path) if binary != ...


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


1

That is the standard way of doing a Gaussian blur however, you can use only 2 textures like this: bind the original texture blur horizontally to the second texture bind the blurred horizontally texture blur vertically to the original texture


1

There are many ways to handle this kind of logic in a shader: Use dynamic branching: Plain ifs are not that slow on modern hardware. Test and profile it. If it doesn't slow down your application, this is probably the most straightforward and flexible solution. Use shader subroutines: This is a new GLSL feature. It is supposed to be faster than dynamic ...



Only top voted, non community-wiki answers of a minimum length are eligible