glsl

iOS 10 breaks custom CIFilter

和自甴很熟 提交于 2021-02-07 08:29:16
问题 I have written a chromakey filter for making the backgrounds of MPEG movies transparent so that you can use a movie file for longer animations without the need for lengthy sequences of PNGs (as is commonly done for some types of iOS animations). I am using AVPlayer , AVVideoComposition , and a custom CIFilter to render the video over a background image. The background image can be changed dynamically by the user interacting with the app. This used to work just fine until iOS 10 came out and

iOS 10 breaks custom CIFilter

↘锁芯ラ 提交于 2021-02-07 08:28:36
问题 I have written a chromakey filter for making the backgrounds of MPEG movies transparent so that you can use a movie file for longer animations without the need for lengthy sequences of PNGs (as is commonly done for some types of iOS animations). I am using AVPlayer , AVVideoComposition , and a custom CIFilter to render the video over a background image. The background image can be changed dynamically by the user interacting with the app. This used to work just fine until iOS 10 came out and

iOS 10 breaks custom CIFilter

拟墨画扇 提交于 2021-02-07 08:28:34
问题 I have written a chromakey filter for making the backgrounds of MPEG movies transparent so that you can use a movie file for longer animations without the need for lengthy sequences of PNGs (as is commonly done for some types of iOS animations). I am using AVPlayer , AVVideoComposition , and a custom CIFilter to render the video over a background image. The background image can be changed dynamically by the user interacting with the app. This used to work just fine until iOS 10 came out and

Calculating point to line distance in GLSL

时光总嘲笑我的痴心妄想 提交于 2021-02-05 09:28:14
问题 I am trying to calculate a point to line distance in GSLS - precisely in turbo.js turbo.js This is part of a more general problem in which I try to find the [closest points on GeoJSON multiline] respective to a set of GeoJSON points - the number of calculations for a 500-points set on 1000 segments line ends up being 500k point-to-distance calculations. This is way too much to handle in the browser (even in workers) so parallelism helps a lot. The trick is that AFAIK I can only use a vec4 as

OpenGL default pipeline alpha blending does not make any sense for the alpha component

ε祈祈猫儿з 提交于 2021-02-04 14:47:07
问题 Q : Is there a way to use the default pipeline to blend the Alpha component properly? Problem : I'm drawing semi-transparent surfaces into a texture, then I want to blit that texture into the main frame back buffer. Normally when you use straightforward alpha blending for transparency or antialiasing, it is to blend color components into the back buffer ( which has no alpha channel by deafult ). However, when blending into a texture that has an alpha component, the usual GL_SRC_ALPHA, GL_ONE

How do I wrap a sprite around a cube without GL_REPEAT? [closed]

微笑、不失礼 提交于 2021-02-04 08:26:11
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Improve this question I'm using OpenGL 3.2+. I created a cube VBO of 8 verticies (each vertex consists of 8 floats: x,y,z,r,g,b,s,t), an EBO to create the faces for that cube, and a VAO to tie it all together. I have a sprite atlas consisting of hundreds of 16x16 sprites. I'm trying to get 1 sprite

Get access to later versions of GLSL

心不动则不痛 提交于 2021-01-28 21:07:16
问题 I was making a shader with GLSL so I could apply texture arrays to a cube when I ran into an issue. The issue was that layout wasn't supported in the version I was using. Easy fix, use a later version, but the problem with that was that I don't have support for later versions that support layout . I was wondering, is it possible to get support for later versions of GLSL, and if so, how would I do such a thing? This is my current GLSL code for applying textures Vertex Shader: #version 130

Directional lighting is not constant in OpenGL ES 2.0/3.0

筅森魡賤 提交于 2021-01-28 13:42:46
问题 Problem: The direction of the directional light changes when the position of the object changes. I watched posts with a similar problem: Directional light in worldSpace is dependent on viewMatrix OpenGL directional light shader Diffuse lighting for a moving object Based on these posts, I tried to apply this: #version 300 es uniform mat4 u_mvMatrix; uniform mat4 u_vMatrix; in vec4 a_position; in vec3 a_normal; const vec3 lightDirection = vec3(-1.9, 0.0, -5.0); ... void main() { vec3

Directional lighting is not constant in OpenGL ES 2.0/3.0

柔情痞子 提交于 2021-01-28 13:42:23
问题 Problem: The direction of the directional light changes when the position of the object changes. I watched posts with a similar problem: Directional light in worldSpace is dependent on viewMatrix OpenGL directional light shader Diffuse lighting for a moving object Based on these posts, I tried to apply this: #version 300 es uniform mat4 u_mvMatrix; uniform mat4 u_vMatrix; in vec4 a_position; in vec3 a_normal; const vec3 lightDirection = vec3(-1.9, 0.0, -5.0); ... void main() { vec3

If a `buffer` is `coherent`, is there any difference between reading a field or doing `atomicAdd(field, 0)`?

独自空忆成欢 提交于 2021-01-28 05:06:15
问题 This is with Vulkan semantics, if it makes any difference. Assume the following: layout(...) coherent buffer B { uint field; } b; Say the field is being modified by other invocations of the same shader (or a derived shader) through atomic*() funcions. If a shader invocation wants to perform an atomic read from this field (with the same semantics as atomicCounter() in GLES, had this been an atomic_uint instead), is there any difference between the following two (other than obviously that one