Tag Info

Hot answers tagged

2

Try turning off backface culling. In your shader, put "Cull Off" in the "SubShader" section.


2

You can use #include files in your shader source files, this is described here. So like this you can regroup any common code into functions, which you put in an include file.


2

Figured I had the shader versions too high (vs_5_0/ps_5_0) lowering them to their 4_0 variant fixed the error.


1

Figured it out by looking other shader examples and hopefully it will benefit others. elapsedTime can be added to the computation or offset and will animate the effect, some use sin/cos as well.. uniform float elapsedTime;


1

I found that replacing v_texcoord0 with gl_FragCoord.xy / vec2(screen_width, screen_height) in the SSAO shader, solved this issue.


1

In the context of a highly parallelizable section of execution, like drawing pixels to the screen rendered from a some 3D/2D scene, GPUs are almost always likely to be faster because of their architecture. The decision, in a broad sense, for what programs will execute faster on a GPU vs. CPU should be thought of as how many different execution contexts can ...


1

Some ideas: You could ignore the issue, and do what you're currently doing. Assuming those texture and shader comparisons are to OpenGL IDs (which are just integers), it's unlikely those checks are going to create a huge performance bottleneck. Comparison of integer values on modern CPUs is rather fast. Unless your profiler has told you this is currently a ...


1

The way to do this is with a FBO (Frame Buffer Object). You can render each pass to a FBO and use it as a texture input in the next stage, any kind of deferred shading and post processing is reliant upon this functionality. https://www.opengl.org/wiki/Framebuffer_Object


1

I used this solution to make a water distortion effect. You could use the sin waves vertically instead of horizontally to possibly achieve your effect. I draw what might get distorted onto a FrameBuffer. I make regions of the buffer texture that will be redrawn with a distortion shader applied. GdxGame.java void create(){ scaleX = ...



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