opengl-es

is Open GL a Overkill for a 2d Card Game?

孤街醉人 提交于 2019-12-23 19:20:18
问题 I was just have an idea of creating a card game and I was just thinking whether to use OpenGl or CoreAnimation.Can you please tell me whether it would be a bit of a overkill to use OpenGL for s 2D card game.Thanks :) 回答1: It's hard to say without knowing more. You can get pretty far using CALayers, images or drawing with quartz for the cards though. It really depends on the level of visual effects you are considering. If it's just moving cards around, then I'd say use layers. 回答2: Might want

c++ OpenGL glGetUniformLocation for Sampler2D returns -1 on Raspberry PI but works on Windows

青春壹個敷衍的年華 提交于 2019-12-23 19:17:14
问题 I'm making a crossplatform OpenGL program. However, I've encountered a problem, where glGetUniformLocation, which should return the location of a uniform variable in my shader program, returns -1, and it only occurs on Linux (Raspbian distro, ran on Raspberry PI), and on Windows the same code works perfectly! Here's my code: Load Shader program function: int shader, status; programID = glCreateProgram(); // Load vertex shader shader = LoadShaderFromString(GL_VERTEX_SHADER, Tools:

spherical animation with text for using tag cloud in android app [News Republic]

眉间皱痕 提交于 2019-12-23 17:17:15
问题 I want to create spherical animation in my android app similar to this in News Republic app. I have tried to create a sphere so far but can anyone guide me how to proceed to develop animations like this in android. Do we have to use opengl only or we can achieve it with other alternative option. Also, when the text is clicked it opens the related news in a different screen. EDIT I finally found some solution for this, which is available under this package. But, the animation is not smooth

spherical animation with text for using tag cloud in android app [News Republic]

拜拜、爱过 提交于 2019-12-23 17:14:35
问题 I want to create spherical animation in my android app similar to this in News Republic app. I have tried to create a sphere so far but can anyone guide me how to proceed to develop animations like this in android. Do we have to use opengl only or we can achieve it with other alternative option. Also, when the text is clicked it opens the related news in a different screen. EDIT I finally found some solution for this, which is available under this package. But, the animation is not smooth

GPUImage's GPUImageOpacityFilter not behaving as expected, doesn't change alpha channel

时间秒杀一切 提交于 2019-12-23 17:11:35
问题 I'm trying to do an Overlay Blend of a stock image with the output of the camera feed where the stock image has less than 100% opacity. I figured I could just place a GPUImageOpacityFilter in the filter stack and everything would be fine: GPUImageVideoCamera -> MY_GPUImageOverlayBlendFilter GPUImagePicture -> GPUImageOpacityFilter (Opacity 0.1f) -> MY_GPUImageOverlayBlendFilter MY_GPUImageOverlayBlendFilter -> GPUImageView But what that resulted in wasn't a 0.1f alpha version of

Does SpriteKit support dense tessellation of a sprite / texture / shape so it can be warped freely?

烈酒焚心 提交于 2019-12-23 16:11:00
问题 For example if you have an image of a trampoline, and a character jumping on it. Then you want to animate how the trampoline bends down in the center. To do this I would have to take a bitmap and apply it to a densely tessellated OpenGL ES mesh. Then apply texture to it. Then deform the mesh. Does SpriteKit support this or can it only display textures as-is? 回答1: With iOS 10, SKWarpGeometry has been added that allows you to deform sprites. Warps are defined using a source and destination grid

Draw a rounded rectangle using a single glDrawElement( triangle_strip…) call in OpenGL ES

笑着哭i 提交于 2019-12-23 15:36:30
问题 I want to draw a rounded rectangle in Opengl es, with a single glDraw call. I have also tried it. and shared it in the answer. Hope it will be helpful. 回答1: I have tried to draw a rounded rectangle in opengl es with single glDraw call. Below is the code snippet: // -0.3f, -0.2f, 0.0f, // 0 // 0.3f, -0.2f, 0.0f, // 1 // -0.3f, 0.2f, 0.0f, // 2 // 0.3f, 0.2f, 0.0f, // 3 // 0.6f, 0.2f, 0.0f, // 4 // 0.6f, -0.2f, 0.0f, // 5 // 0.6f, -0.5f, 0.0f, // 6 // 0.3f, -0.5f, 0.0f, // 7 // -0.3f, -0.5f, 0

opengl object vibrate after moving a distance

你。 提交于 2019-12-23 13:23:09
问题 I have an object which moves on a terrain and a third person camera follow it, after I move it for some distance in different directions it begin to shaking or vibrating even if it is not moving and the camera rotates around it, this is the moving code of the object double& delta = engine.getDeltaTime(); GLfloat velocity = delta * movementSpeed; glm::vec3 t(glm::vec3(0, 0, 1) * (velocity * 3.0f)); //translate the objet atri before rendering matrix = glm::translate(matrix, t); //get the

Mapping irregular shapes or other polygons (cartoons, sprites) to triangles in OpenGL ES

拥有回忆 提交于 2019-12-23 13:03:28
问题 I don't understand the concept of showing sprites mapped into OpenGL Triangles. If OpenGL ES only draws triangles and points, How do you display/map non-triangular shapes? Why would a shape mapped to a triangle not be distorted? To explain: In my mind, mapping, say, a sprite of Mario, to a triangle would produce a distorted or cropped Mario. In such a case, the head would be squished or invisible. 回答1: If I've understood the concern correctly: you simply divide the square into two triangles,

Can you use glVertexAttribPointer to assign a smaller vector to a larger one?

倖福魔咒の 提交于 2019-12-23 09:59:39
问题 From section 5.8 of The OpenGL® ES Shading Language (v1.00, r17) [PDF] (emphasis mine): The assignment operator stores the value of the rvalue-expression into the l-value and returns an r-value with the type and precision of the lvalue-expression. The lvalue-expression and rvalue-expression must have the same type. All desired type-conversions must be specified explicitly via a constructor. So it sounds like doing something like this would not be legal: vec3 my_vec3 = vec3(1, 2, 3); vec4 my