Tag Info

New answers tagged

1

Why would you consider the wave disappearing unexpected? The shader averages/spreads differences in the heightmap. All it does is basically damping. Each iteration it will flatten out the waves, making them a little less high and a little wider. To have a more realistic wave-propagation you might want to try to use 2 textures. Use one for heights, and one ...


0

This is an old question. However, in the interest of others seeking help with a similar problem, I believe I have a plausible solution: You could have a model prepared for smooth shading (without the duplicate vertices) and present an option of emulating flat shading through your pixel shader. It is possible to calculate the normal at a given pixel by ...


1

The answer is spread across the following links. Due to size constraints / requirements it had to be a Buffer Texture. Overview listing of possible technologies: http://stackoverflow.com/questions/7954927/glsl-passing-a-list-of-values-to-fragment-shader OpenGL reference to Buffer Texture: https://www.opengl.org/wiki/Buffer_Texture Different question but ...


2

I'm not an expert about it but I'll try to explain. When you compute per pixel lighting in camera space, you transform your normal map from tangent space to camera space. The idea of working in tangent space is to transform the camera and lights to tangent space then perform lighting computations. So instead of transforming normals from your normal map to ...


2

When uploading shader source, you may provide more than one string. The lines of the strings are concatenated into the full text source for the shader compiler. You can thus emulate an include system (poorly) by putting the text of the required sources before the string with the main shader source. This is the origin of the numbers before the line numbers ...


3

You're doing it wrong - very inefficiently. Instead of rendering lightsources to your "lighting framebuffer", render the lighting contribution. That would be a soft disk centered at your light source instead of a single pixel. Example disk: ... and you can render that as a sprite! (Additive blending, clamp to 1 for best results). You can now bind that ...



Top 50 recent answers are included