shader

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

Create geometry shader using python opengl (PyOpenGL) failed

你。 提交于 2021-01-28 13:48:42
问题 I want to create geometry_shader using glCreateShader(GL_GEOMETRY_SHADER), but I get error. Traceback (most recent call last): File "test.py", line 9, in <module> geometry_shader = glCreateShader(GL_GEOMETRY_SHADER) File "errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src/errorchecker.c:1218) OpenGL.error.GLError: GLError( err = 1280, description = b'invalid enumerant', baseOperation = glCreateShader, cArguments = (GL_GEOMETRY_SHADER,), result = 0 )

Create geometry shader using python opengl (PyOpenGL) failed

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 13:46:46
问题 I want to create geometry_shader using glCreateShader(GL_GEOMETRY_SHADER), but I get error. Traceback (most recent call last): File "test.py", line 9, in <module> geometry_shader = glCreateShader(GL_GEOMETRY_SHADER) File "errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src/errorchecker.c:1218) OpenGL.error.GLError: GLError( err = 1280, description = b'invalid enumerant', baseOperation = glCreateShader, cArguments = (GL_GEOMETRY_SHADER,), result = 0 )

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

Hide area of an SCNMaterial

懵懂的女人 提交于 2021-01-28 09:19:53
问题 I'm using SceneKit and ARKit 1.5, once a surface has been mapped I apply a material to it. I would like to only show what's under the camera in a certain radius with an alpha effect. I want to keep the material static meaning that it does not move when the camera moves, only the radius shape will move. What kind of technique could I use for this ? ArCore by Google does this perfectly. Actual rendering: Desired Rendering: ARCore example: (click to see GIF) Thank you! 回答1: I would use a shader

Is it possible to create a DepthMask effect in Unity's HDRP?

假装没事ソ 提交于 2021-01-28 08:47:05
问题 I've been banging my head against this for a while but I cannot figure out if it is possible to create a DepthMask shader for HDRP (as descibed here). For my exact use, I'm trying to create a "hole" in the shape of whatever I have the material applied to, that shows the contents of a different camera rendered behind everything. I tried messing around with the render queue within the shader, different ZTest and ZWrite combinations, as well as some variations of the shader I found. On top of

Dynamically change property of Shader

戏子无情 提交于 2021-01-28 02:50:34
问题 I have a shader on a gameObject in Unity, Lets call it FooShader. In FooShader there is a public property called _fooVal I want to update in real time. I've created a blank C# script on the same gameObject. My first problem is how do I reference this FooShader shader? And then once I have a correct reference change its _fooVal property? I've tried using the following to get a reference to the Shader but it doesn't work. gameObject.material._fooVal 回答1: If I'm understanding your question

OpenGl blurring

倖福魔咒の 提交于 2021-01-27 07:15:03
问题 I'm using libgdx and want to make a common Gaussian blur post-processing effect. Following this guide I faced some issues with texture filtering. Here the images: actual image: blurred with radius = 1: blurred with radius = 5: In the simplest case, I just have a transparent frame buffer object with some objects rendered to it. Then I need to apply some shader effects to this, basically only blur and then render the result to the screen. I also want to adjust the blur radius, but if I set the

OpenGl blurring

亡梦爱人 提交于 2021-01-27 07:14:08
问题 I'm using libgdx and want to make a common Gaussian blur post-processing effect. Following this guide I faced some issues with texture filtering. Here the images: actual image: blurred with radius = 1: blurred with radius = 5: In the simplest case, I just have a transparent frame buffer object with some objects rendered to it. Then I need to apply some shader effects to this, basically only blur and then render the result to the screen. I also want to adjust the blur radius, but if I set the