opengl-es

OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?

两盒软妹~` 提交于 2021-02-05 09:02:29
问题 I see an issue where I can correctly draw a textured polygon if all vertices remain onscreen within a perspective projection, BUT if I scale the quad large enough such that one more more vertices fall 'too far behind' the viewing volume, then the resulting OpenGL drawing is incorrect (see screenshots). The texture mapping becomes skewed, and it appears as though the offscreen vertex 'moved' and becomes distorted. I am using GLES 2.0 code on a GLES 3.0 compliant driver (details at bottom). I

I'm trying to draw objects using opengles in Android Native-activity, but I don't see anything

笑着哭i 提交于 2021-02-05 08:22:49
问题 I'm developing my game using opengles1.0 in Native Activity. However, source code, which used to work well, doesn't work. Nothing is drawing on the screen, but I want to know the cause. This is my source code. static int engine_init_display(struct engine* engine) { // initialize OpenGL ES and EGL /* * Here specify the attributes of the desired configuration. * Below, we select an EGLConfig with at least 8 bits per color * component compatible with on-screen windows */ const EGLint attribs[] =

Xamarin : Loading resources via GetManifestResourceStream

大城市里の小女人 提交于 2021-02-05 06:10:51
问题 I am working on a Xamarin forms project to use OpenGL/OpenTK. I am trying to load a shader using GetManifestResourceStream. Whatever I do I get null code is being run from .Shared project, shaders are in .ios / .Android resources directory string prefix; #if __IOS__ prefix = "OpenGLTesting.iOS."; #endif #if __ANDROID__ prefix = "OpenGLTesting.Droid."; #endif var assembly = typeof(App).GetTypeInfo ().Assembly; Stream stream = assembly.GetManifestResourceStream (prefix + shaderName + ".glsl");

Xamarin : Loading resources via GetManifestResourceStream

北慕城南 提交于 2021-02-05 06:10:33
问题 I am working on a Xamarin forms project to use OpenGL/OpenTK. I am trying to load a shader using GetManifestResourceStream. Whatever I do I get null code is being run from .Shared project, shaders are in .ios / .Android resources directory string prefix; #if __IOS__ prefix = "OpenGLTesting.iOS."; #endif #if __ANDROID__ prefix = "OpenGLTesting.Droid."; #endif var assembly = typeof(App).GetTypeInfo ().Assembly; Stream stream = assembly.GetManifestResourceStream (prefix + shaderName + ".glsl");

Xamarin : Loading resources via GetManifestResourceStream

有些话、适合烂在心里 提交于 2021-02-05 06:09:45
问题 I am working on a Xamarin forms project to use OpenGL/OpenTK. I am trying to load a shader using GetManifestResourceStream. Whatever I do I get null code is being run from .Shared project, shaders are in .ios / .Android resources directory string prefix; #if __IOS__ prefix = "OpenGLTesting.iOS."; #endif #if __ANDROID__ prefix = "OpenGLTesting.Droid."; #endif var assembly = typeof(App).GetTypeInfo ().Assembly; Stream stream = assembly.GetManifestResourceStream (prefix + shaderName + ".glsl");

Fast copy between two FBO(s) or from FBO to Texture in OpenGL-ES 1.1

China☆狼群 提交于 2021-01-29 07:25:57
问题 Greetings. My goal is to implement a pipeline for processing video frames that has a "current" and "previous" frame. It needs to copy a subregion from the "previous" frame into the "current" frame on some occasions. This is a kind of decoder which is part of a larger application. This is what I have running so far, on the iPhone using OpenGL-ES 1.1 glCopyTexSubImage2D .--------------------\ glTexSubImage2D V glDrawArray | image --------------------------> Texture --------------> FBO/Texture -

Is it OK to use highp in fragment shaders for iOS/Android?

心已入冬 提交于 2021-01-29 04:01:06
问题 According to the GLSL ES reference, support for highp in fragment shaders is optional. So I have been using precision mediump float; in all my fragment shaders so I don't have device compatibility issues. In some cases it's quite difficult to produce good-looking output with only 10 bits of relative precision, and I would love to be able to switch to highp when necessary. How safe is it in practice to require highp support in a fragment shader? I've tried it on a variety of devices, and it

Shader with SpriteKit only register alpha for black color

半城伤御伤魂 提交于 2021-01-28 19:47:05
问题 I'm starting to use shaders with SpriteKit on iOS. And it's quite a journey... Right now I have some strange behaviour. I was trying to create a outer glow shader. So my goal was to modify the color and alpha of transparent pixel to be less transparent and with a specific color, and I was unable to achieve the transparence level of it. So I dug and created the following: I loaded a texture with different alpha levels (mostly 0 and 1) into an SKSpriteNode Applied the shader. The shader is the

SceneKit - Remove stitching line in edges borders

帅比萌擦擦* 提交于 2021-01-28 18:22:11
问题 I'm displaying a texture on a cube (see SceneKit - Map cube texture to box) Things work well now, but the result show a light stitching line between some of the cube faces that I outlined here (you are inside the cube): Any idea how I can get rid of that? The input texture looks like So there is some discontinuity in the input. I'm using a custom SceneKit geometry that doesn't do much more than mapping this texture to a cube. You can find the relevant code in question mentioned above: https:/

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