glsl

PassThrough Geometry Shader Not Working

眉间皱痕 提交于 2019-12-23 05:45:06
问题 I am using FragmentShader and VertexShader at present, and works absolutely fine. I cannot get my geometry shader working. I am absolutely new to it, below is what I have tried. I am using VBO, lighting and textures along with some geometry, but it works fine before using GeometryShader. the only thing I have changed is the variable names as I had to get the input in the geometry shader and give the output. So I have appended 1 at the end of those variable names those which will go out from

WebGL 2.0: Multiple output textures from the same program

血红的双手。 提交于 2019-12-23 05:22:29
问题 I'm trying to learn how to do multiple outputs from the same program in WebGL2 leveraging gl.drawBuffer() capabilities. I looked at the book " OpenGL ES 3.0 Programming Guide ", chapter 11 where it lists what is needed for multi-output to take place. However the shader source example is very trivial outputting only constant values. I'd like to know if someone has a better example? or if one could explain what happened to the TextureCoordinates varying? In normal shader code I would use that

Converting a Shadertoy into my own local Three.js sandbox

耗尽温柔 提交于 2019-12-23 05:05:57
问题 I'm making a local shader sandbox based on a Shadertoy by lennyjpg with the help of these two SO Q&A's (one, two). I'm converting the Shadertoy to use Three.js as a sandbox for a larger project that uses Three.js. However, while there are no errors displaying, I'm not seeing the expected result. Only the camera helper displays. What am I doing wrong here? (See the runnable snippet below.) Thanks in advance! var SCREEN_WIDTH = window.innerWidth; var SCREEN_HEIGHT = window.innerHeight; var

Applying a blur shader to sf::RectangleShape

北慕城南 提交于 2019-12-23 04:35:09
问题 I have an object that is a 2d array of sf::RectangleShapes (for a tile-based game). It's supposed to look like a cloud, so I want to add some blur to it. Here is what it looks like now: And I want it to look like this: Instinctively, it seems to achieve this blur effect on the low level, I would have to draw the cloud object to a buffer, and then apply the blur object to the buffer. But I'm not sure if SFML is doing this already. In my main loop, I have this: for( CloudIterator it = clouds

How can i add a GLSL Fragment Shader Audio Visualization

微笑、不失礼 提交于 2019-12-23 04:33:18
问题 How can i add Audio Visualization support to this class, i would like to add an Audio() object as an input to a GLSL Fragment Shader. An Example of this is https://www.shadertoy.com/view/Mlj3WV. I know this sort of thing can be done in Canvas 2d with waveform Analysis, but this opengl method is far more smooth. /* Code from https://raw.githubusercontent.com/webciter/GLSLFragmentShader/1.0.0/GLSLFragmentShader.js */ /* render function */ /* set the uniform variables for the shader */ gl

OpenGL GLSL 3.30 in Ubuntu 14.10 mesa 10.1.3

◇◆丶佛笑我妖孽 提交于 2019-12-23 01:53:57
问题 when I try to compile a glsl shader with OpenGL in Ubuntu I get the following error: - 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, and 1.00 ES But when I do a "glxinfo | grep OpenGL" it says: OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD JUNIPER OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.3 OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none) OpenGL core

Mandelbrot Set through shaders in GLSL with LOVE2d renders a circle, not a fractal

[亡魂溺海] 提交于 2019-12-23 01:52:21
问题 I'm trying to render a Mandelbrot Set using GLSL, but all I get is a full circle... I have checked the maths a lot, and I simply cannot find the error, so I thought maybe the problem was semantic. Is anyone able to see what's wrong? Also, could anyone give me insights on organization, structure, etc? I'm trying to learn proper coding, but it's hard to find material on styling. Obs.: The shader can be applied over any image The idea is simple (you may skip this): checkConvergence returns true

Multiple subroutine types defined in the same fragment shader does not work correctly using GLSL Shaders

最后都变了- 提交于 2019-12-22 17:54:23
问题 I'm working on a program using GLSL shaders. I coded 2 different ways to compute ADS (Ambient + Diffuse + Specular) shading in 2 different methods. To do the job properly I used subroutines to use one or the other method to compute ADS shading. Here's a piece of the fragment shader code : subroutine vec3 LightShadingEffectType(int idx, vec3 normal, vec3 lightDir); subroutine uniform LightShadingEffectType LightShadingEffect; subroutine (LightShadingEffectType) vec3 Basic_ADS_Shading(int idx,

Multiple subroutine types defined in the same fragment shader does not work correctly using GLSL Shaders

亡梦爱人 提交于 2019-12-22 17:54:03
问题 I'm working on a program using GLSL shaders. I coded 2 different ways to compute ADS (Ambient + Diffuse + Specular) shading in 2 different methods. To do the job properly I used subroutines to use one or the other method to compute ADS shading. Here's a piece of the fragment shader code : subroutine vec3 LightShadingEffectType(int idx, vec3 normal, vec3 lightDir); subroutine uniform LightShadingEffectType LightShadingEffect; subroutine (LightShadingEffectType) vec3 Basic_ADS_Shading(int idx,

Write to texture GLSL

微笑、不失礼 提交于 2019-12-22 13:57:40
问题 I want to be able to (in fragment shader) add one texture to another. Right now I have projective texturing and want to expand on that. Here is what I have so far : Im also drawing the viewfrustum along which the blue/gray test image is projected onto the geometry that is in constant rotation. My vertex shader: ProjTexCoord = ProjectorMatrix * ModelTransform * raw_pos; My Fragment Shader: vec4 diffuse = texture(texture1, vs_st); vec4 projTexColor = textureProj(texture2, ProjTexCoord); vec4