opengl-es

interpolated texture coordinates

*爱你&永不变心* 提交于 2019-12-06 06:40:52
I am working on an OpenGL ES fluid simulation which uses texture maps to hold grid values. I need to iterate thru the grid that mimics the following loop: for (int r = 0; r < 128; r++) for (int c = 0; c < 128; c++) process grid element at (c,r) To iterate through the grid I am simply filling a quadrilateral which causes my fragment program to be invoked for each fragment. The texture coordinates (0,0), (1,0), (0,1), (1,1) are associated with the vertices (-1,-1), (+1,-1), (-1,+1), (+1,+1) and I render the quad (as a triangle strip) into a 128x128 texture map attached to a FBO as follows:

iOS- How to paint in the within limits

本小妞迷上赌 提交于 2019-12-06 06:38:13
问题 I used the scanning line seed filling algorithm to realize the color filling function. But I don't know how to do that. When my pen lands in the flower, I need to draw only Inside the black edge of the flower,do not draw in the hair. I have tried to use : CALayer *layer = [CALayer layer]; layer.contents = (__bridge id)(image.CGImage); self.drawView.layer.mask = layer; But the plan didn't work. if any one gives solution it would be so great,Thank you. (English is not my native language; please

How do you draw a cylinder with OpenGLES?

淺唱寂寞╮ 提交于 2019-12-06 06:37:50
问题 How do you draw a cylinder with OpenGLES? 回答1: You'll need to do it via object loading. You can't call on 3D shape primitives using Open GL ES. Look through Jeff Lamarche's blog, there's lots of really good resources on how to object load there. link text 回答2: First step is to write a subroutine that draws a triangle. I'll leave that up to you. Then just draw a series of triangles the make up the shape of a cylinder. The trick is to approximate a circle with a polygon with a large number of

How to use glDrawTex*

故事扮演 提交于 2019-12-06 06:29:36
I want to take a .png image and use it as the background for my GLView. I've heard that glDrawTex* was the best way, but I've searched the internet and haven't found a single example of how to use it (at least not one that has worked for me). Any help? Although the OES_draw_texture extension is a good enough way to draw a background because it may sometimes be a little faster than using geometry, I'd recommend against using it too heavily on the basis that iPhones don't implement it under ES 2 and you don't want to box yourself into a corner. That being said, something like: int sourceRect[4]

Sprite Kit game crashes on Game Over on tvOS 9.1 and iOS 9.2

这一生的挚爱 提交于 2019-12-06 06:23:56
I have a Sprite Kit game that is crashing when the game is over. This happening on the tvOS 9.1 and iOS 9.2. Before, I had it running on iOS 9.1 without crashing. It seems to be an OpenGL issue, but when I search the function in Xcode, it doesn't come up with anything. Unfortunately, the error is not consistent in appearing in the console. Here's the error: Jet: draw_indexed: indexType must be 'unsigned_int' or 'unsigned_short' Assertion failed: (indexType == jet_component_type_unsigned_int || indexType == jet_component_type_unsigned_short), function draw_indexed, file /BuildRoot/Library

LibGDX Stencil Buffers while using SpriteBatch

浪尽此生 提交于 2019-12-06 06:20:46
This is a continuation of my previous problem and post, seen here . Thanks to the answer I received there I feel I was able to get a little closer to my goal, as well as further my learning of OpenGL, but shortly after figuring out the basics of working with stencil buffers, I've run into a problem. It seems that when I draw a sprite to the stencil buffer, it draws the entire square area, rather than just the pixels that aren't fully transparent as I had ignorantly hoped. I vaguely understand why it happens that way, but I am not sure where the solution lies. I have experimented with the

OpenGL ES color picking on the iPhone

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 06:13:17
问题 I'm looking into 3D on the iPhone, I have managed to get a 3D cube on the device but would like to add interactivity such as touching one face fires a specific event and an other face a different event. I'd rather steer clear of ray picking as this adds extra complexity that I do not want in my app. I've read up on quite a few color picking tutorials, but there doesn't seem to be any iPhone specific tutorials or sample code anywhere on the web. My main problem is drawing unique colored

iDevice slows render when there's no interaction

强颜欢笑 提交于 2019-12-06 06:06:30
I'm making an application in C# Xamarin that uses a iPhoneOSGameView for rendering some video stream I receive from the network. The problem is that after around 10 seconds without any user interaction with the screen, the frame rate drops significantly. It seems that the iDevice is going into some sort of power saving mode. When I interact with the screen (e.g. I pull down the top bar menu (iOS menu)), the frame rate goes back up, just like the iDevice realized I was actually using the application now. Is there a setting/value I have to set in my application to prevent this type of CPU/GPU

How to use unity CreateExternalTexture on Android?

亡梦爱人 提交于 2019-12-06 05:56:21
问题 Can someone please help me figure out what is the problem with my code? I am trying to load an image from the native side and send the texture to Unity. I am using Unity Pro 5.0.2f1. Unity Side: void Start () { AndroidJavaObject mImageLoader = new AndroidJavaObject("com.saeid.android.LoadTexture2D"); Texture2D texture2D = new Texture2D(1920, 1080, TextureFormat.ARGB32, false); Int32 texPtr = mImageLoader.Call <Int32> ("loadImageReturnTexturePtr", "/storage/sdcard0/Images/test.jpg"); Debug.Log

Creating and loading .pngs in RGBA4444 RGBA5551 for openGL

给你一囗甜甜゛ 提交于 2019-12-06 05:53:31
I'm creating an openGL game and so far I have been using .pngs in the RGBA8888 format as texture sheets, but those are too memory hungry, and my app crashes frequently. I read in Apple's site that such format such be used just when too much quality is needed, and recommends to use RGBA4444 and RGBA5551 instead ( I already converted my textures to PVR but the quality loss is too great in most of the sprite sheets). I only need to use GL_UNSIGNED_SHORT_5_5_5_1 or GL_UNSIGNED_SHORT_4_4_4_4 in my glTexImage2D call inside my texture loader class in order to load my textures, but I need to convert